xunge/DecIR huggingface dataset:
unsigned long long two_raised_to(unsigned int n) {
  long long rslt = 1;
  for (int i = 0; i < n; i++) {
    rslt *= 2;
  }
  return (rslt);
}


x86 assembly (clang, -O0):
<two_raised_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113c <two_raised_to+0x3c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <two_raised_to+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_raised_to>:
test   %edi,%edi
je     1118 <two_raised_to+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <two_raised_to+0x1e>
mov    $0x1,%eax
jmp    1139 <two_raised_to+0x39>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffff8,%edi
jne    1130 <two_raised_to+0x30>
test   %ecx,%ecx
je     1148 <two_raised_to+0x48>
nopl   (%rax)
add    %rax,%rax
add    $0xffffffff,%ecx
jne    1140 <two_raised_to+0x40>
ret

LLVM IR (-O0):
define i64 @two_raised_to(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 %0, i32* %2
store i64 1, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 2
store i64 %11, i64* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @two_raised_to(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %21
9: ; preds = %21, %3
%10 = phi i64 [ undef, %3 ], [ %24, %21 ]
%11 = phi i64 [ 1, %3 ], [ %24, %21 ]
%12 = icmp eq i32 %5, 0
br i1 %12, label %19, label %13
13: ; preds = %9, %13
%14 = phi i64 [ %16, %13 ], [ %11, %9 ]
%15 = phi i32 [ %17, %13 ], [ 0, %9 ]
%16 = shl nsw i64 %14, 1
%17 = add i32 %15, 1
%18 = icmp eq i32 %17, %5
br i1 %18, label %19, label %13
19: ; preds = %9, %13, %1
%20 = phi i64 [ 1, %1 ], [ %10, %9 ], [ %16, %13 ]
ret i64 %20
21: ; preds = %21, %7
%22 = phi i64 [ 1, %7 ], [ %24, %21 ]
%23 = phi i32 [ 0, %7 ], [ %25, %21 ]
%24 = shl i64 %22, 8
%25 = add i32 %23, 8
%26 = icmp eq i32 %25, %8
br i1 %26, label %9, label %21
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int helpFlag(int argc, char **argv) {
  return (argc > 1 && !strcmp(argv[1], "--help"));
}


x86 assembly (clang, -O0):
<helpFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jle    114d <helpFlag+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpFlag>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1135 <helpFlag+0x25>
push   %rax
mov    0x8(%rsi),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
define i32 @helpFlag(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %7, %2
%15 = phi i1 [ false, %2 ], [ %13, %7 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
define i32 @helpFlag(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %11
}
long os_atomic_dec_long(volatile long *val) {
  return __atomic_sub_fetch(val, 1, 5);
}


x86 assembly (clang, -O0):
<os_atomic_dec_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
neg    %rax
lock xadd %rax,(%rdx)
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_atomic_dec_long>:
mov    $0xffffffffffffffff,%rax
lock xadd %rax,(%rdi)
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @os_atomic_dec_long(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
store i64 1, i64* %3
%6 = load i64, i64* %3
%7 = atomicrmw volatile sub i64* %5, i64 %6 seq_cst
%8 = sub i64 %7, %6
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @os_atomic_dec_long(i64* %0) {
%2 = atomicrmw volatile sub i64* %0, i64 1 seq_cst
%3 = add i64 %2, -1
ret i64 %3
}
/* Type definitions */
struct Matrix {
  int dummy;
};

/* Variables and functions */
struct Matrix *matrix_reduction(struct Matrix *matrix) {
  struct Matrix *m_reduced = NULL;
  return m_reduced;
}


x86 assembly (clang, -O0):
<matrix_reduction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Matrix = type { i32 }
define %struct.Matrix* @matrix_reduction(%struct.Matrix* %0) {
%2 = alloca %struct.Matrix*
%3 = alloca %struct.Matrix*
store %struct.Matrix* %0, %struct.Matrix** %2
store %struct.Matrix* null, %struct.Matrix** %3
%4 = load %struct.Matrix*, %struct.Matrix** %3
ret %struct.Matrix* %4
}

LLVM IR (-O2):
%struct.Matrix = type { i32 }
define noalias %struct.Matrix* @matrix_reduction(%struct.Matrix* nocapture readnone %0) {
ret %struct.Matrix* null
}
int console_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void h_exit(char *errmesg) {
  perror(errmesg);
  exit(1);
}


x86 assembly (clang, -O0):
<h_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<h_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @h_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @h_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct book {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __print_book(struct book *, int);
void print_book_debug(struct book *book) { __print_book(book, true); }


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

x86 assembly (clang, -O2):
<print_book_debug>:
mov    $0x1,%esi
jmp    1030 <__print_book@plt>

LLVM IR (-O0):
%struct.book = type { i32 }
define void @print_book_debug(%struct.book* %0) {
%2 = alloca %struct.book*
store %struct.book* %0, %struct.book** %2
%3 = load %struct.book*, %struct.book** %2
%4 = call i32 @__print_book(%struct.book* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.book = type { i32 }
define void @print_book_debug(%struct.book* %0) {
%2 = tail call i32 @__print_book(%struct.book* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bublesort(int *, int);
int findkthnum(int *parray, int arraysize, int k) {
  if (parray == NULL)
    return -1;
  bublesort(parray, arraysize);
  return parray[k - 1];
}


x86 assembly (clang, -O0):
<findkthnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <findkthnum+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <findkthnum+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <bublesort@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findkthnum>:
test   %rdi,%rdi
je     1130 <findkthnum+0x20>
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <bublesort@plt>
movslq %ebp,%rax
mov    -0x4(%rbx,%rax,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @findkthnum(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %21
11: ; preds = %3
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = call i32 @bublesort(i32* %12, i32 %13)
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
store i32 %20, i32* %4
br label %21
21: ; preds = %11, %10
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @findkthnum(i32* %0, i32 %1, i32 %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i32 @bublesort(i32* %0, i32 %1)
%7 = add nsw i32 %2, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %3, %5
%12 = phi i32 [ %10, %5 ], [ -1, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fsemu_quit_maybe();
void fsemu_control_quit(void) { fsemu_quit_maybe(); }


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

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

LLVM IR (-O0):
define void @fsemu_control_quit() {
%1 = call i32 (...) @fsemu_quit_maybe()
ret void
}

LLVM IR (-O2):
define void @fsemu_control_quit() {
%1 = tail call i32 (...) @fsemu_quit_maybe()
ret void
}
int HelpItem149(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem149() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short);
int fun_stub_base_8_stub(short a, short b) {
  printf("fun_stub_base_8_stub:a = %d, b = %d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<fun_stub_base_8_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
lea    0xecf(%rip),%rdi
movswl %ax,%esi
movswl -0x4(%rbp),%edx
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_8_stub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fun_stub_base_8_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_8_stub(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 signext %5, i16 signext %6)
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = load i16, i16* %4
%11 = sext i16 %10 to i32
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [37 x i8] c"fun_stub_base_8_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_8_stub(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 signext %0, i16 signext %1)
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_put64(void *dest, const void *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_put64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_put64(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_put64(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int PL_CompareValues(const void *v1, const void *v2) { return v1 == v2; }


x86 assembly (clang, -O0):
<PL_CompareValues>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PL_CompareValues>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @PL_CompareValues(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @PL_CompareValues(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int snprintf(char *, int, char *, char *, char *);
int su_make_fullname_t(char *dir, char *file, char *buf, int bufLen) {
  int usedLen = snprintf(buf, bufLen, "%s/%s", dir, file);
  if (usedLen >= bufLen) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<su_make_fullname_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec3(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     115d <su_make_fullname_t+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <su_make_fullname_t+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<su_make_fullname_t>:
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xedd(%rip),%rdx
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <snprintf@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setge  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i32 @su_make_fullname_t(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @snprintf(i8* %2, i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = icmp sge i32 %5, %3
%7 = sext i1 %6 to i32
ret i32 %7
}
void gtk_tree_view_column_get_reorderable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_reorderable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
__attribute__((__unused__)) __attribute__((__nonnull__)) void
gdnsd_put_una16(const uint16_t v, uint8_t *p) {
  memcpy(p, &v, sizeof(v));
}


x86 assembly (clang, -O0):
<gdnsd_put_una16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdnsd_put_una16>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gdnsd_put_una16(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @memcpy(i32* %5, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @gdnsd_put_una16(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @memcpy(i32* %1, i32* %3, i32 4)
ret void
}
void nseel_asm_mul(void) { __asm__("fmul\n"); }


x86 assembly (clang, -O0):
<nseel_asm_mul>:
push   %rbp
mov    %rsp,%rbp
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_mul>:
fmulp  %st,%st(1)
ret

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

LLVM IR (-O2):
define void @nseel_asm_mul() {
tail call void asm sideeffect "fmul\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ get_ticks();
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A");
    disp_int(get_ticks());
    disp_str(".");
    delay(1);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x0,%al
call   1050 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
lea    0xe92(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
jmp    114f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0xeb0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <disp_str@plt>
xor    %eax,%eax
call   1050 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
jmp    1160 <TestA+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @get_ticks()
%5 = call i32 @disp_int(i32 %4)
%6 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @delay(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @get_ticks()
%4 = tail call i32 @disp_int(i32 %3)
%5 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @delay(i32 1)
br label %1
}
/* Variables and functions */
int stunRand();
int stunRandomPort(void) {
  int min = 0x4000;
  int max = 0x7FFF;
  int ret = stunRand();
  ret = ret | min;
  ret = ret & max;
  return ret;
}


x86 assembly (clang, -O0):
<stunRandomPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4000,-0x4(%rbp)
movl   $0x7fff,-0x8(%rbp)
mov    $0x0,%al
call   1030 <stunRand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stunRandomPort>:
push   %rax
xor    %eax,%eax
call   1030 <stunRand@plt>
and    $0x3fff,%eax
or     $0x4000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stunRandomPort() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 16384, i32* %1
store i32 32767, i32* %2
%4 = call i32 (...) @stunRand()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %1
%7 = or i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @stunRandomPort() {
%1 = tail call i32 (...) @stunRand()
%2 = and i32 %1, 16383
%3 = or i32 %2, 16384
ret i32 %3
}
void replay_ansic_grammar_with_dparser() {
  int result = replay_malloc("/tmp/trace.txt");
  _assert_equal((unsigned long)0, (unsigned long)result, "0", "result",
                __func__);
}


x86 assembly (clang, -O0):
<replay_ansic_grammar_with_dparser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1040 <replay_malloc@plt>
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xec7(%rip),%rdx
lea    0xec2(%rip),%rcx
lea    0xec2(%rip),%r8
mov    $0x0,%al
call   1030 <_assert_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replay_ansic_grammar_with_dparser>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <replay_malloc@plt>
movslq %eax,%rsi
lea    0xed6(%rip),%rdx
lea    0xed1(%rip),%rcx
lea    0xed1(%rip),%r8
xor    %edi,%edi
xor    %eax,%eax
pop    %r9
jmp    1030 <_assert_equal@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/trace.txt\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [7 x i8] c"result\00"
@__func__.replay_ansic_grammar_with_dparser = [34 x i8] c"replay_ansic_grammar_with_dparser\00"
define void @replay_ansic_grammar_with_dparser() {
%1 = alloca i32
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @replay_malloc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = call i32 (i64, i64, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_assert_equal to i32 (i64, i64, i8*, i8*, i8*, ...)*)(i64 0, i64 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.replay_ansic_grammar_with_dparser, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/trace.txt\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [7 x i8] c"result\00"
@__func__.replay_ansic_grammar_with_dparser = [34 x i8] c"replay_ansic_grammar_with_dparser\00"
define void @replay_ansic_grammar_with_dparser() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @replay_malloc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = tail call i32 (i64, i64, i8*, i8*, i8*, ...) bitcast (i32 (...)* @_assert_equal to i32 (i64, i64, i8*, i8*, i8*, ...)*)(i64 0, i64 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.replay_ansic_grammar_with_dparser, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_eor();
int /*<<< orphan*/ e_zpx();
void e_eor_zpx() {
  e_zpx();
  e_eor();
}


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

x86 assembly (clang, -O2):
<e_eor_zpx>:
push   %rax
xor    %eax,%eax
call   1030 <e_zpx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_eor@plt>

LLVM IR (-O0):
define void @e_eor_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_eor()
ret void
}

LLVM IR (-O2):
define void @e_eor_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_eor()
ret void
}
__attribute__((no, noclone)) int f5(int x) { return x >= 0 ? ~x : x; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111f <f5+0x1f>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <f5+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int my_itoa_buffer_size(unsigned int, unsigned char);
unsigned int my_itoa_char_char_size(unsigned int number, unsigned char nbc,
                                    unsigned char base) {
  int len;
  if ((len = (my_itoa_buffer_size(number, base) - 1)) < nbc)
    nbc = nbc - len;
  else
    nbc = 0;
  return nbc;
}


x86 assembly (clang, -O0):
<my_itoa_char_char_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x6(%rbp),%esi
call   1030 <my_itoa_buffer_size@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jge    1153 <my_itoa_char_char_size+0x43>
movzbl -0x5(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
jmp    1157 <my_itoa_char_char_size+0x47>
movb   $0x0,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_itoa_char_char_size>:
push   %rbx
mov    %esi,%ebx
mov    %edx,%esi
call   1030 <my_itoa_buffer_size@plt>
mov    %ebx,%ecx
sub    %eax,%ecx
add    $0x1,%ecx
xor    %edx,%edx
cmp    %eax,%ebx
movzbl %cl,%eax
cmovl  %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_itoa_char_char_size(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i32, i32* %4
%9 = load i8, i8* %6
%10 = call i32 @my_itoa_buffer_size(i32 %8, i8 zeroext %9)
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %7
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %5
br label %22
21: ; preds = %3
store i8 0, i8* %5
br label %22
22: ; preds = %21, %15
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @my_itoa_char_char_size(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @my_itoa_buffer_size(i32 %0, i8 zeroext %2)
%5 = zext i8 %1 to i32
%6 = icmp sgt i32 %4, %5
%7 = add nuw nsw i32 %5, 1
%8 = sub i32 %7, %4
%9 = and i32 %8, 255
%10 = select i1 %6, i32 0, i32 %9
ret i32 %10
}
short dns_cache_events(struct dns_cache *cache __attribute__((unused))) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dns_cache = type opaque
define signext i16 @dns_cache_events(%struct.dns_cache* %0) {
%2 = alloca %struct.dns_cache*
store %struct.dns_cache* %0, %struct.dns_cache** %2
ret i16 0
}

LLVM IR (-O2):
%struct.dns_cache = type opaque
define signext i16 @dns_cache_events(%struct.dns_cache* nocapture readnone %0) {
ret i16 0
}
int regulator_disable(struct regulator *r) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.regulator = type opaque
define i32 @regulator_disable(%struct.regulator* nocapture readnone %0) {
ret i32 0
}
int toupper(int c) {
  if (c > 96 && c < 123) {
    return c - 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x60,-0x8(%rbp)
jle    1129 <toupper+0x29>
cmpl   $0x7b,-0x8(%rbp)
jge    1129 <toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 96
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 123
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void nullArray(int arrayLetters[], int size) {
  for (int i = 0; i < size; i++) {
    arrayLetters[i] = 0;
  }
}


x86 assembly (clang, -O0):
<nullArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <nullArray+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <nullArray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullArray>:
test   %esi,%esi
jle    1126 <nullArray+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @nullArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nullArray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void channel_aftertouch(char a, char b) {
  printf("channel_aftertouch %d %d\n", a, b);
}


x86 assembly (clang, -O0):
<channel_aftertouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<channel_aftertouch>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"channel_aftertouch %d %d\0A\00"
define void @channel_aftertouch(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"channel_aftertouch %d %d\0A\00"
define void @channel_aftertouch(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Type definitions */
struct uuid {
  int dummy;
};
struct sbuf {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int sbuf_printf(struct sbuf *, char *, char *);
int /*<<< orphan*/ snprintf_uuid(char *, int, struct uuid *);
int __attribute__(()) sbuf_printf_uuid(struct sbuf *sb, struct uuid *uuid) {
  char buf[38];
  snprintf_uuid(buf, sizeof(buf), uuid);
  return (sbuf_printf(sb, "%s", buf));
}


x86 assembly (clang, -O0):
<sbuf_printf_uuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x26,%esi
call   1040 <snprintf_uuid@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <sbuf_printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbuf_printf_uuid>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x26,%esi
call   1040 <snprintf_uuid@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <sbuf_printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sbuf = type { i32 }
%struct.uuid = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @sbuf_printf_uuid(%struct.sbuf* %0, %struct.uuid* %1) {
%3 = alloca %struct.sbuf*
%4 = alloca %struct.uuid*
%5 = alloca [38 x i8]
store %struct.sbuf* %0, %struct.sbuf** %3
store %struct.uuid* %1, %struct.uuid** %4
%6 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i64 0, i64 0
%7 = load %struct.uuid*, %struct.uuid** %4
%8 = call i32 @snprintf_uuid(i8* %6, i32 38, %struct.uuid* %7)
%9 = load %struct.sbuf*, %struct.sbuf** %3
%10 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i64 0, i64 0
%11 = call i32 @sbuf_printf(%struct.sbuf* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sbuf = type { i32 }
%struct.uuid = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @sbuf_printf_uuid(%struct.sbuf* %0, %struct.uuid* %1) {
%3 = alloca [38 x i8]
%4 = getelementptr inbounds [38 x i8], [38 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf_uuid(i8* %4, i32 38, %struct.uuid* %1)
%6 = call i32 @sbuf_printf(%struct.sbuf* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_add_int64_t(int /*<<< orphan*/ *, int);
int64_t atomic_inc_int64_t(int64_t *var) { return atomic_add_int64_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_inc_int64_t>:
mov    $0x1,%esi
jmp    1030 <atomic_add_int64_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_inc_int64_t(i32* %0) {
%2 = tail call i32 @atomic_add_int64_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
scalar_t__ is_whitespace(char);
int is_variable_delim(char c) { return ((c) == ')') || is_whitespace(c); }


x86 assembly (clang, -O0):
<is_variable_delim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x2(%rbp)
je     1143 <is_variable_delim+0x33>
movsbl -0x1(%rbp),%edi
call   1030 <is_whitespace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variable_delim>:
mov    $0x1,%eax
cmp    $0x29,%dil
je     1134 <is_variable_delim+0x24>
push   %rax
movsbl %dil,%edi
call   1030 <is_whitespace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @is_variable_delim(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 41
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_whitespace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_variable_delim(i8 signext %0) {
%2 = icmp eq i8 %0, 41
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @is_whitespace(i8 signext %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Keccak(int, int, unsigned char const *, unsigned int, int,
                          unsigned char *, int);
void FIPS202_SHA3_384(const unsigned char *input, unsigned int inputByteLen,
                      unsigned char *output) {
  Keccak(832, 768, input, inputByteLen, 0x06, output, 48);
}


x86 assembly (clang, -O0):
<FIPS202_SHA3_384>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r9
mov    $0x340,%edi
mov    $0x300,%esi
mov    $0x6,%r8d
movl   $0x30,(%rsp)
call   1030 <Keccak@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIPS202_SHA3_384>:
push   %rax
mov    %rdx,%r9
mov    %esi,%ecx
mov    %rdi,%rdx
movl   $0x30,(%rsp)
mov    $0x340,%edi
mov    $0x300,%esi
mov    $0x6,%r8d
call   1030 <Keccak@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @FIPS202_SHA3_384(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @Keccak(i32 832, i32 768, i8* %7, i32 %8, i32 6, i8* %9, i32 48)
ret void
}

LLVM IR (-O2):
define void @FIPS202_SHA3_384(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @Keccak(i32 832, i32 768, i8* %0, i32 %1, i32 6, i8* %2, i32 48)
ret void
}
/* Variables and functions */
char *simple_strchr(const char *s, int c) {
  for (; *s != (char)c; ++s)
    if (*s == '\0')
      return NULL;
  return (char *)s;
}


x86 assembly (clang, -O0):
<simple_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1153 <simple_strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <simple_strchr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    115b <simple_strchr+0x5b>
jmp    1142 <simple_strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <simple_strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <simple_strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <simple_strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <simple_strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @simple_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %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 = load i32, i32* %5
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %9, %12
br i1 %13, label %14, label %24
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i8* null, i8** %3
br label %26
20: ; preds = %14
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
%25 = load i8*, i8** %4
store i8* %25, i8** %3
br label %26
26: ; preds = %24, %19
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @simple_strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
int main(int argc, char *argv[]) {
  int i;
  int j;
  for (i = 1; i < 10; ++i)
    j = i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1137 <main+0x37>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void create_gothmog() { return; }


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

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

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

LLVM IR (-O2):
define void @create_gothmog() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void *read_in(void *ignore) {
  char c;
  for (;;) {
    if (read(3, &c, sizeof(char)) == 1)
      write(1, &c, sizeof(char));
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1158 <read_in+0x38>
mov    $0x1,%edx
lea    -0x9(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    112c <read_in+0xc>

x86 assembly (clang, -O2):
<read_in>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1130 <read_in+0x10>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1130 <read_in+0x10>

LLVM IR (-O0):
define i8* @read_in(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
%5 = call i32 @read(i32 3, i8* %3, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 @write(i32 1, i8* %3, i32 1)
br label %9
9: ; preds = %7, %4
br label %4
}

LLVM IR (-O2):
define noalias i8* @read_in(i8* nocapture readnone %0) {
%2 = alloca i8
br label %3
3: ; preds = %8, %1
%4 = call i32 @read(i32 3, i8* %2, i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @write(i32 1, i8* %2, i32 1)
br label %8
8: ; preds = %6, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ leakingmemory(int);
int main() { leakingmemory(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <leakingmemory@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <leakingmemory@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @leakingmemory(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @leakingmemory(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ mp_islower(char);
char mp_toupper(char c) { return mp_islower(c) ? c - 'a' + 'A' : c; }


x86 assembly (clang, -O0):
<mp_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <mp_islower@plt>
cmp    $0x0,%rax
je     1143 <mp_toupper+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <mp_toupper+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <mp_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @mp_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @mp_islower(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 65
br label %14
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
br label %14
14: ; preds = %11, %6
%15 = phi i32 [ %10, %6 ], [ %13, %11 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @mp_toupper(i8 signext %0) {
%2 = tail call i64 @mp_islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}