xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, unsigned char const *, int);
int smcExitSafeStart(int fd) {
  const unsigned char command = 0x83;
  if (write(fd, &command, 1) == -1) {
    perror("error writing");
    return -9999;
  }
  return 0;
}


x86 assembly (clang, -O0):
<smcExitSafeStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0x83,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1161 <smcExitSafeStart+0x41>
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffd8f1,-0x4(%rbp)
jmp    1168 <smcExitSafeStart+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smcExitSafeStart>:
push   %rax
movb   $0x83,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1140 <smcExitSafeStart+0x20>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffd8f1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"error writing\00"
define i32 @smcExitSafeStart(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 -125, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* %4, i32 1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -9999, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"error writing\00"
define i32 @smcExitSafeStart(i32 %0) {
%2 = alloca i8
store i8 -125, i8* %2
%3 = call i32 @write(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -9999, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x_root;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
int get_XKeyEvent_x_root(void *_p) { return (int)((XKeyEvent *)_p)->x_root; }


x86 assembly (clang, -O0):
<get_XKeyEvent_x_root>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XKeyEvent_x_root>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyEvent_x_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyEvent_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int My_Add(int i, int j) { return i + j; }


x86 assembly (clang, -O0):
<My_Add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<My_Add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @My_Add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @My_Add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: traceroute6 [-dnrvV] [-m max_ttl] [-p port#] [-q "
          "nqueries]\n\t[-s src_addr] [-t tos] [-w wait] host [data size]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [118 x i8] c"Usage: traceroute6 [-dnrvV] [-m max_ttl] [-p port#] [-q nqueries]\0A\09[-s src_addr] [-t tos] [-w wait] host [data size]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [118 x i8] c"Usage: traceroute6 [-dnrvV] [-m max_ttl] [-p port#] [-q nqueries]\0A\09[-s src_addr] [-t tos] [-w wait] host [data size]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char f71(unsigned char x, int y) { return (x << y) + (x >> (8 - y)); }


x86 assembly (clang, -O0):
<f71>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f71>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x8,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f71(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 8, %11
%13 = ashr i32 %10, %12
%14 = add nsw i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f71(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 8, %1
%6 = lshr i32 %3, %5
%7 = add nsw i32 %6, %4
%8 = trunc i32 %7 to i8
ret i8 %8
}
void ExttContainerTypeAuxTable(void) {}


x86 assembly (clang, -O0):
<ExttContainerTypeAuxTable>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttContainerTypeAuxTable>:
ret

LLVM IR (-O0):
define void @ExttContainerTypeAuxTable() {
ret void
}

LLVM IR (-O2):
define void @ExttContainerTypeAuxTable() {
ret void
}
int eraVersionMicro(void) { return 0; }


x86 assembly (clang, -O0):
<eraVersionMicro>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraVersionMicro>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eraVersionMicro() {
ret i32 0
}

LLVM IR (-O2):
define i32 @eraVersionMicro() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Memento_free(void *b) { free(b); }


x86 assembly (clang, -O0):
<Memento_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memento_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Memento_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @Memento_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushinp();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ gettext(char *);
int /*<<< orphan*/ mvaddstr(int, int, int /*<<< orphan*/);
void pressanykey(int y, int x) {
  flushinp();
  mvaddstr(y, x, gettext("Press any key to continue..."));
  getch();
}


x86 assembly (clang, -O0):
<pressanykey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <flushinp@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xe98(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1060 <mvaddstr@plt>
mov    $0x0,%al
call   1040 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressanykey>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <flushinp@plt>
lea    0xeab(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1060 <mvaddstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <getch@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Press any key to continue...\00"
define void @pressanykey(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @flushinp()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @mvaddstr(i32 %6, i32 %7, i32 %8)
%10 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Press any key to continue...\00"
define void @pressanykey(i32 %0, i32 %1) {
%3 = tail call i32 (...) @flushinp()
%4 = tail call i32 @gettext(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mvaddstr(i32 %0, i32 %1, i32 %4)
%6 = tail call i32 (...) @getch()
ret void
}
void initjobs() {}


x86 assembly (clang, -O0):
<initjobs>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initjobs>:
ret

LLVM IR (-O0):
define void @initjobs() {
ret void
}

LLVM IR (-O2):
define void @initjobs() {
ret void
}
int syscall_fixup(struct tcb *tcp) { return 1; }


x86 assembly (clang, -O0):
<syscall_fixup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_fixup>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @syscall_fixup(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @syscall_fixup(%struct.tcb* nocapture readnone %0) {
ret i32 1
}
void ff_hevc_put_hevc_uni_epel_hv48_12_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_uni_epel_hv48_12_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_uni_epel_hv48_12_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_uni_epel_hv48_12_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv48_12_sse4() {
ret void
}
extern void __outb_p(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
}


x86 assembly (clang, -O0):
<__outb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
jmp    111e <__outb_p+0x1e>
jmp    1123 <__outb_p+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outb_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
jmp    1107 <__outb_p+0x7>
jmp    1109 <__outb_p+0x9>
ret

LLVM IR (-O0):
define void @__outb_p(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outb_p(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
print_label(label) int label;
{
  output_label_prefix();
  output_decimal(label);
}


x86 assembly (clang, -O0):
<print_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <output_label_prefix@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <output_decimal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_label>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <output_label_prefix@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <output_decimal@plt>

LLVM IR (-O0):
define i32 @print_label(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @output_label_prefix()
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @output_decimal to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @print_label(i32 %0) {
%2 = tail call i32 (...) @output_label_prefix()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @output_decimal to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
int test2(int x) { return x / -10 == 0; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
add    $0x9,%edi
xor    %eax,%eax
cmp    $0x13,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
%4 = zext i1 %3 to i32
ret i32 %4
}
char *strpbrk(const char *string, const char *stop) {
  for (; *string != '\0'; string++)
    if (strchr(stop, *string) != ((void *)0))
      return (char *)string;
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116d <strpbrk+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1157 <strpbrk+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <strpbrk+0x65>
jmp    115c <strpbrk+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strpbrk+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <strpbrk+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <strpbrk+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strpbrk+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i8* @strchr(i8* %12, i32 %15)
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = load i8*, i8** %4
store i8* %19, i8** %3
br label %25
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
br label %6
24: ; preds = %6
store i8* null, i8** %3
br label %25
25: ; preds = %24, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %13, %11 ], [ %3, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = tail call i8* @strchr(i8* dereferenceable(1) %1, i32 %8)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %2
%16 = phi i8* [ null, %2 ], [ null, %11 ], [ %7, %5 ]
ret i8* %16
}
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
void *my_mm_malloc(size_t size, size_t alignment) {
  void *ptr;
  int ret = posix_memalign(&ptr, alignment, size);
  if (ret != 0) {
    return NULL;
  } else {
    return ptr;
  }
}


x86 assembly (clang, -O0):
<my_mm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     114b <my_mm_malloc+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1153 <my_mm_malloc+0x43>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mm_malloc>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    1126 <my_mm_malloc+0x16>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @my_mm_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = call i32 @posix_memalign(i8** %6, i64 %8, i64 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i8* null, i8** %3
br label %16
14: ; preds = %2
%15 = load i8*, i8** %6
store i8* %15, i8** %3
br label %16
16: ; preds = %14, %13
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @my_mm_malloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = icmp eq i32 %5, 0
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* %7, i8* null
ret i8* %8
}
/* Variables and functions */
char *crypt(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int main(int argc, char **argv) {
  char salt[2];
  char *password;
  int i;
  snprintf(salt, 3, "%s", argv[1]);
  password = crypt(argv[1], salt);
  puts(password);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x3,%esi
lea    0xea2(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x12(%rbp),%rsi
call   1040 <crypt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rcx
lea    0xebe(%rip),%rdx
lea    0x6(%rsp),%r14
mov    %r14,%rdi
mov    $0x3,%esi
call   1050 <snprintf@plt>
mov    0x8(%rbx),%rdi
mov    %r14,%rsi
call   1040 <crypt@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @snprintf(i8* %9, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%18 = call i8* @crypt(i8* %16, i8* %17)
store i8* %18, i8** %7
%19 = load i8*, i8** %7
%20 = call i32 @puts(i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @snprintf(i8* %4, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %5
%9 = call i8* @crypt(i8* %8, i8* %4)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int /*<<< orphan*/, struct stat *);
int bad_fstat(void *addr) { return fstat(0, (struct stat *)addr); }


x86 assembly (clang, -O0):
<bad_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <fstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_fstat>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <fstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @bad_fstat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.stat*
%5 = call i32 @fstat(i32 0, %struct.stat* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @bad_fstat(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.stat*
%3 = tail call i32 @fstat(i32 0, %struct.stat* %2)
ret i32 %3
}
int GetBitInt(const int *x, const int bitNum) {
  return (!!((*x) & (1 << bitNum)));
}


x86 assembly (clang, -O0):
<GetBitInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBitInt>:
mov    %esi,%ecx
mov    (%rdi),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GetBitInt(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @GetBitInt(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
float *Vector3ScaleSelf(float v[3], float scalar) {
  v[0] *= scalar;
  v[1] *= scalar;
  v[2] *= scalar;
  return v;
}


x86 assembly (clang, -O0):
<Vector3ScaleSelf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector3ScaleSelf>:
mov    %rdi,%rax
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @Vector3ScaleSelf(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fmul float %18, %15
store float %19, float* %17
%20 = load float*, float** %3
ret float* %20
}

LLVM IR (-O2):
define float* @Vector3ScaleSelf(float* returned %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ JamesDSPGlobalMemoryAllocation();
__attribute__((constructor)) void initialize(void) {
  JamesDSPGlobalMemoryAllocation();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <JamesDSPGlobalMemoryAllocation@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
xor    %eax,%eax
jmp    1030 <JamesDSPGlobalMemoryAllocation@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize, i8* null }]
define void @initialize() {
%1 = call i32 (...) @JamesDSPGlobalMemoryAllocation()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize, i8* null }]
define void @initialize() {
%1 = tail call i32 (...) @JamesDSPGlobalMemoryAllocation()
ret void
}
/* Variables and functions */
int isspace(int);
int ismyspace(int c) { return isspace(c); }


x86 assembly (clang, -O0):
<ismyspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismyspace>:
jmp    1030 <isspace@plt>

LLVM IR (-O0):
define i32 @ismyspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isspace(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ismyspace(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
long MemFree() { return (-1L); }


x86 assembly (clang, -O0):
<MemFree>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemFree>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @MemFree() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @MemFree() {
ret i64 -1
}
signed short int signedshortint_ignoring_longint(signed short int x,
                                                 long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_longint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshortint_ignoring_longint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_longint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_longint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void FanChannelDisable(unsigned long ulBase, unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  DEBUG_ASSERT(ulChannel < 6);
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~(1 << ulChannel);
}


x86 assembly (clang, -O0):
<FanChannelDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x6,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40084000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x6,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
cltq
and    %rax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @FanChannelDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074282496
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
%17 = sext i32 %16 to i64
%18 = load i64, i64* %3
%19 = add i64 %18, 4
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = and i64 %21, %17
store volatile i64 %22, i64* %20
ret void
}

LLVM IR (-O2):
define void @FanChannelDisable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074282496
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 6
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = trunc i64 %1 to i32
%10 = shl nuw i32 1, %9
%11 = xor i32 %10, -1
%12 = sext i32 %11 to i64
%13 = add i64 %0, 4
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, %12
store volatile i64 %16, i64* %14
ret void
}
/* Variables and functions */
unsigned long _lrotl(unsigned long, int);
unsigned long test_lrotl(unsigned long value, int shift) {
  return _lrotl(value, shift);
}


x86 assembly (clang, -O0):
<test_lrotl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_lrotl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lrotl>:
jmp    1030 <_lrotl@plt>

LLVM IR (-O0):
define i64 @test_lrotl(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 @_lrotl(i64 %5, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @test_lrotl(i64 %0, i32 %1) {
%3 = tail call i64 @_lrotl(i64 %0, i32 %1)
ret i64 %3
}
void Set1024x768_60(void) {
  *((volatile unsigned long *)(0x97000000 + 0x008)) =
      ((136 - 1) << 24) | ((160 - 1) << 16) | (1024 - 1);
  *((volatile unsigned long *)(0x97000000 + 0x00c)) =
      ((6 - 1) << 24) | ((29 - 1) << 16) | (768 - 1);
  *((volatile unsigned long *)(0x97000000 + 0x010)) =
      ((1344 - 1) << 16) | (806 - 1);
  *((volatile unsigned long *)(0xB8000000 + 0x018)) = (1024 << 16) || 768;
}


x86 assembly (clang, -O0):
<Set1024x768_60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x97000008,%eax
movq   $0xffffffff879f03ff,(%rax)
mov    $0x9700000c,%eax
movq   $0x51c02ff,(%rax)
mov    $0x97000010,%eax
movq   $0x53f0325,(%rax)
mov    $0xb8000018,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set1024x768_60>:
mov    $0x97000008,%eax
movq   $0xffffffff879f03ff,(%rax)
movq   $0x51c02ff,0x4(%rax)
05
movq   $0x53f0325,0x8(%rax)
05
movq   $0x1,0x21000010(%rax)
ret

LLVM IR (-O0):
define void @Set1024x768_60() {
store volatile i64 -2019621889, i64* inttoptr (i64 2533359624 to i64*)
store volatile i64 85721855, i64* inttoptr (i64 2533359628 to i64*)
store volatile i64 88015653, i64* inttoptr (i64 2533359632 to i64*)
store volatile i64 1, i64* inttoptr (i64 3087007768 to i64*)
ret void
}

LLVM IR (-O2):
define void @Set1024x768_60() {
store volatile i64 -2019621889, i64* inttoptr (i64 2533359624 to i64*)
store volatile i64 85721855, i64* inttoptr (i64 2533359628 to i64*)
store volatile i64 88015653, i64* inttoptr (i64 2533359632 to i64*)
store volatile i64 1, i64* inttoptr (i64 3087007768 to i64*)
ret void
}
unsigned short cimag_fun_complexOf_ushort(unsigned a) { return a & 0x0000ffff; }


x86 assembly (clang, -O0):
<cimag_fun_complexOf_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cimag_fun_complexOf_ushort>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @cimag_fun_complexOf_ushort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @cimag_fun_complexOf_ushort(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ cup(int, int);
int /*<<< orphan*/ deccolm(int);
int /*<<< orphan*/ printf(char *);
int bug_c(const char *the_title) {
  deccolm((1));
  cup(1, 81);
  deccolm((0));
  cup(12, 5);
  printf("Except for this line, the screen should be blank. ");
  return 1;
}


x86 assembly (clang, -O0):
<bug_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <deccolm@plt>
mov    $0x1,%edi
mov    $0x51,%esi
call   1040 <cup@plt>
xor    %edi,%edi
call   1050 <deccolm@plt>
mov    $0xc,%edi
mov    $0x5,%esi
call   1040 <cup@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug_c>:
push   %rax
mov    $0x1,%edi
call   1050 <deccolm@plt>
mov    $0x1,%edi
mov    $0x51,%esi
call   1040 <cup@plt>
xor    %edi,%edi
call   1050 <deccolm@plt>
mov    $0xc,%edi
mov    $0x5,%esi
call   1040 <cup@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Except for this line, the screen should be blank. \00"
define i32 @bug_c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @deccolm(i32 1)
%4 = call i32 @cup(i32 1, i32 81)
%5 = call i32 @deccolm(i32 0)
%6 = call i32 @cup(i32 12, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [51 x i8] c"Except for this line, the screen should be blank. \00"
define i32 @bug_c(i8* nocapture readnone %0) {
%2 = tail call i32 @deccolm(i32 1)
%3 = tail call i32 @cup(i32 1, i32 81)
%4 = tail call i32 @deccolm(i32 0)
%5 = tail call i32 @cup(i32 12, i32 5)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void mem_put_be24_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (unsigned char)((val >> 16) & 0xff);
  mem[1] = (unsigned char)((val >> 8) & 0xff);
  mem[2] = (unsigned char)((val >> 0) & 0xff);
}


x86 assembly (clang, -O0):
<mem_put_be24_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_be24_as_int>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rdi)
mov    %ah,0x1(%rdi)
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_be24_as_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 16
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = ashr i32 %19, 0
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @mem_put_be24_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
void foo584() {}


x86 assembly (clang, -O0):
<foo584>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo584>:
ret

LLVM IR (-O0):
define void @foo584() {
ret void
}

LLVM IR (-O2):
define void @foo584() {
ret void
}
/* Type definitions */
struct nn_epbase {
  int dummy;
};

/* Variables and functions */
int nn_btcp_create(void *, struct nn_epbase **);
int nn_tcp_bind(void *hint, struct nn_epbase **epbase) {
  return nn_btcp_create(hint, epbase);
}


x86 assembly (clang, -O0):
<nn_tcp_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nn_btcp_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_tcp_bind>:
jmp    1030 <nn_btcp_create@plt>

LLVM IR (-O0):
%struct.nn_epbase = type { i32 }
define i32 @nn_tcp_bind(i8* %0, %struct.nn_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.nn_epbase**
store i8* %0, i8** %3
store %struct.nn_epbase** %1, %struct.nn_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.nn_epbase**, %struct.nn_epbase*** %4
%7 = call i32 @nn_btcp_create(i8* %5, %struct.nn_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.nn_epbase = type { i32 }
define i32 @nn_tcp_bind(i8* %0, %struct.nn_epbase** %1) {
%3 = tail call i32 @nn_btcp_create(i8* %0, %struct.nn_epbase** %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t dvbsubs_get_length(const uint8_t *p_dvbsubs) {
  return (p_dvbsubs[4] << 8) | p_dvbsubs[5];
}


x86 assembly (clang, -O0):
<dvbsubs_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbsubs_get_length>:
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @dvbsubs_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @dvbsubs_get_length(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_continue() {
  printf("\nWould you like to continue with the Babbler? (yes/no): ");
  return;
}


x86 assembly (clang, -O0):
<msg_continue>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_continue>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"\0AWould you like to continue with the Babbler? (yes/no): \00"
define void @msg_continue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"\0AWould you like to continue with the Babbler? (yes/no): \00"
define void @msg_continue() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}
int sum(int a, int b) { return 0; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
ret i32 0
}
void gtk_font_button_set_title() {}


x86 assembly (clang, -O0):
<gtk_font_button_set_title>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_font_button_set_title>:
ret

LLVM IR (-O0):
define void @gtk_font_button_set_title() {
ret void
}

LLVM IR (-O2):
define void @gtk_font_button_set_title() {
ret void
}
void ble_rsp_test_phy_tx(const void *nul) {}


x86 assembly (clang, -O0):
<ble_rsp_test_phy_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ble_rsp_test_phy_tx>:
ret

LLVM IR (-O0):
define void @ble_rsp_test_phy_tx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @ble_rsp_test_phy_tx(i8* nocapture %0) {
ret void
}
unsigned int exynos_calc_padding_size(unsigned int len) {
  unsigned int residue = len & 0x3;
  return residue ? (4 - residue) : 0;
}


x86 assembly (clang, -O0):
<exynos_calc_padding_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <exynos_calc_padding_size+0x2a>
mov    $0x4,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <exynos_calc_padding_size+0x34>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <exynos_calc_padding_size+0x34>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exynos_calc_padding_size>:
and    $0x3,%edi
mov    $0x4,%eax
sub    %edi,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @exynos_calc_padding_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 4, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %8
%13 = phi i32 [ %10, %8 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @exynos_calc_padding_size(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = sub nuw nsw i32 4, %2
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ pump(int, int);
void *pump_thread(void *data) {
  int *files = (int *)data;
  int input = files[0];
  int output = files[1];
  pump(input, output);
  free(data);
  return NULL;
}


x86 assembly (clang, -O0):
<pump_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <pump@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pump_thread>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    0x4(%rbx),%esi
call   1030 <pump@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pump_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @pump(i32 %14, i32 %15)
%17 = load i8*, i8** %2
%18 = call i32 @free(i8* %17)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @pump_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @pump(i32 %3, i32 %6)
%8 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
void *realloc(void *, size_t);
void *jason_Realloc(void *ptr, size_t *size) {
  void *newPtr = realloc(ptr, *size);
  if (newPtr == NULL) {
    *size = 0;
  }
  return newPtr;
}


x86 assembly (clang, -O0):
<jason_Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114a <jason_Realloc+0x3a>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jason_Realloc>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rsi
call   1030 <realloc@plt>
test   %rax,%rax
je     1123 <jason_Realloc+0x13>
pop    %rbx
ret
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @jason_Realloc(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64*, i64** %4
store i64 0, i64* %13
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @jason_Realloc(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %2
store i64 0, i64* %1
br label %7
7: ; preds = %6, %2
ret i8* %4
}
int BETWEEN(int a, int b, int c) { return (b < a ? a : (b > c ? c : b)); }


x86 assembly (clang, -O0):
<BETWEEN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1124 <BETWEEN+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <BETWEEN+0x47>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <BETWEEN+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <BETWEEN+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BETWEEN>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @BETWEEN(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %22
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %5
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @BETWEEN(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}