xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, size_t);
void *umad_alloc(int num, size_t size) { return calloc(num, size); }


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

x86 assembly (clang, -O2):
<umad_alloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @umad_alloc(i32 %0, i64 %1) {
%3 = tail call i8* @calloc(i32 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ kernel_dgemm_nt_4x2_vs_lib4(int, int, int, double *,
                                               double *, double *, double *,
                                               int, int, int);
void kernel_dgemm_nt_4x2_lib4(int kmax, double *A, double *B, double *C,
                              double *D, int alg, int tc, int td) {
  kernel_dgemm_nt_4x2_vs_lib4(4, 2, kmax, A, B, C, D, alg, tc, td);
}


x86 assembly (clang, -O0):
<kernel_dgemm_nt_4x2_lib4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rbx
mov    -0x34(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    $0x4,%edi
mov    $0x2,%esi
mov    %rbx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <kernel_dgemm_nt_4x2_vs_lib4@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemm_nt_4x2_lib4>:
push   %rbx
mov    %r9d,%eax
mov    %r8,%r10
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x10(%rsp),%r11d
mov    0x18(%rsp),%ebx
mov    $0x4,%edi
mov    $0x2,%esi
push   %rbx
push   %r11
push   %rax
push   %r10
call   1030 <kernel_dgemm_nt_4x2_vs_lib4@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @kernel_dgemm_nt_4x2_lib4(i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @kernel_dgemm_nt_4x2_vs_lib4(i32 4, i32 2, i32 %17, double* %18, double* %19, double* %20, double* %21, i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @kernel_dgemm_nt_4x2_lib4(i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @kernel_dgemm_nt_4x2_vs_lib4(i32 4, i32 2, i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1(int);
int /*<<< orphan*/ test2(int);
int /*<<< orphan*/ test3(int);
int /*<<< orphan*/ test4(int, int);
int main() {
  test1(1000 * 1000);
  test2(1000 * 1000);
  test3(1000 * 1000);
  test4(1000 * 1000, 1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf4240,%edi
call   1040 <test1@plt>
mov    $0xf4240,%edi
call   1060 <test2@plt>
mov    $0xf4240,%edi
call   1030 <test3@plt>
mov    $0xf4240,%edi
mov    $0x3e8,%esi
call   1050 <test4@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf4240,%edi
call   1040 <test1@plt>
mov    $0xf4240,%edi
call   1060 <test2@plt>
mov    $0xf4240,%edi
call   1030 <test3@plt>
mov    $0xf4240,%edi
mov    $0x3e8,%esi
call   1050 <test4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test1(i32 1000000)
%2 = call i32 @test2(i32 1000000)
%3 = call i32 @test3(i32 1000000)
%4 = call i32 @test4(i32 1000000, i32 1000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(i32 1000000)
%2 = tail call i32 @test2(i32 1000000)
%3 = tail call i32 @test3(i32 1000000)
%4 = tail call i32 @test4(i32 1000000, i32 1000)
ret i32 0
}
int is8digit(char c) { return (c >= '0' && c <= '7') ? 1 : 0; }


x86 assembly (clang, -O0):
<is8digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is8digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is8digit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is8digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is8digit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffs_do_setxattr_reldir(struct yaffs_obj *, char const *, char const *,
                             void const *, int, int, int /*<<< orphan*/);
int yaffs_lsetxattr_reldir(struct yaffs_obj *reldir, const char *path,
                           const char *name, const void *data, int size,
                           int flags) {
  return yaffs_do_setxattr_reldir(reldir, path, name, data, size, flags, 0);
}


x86 assembly (clang, -O0):
<yaffs_lsetxattr_reldir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <yaffs_do_setxattr_reldir@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_lsetxattr_reldir>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <yaffs_do_setxattr_reldir@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_lsetxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca %struct.yaffs_obj*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.yaffs_obj*, %struct.yaffs_obj** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @yaffs_do_setxattr_reldir(%struct.yaffs_obj* %13, i8* %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
define i32 @yaffs_lsetxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 @yaffs_do_setxattr_reldir(%struct.yaffs_obj* %0, i8* %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 0)
ret i32 %7
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
char const *GetConstructPPForm(void *, struct constructHeader *);
const char *EnvGetDeffunctionPPForm(void *theEnv, void *theDeffunction) {
  return GetConstructPPForm(theEnv, (struct constructHeader *)theDeffunction);
}


x86 assembly (clang, -O0):
<EnvGetDeffunctionPPForm>:
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 <GetConstructPPForm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnvGetDeffunctionPPForm>:
jmp    1030 <GetConstructPPForm@plt>

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeffunctionPPForm(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 = bitcast i8* %6 to %struct.constructHeader*
%8 = call i8* @GetConstructPPForm(i8* %5, %struct.constructHeader* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvGetDeffunctionPPForm(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructPPForm(i8* %0, %struct.constructHeader* %3)
ret i8* %4
}
void __attribute__((weak)) tim7_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim7_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim7_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim7_isr = [9 x i8] c"tim7_isr\00"
define weak void @tim7_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim7_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim7_isr = [9 x i8] c"tim7_isr\00"
define weak void @tim7_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim7_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_query_named_event(char *);
void PAPIF_QUERY_NAMED_EVENT(char *EventName, int *check, int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_query_named_event(tmp);
}


x86 assembly (clang, -O0):
<PAPIF_QUERY_NAMED_EVENT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_QUERY_NAMED_EVENT>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    %r14,%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,(%rbx)
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PAPIF_QUERY_NAMED_EVENT(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [128 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @Fortran2cstring(i8* %8, i8* %9, i32 128, i32 %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%13 = call i32 @PAPI_query_named_event(i8* %12)
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @PAPIF_QUERY_NAMED_EVENT(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @Fortran2cstring(i8* %5, i8* %0, i32 128, i32 %2)
%7 = call i32 @PAPI_query_named_event(i8* %5)
store i32 %7, i32* %1
ret void
}
void gdk_pixmap_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixmap_new() {
ret void
}
int sum_of_powers_helper(n, sum, count) {
  if (count == 0)
    return sum;
  else {
    sum = sum + power(count);
    return sum_of_powers_helper(n, sum, count - 1);
  }
}


x86 assembly (clang, -O0):
<sum_of_powers_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1146 <sum_of_powers_helper+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <sum_of_powers_helper+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1040 <sum_of_powers_helper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_powers_helper>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
test   %edx,%edx
je     1130 <sum_of_powers_helper+0x20>
mov    %edx,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <power@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1120 <sum_of_powers_helper+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sum_of_powers_helper(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* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
store i32 %11, i32* %4
br label %22
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 (i32, ...) bitcast (i32 (...)* @power to i32 (i32, ...)*)(i32 %14)
%16 = add nsw i32 %13, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = call i32 @sum_of_powers_helper(i32 %17, i32 %18, i32 %20)
store i32 %21, i32* %4
br label %22
22: ; preds = %12, %10
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @sum_of_powers_helper(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %2, %3 ]
%7 = phi i32 [ %9, %5 ], [ %1, %3 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @power to i32 (i32, ...)*)(i32 %6)
%9 = add nsw i32 %8, %7
%10 = add nsw i32 %6, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i32 [ %1, %3 ], [ %9, %5 ]
ret i32 %13
}
void samsung_keypad_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @samsung_keypad_setname(i8* nocapture %0) {
ret void
}
double dr2_dx2(double *x) { return 2 * x[1]; }


x86 assembly (clang, -O0):
<dr2_dx2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dr2_dx2>:
movsd  0x8(%rdi),%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dr2_dx2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = fmul double 2.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @dr2_dx2(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
ret double %4
}
/* Type definitions */
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ refile_buffer(struct buffer_head *);
void __mark_buffer_clean(struct buffer_head *bh) { refile_buffer(bh); }


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

x86 assembly (clang, -O2):
<__mark_buffer_clean>:
jmp    1030 <refile_buffer@plt>

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

LLVM IR (-O2):
%struct.buffer_head = type { i32 }
define void @__mark_buffer_clean(%struct.buffer_head* %0) {
%2 = tail call i32 @refile_buffer(%struct.buffer_head* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void log_stdout(char *format, va_list ap) {
  vfprintf(stdout, format, ap);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<log_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_stdout>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
call   1040 <vfprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @log_stdout(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @log_stdout(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *_i64tow(long long, int /*<<< orphan*/ *, int);
wchar_t *lltow(long long _n, wchar_t *_w, int _i) {
  return _i64tow(_n, _w, _i);
}


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

x86 assembly (clang, -O2):
<lltow>:
jmp    1030 <_i64tow@plt>

LLVM IR (-O0):
define i32* @lltow(i64 %0, i32* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32* @_i64tow(i64 %7, i32* %8, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @lltow(i64 %0, i32* %1, i32 %2) {
%4 = tail call i32* @_i64tow(i64 %0, i32* %1, i32 %2)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ print(int /*<<< orphan*/);
int /*<<< orphan*/ scheme_entry();
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 1) {
    fprintf(stderr, "usage: %s\n", argv[0]);
    exit(1);
  }
  print(scheme_entry());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1186 <main+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <scheme_entry@plt>
mov    %eax,%edi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1158 <main+0x18>
xor    %eax,%eax
call   1050 <scheme_entry@plt>
mov    %eax,%edi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = call i32 (...) @scheme_entry()
%17 = call i32 @print(i32 %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 (...) @scheme_entry()
%11 = tail call i32 @print(i32 %10)
ret i32 0
}
int foo(int a, int b, int c) { return ((a && !b && c) || (!a && b && c)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <foo+0x30>
cmpl   $0x0,-0x8(%rbp)
jne    1130 <foo+0x30>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    115e <foo+0x5e>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xe(%rbp)
jne    1158 <foo+0x58>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
je     1158 <foo+0x58>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
test   %edx,%edx
setne  %dl
xor    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @foo(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* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %26, label %15
15: ; preds = %12, %9, %3
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %21, %18, %15
%25 = phi i1 [ false, %18 ], [ false, %15 ], [ %23, %21 ]
br label %26
26: ; preds = %24, %12
%27 = phi i1 [ true, %12 ], [ %25, %24 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 0
%5 = icmp ne i32 %1, 0
%6 = icmp ne i32 %2, 0
%7 = xor i1 %4, %5
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
void pre_cons(const unsigned char *aa1, int n1, int frame,
              struct f_struct *f_str) {}


x86 assembly (clang, -O0):
<pre_cons>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.f_struct = type opaque
define void @pre_cons(i8* %0, i32 %1, i32 %2, %struct.f_struct* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.f_struct*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.f_struct* %3, %struct.f_struct** %8
ret void
}

LLVM IR (-O2):
%struct.f_struct = type opaque
define void @pre_cons(i8* nocapture %0, i32 %1, i32 %2, %struct.f_struct* nocapture %3) {
ret void
}
/* Variables and functions */
int drotg_(double *, double *, double *, double *);
int fff_blas_drotg(double a[], double b[], double c[], double s[]) {
  return (drotg_(a, b, c, s));
}


x86 assembly (clang, -O0):
<fff_blas_drotg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <drotg_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fff_blas_drotg>:
jmp    1030 <drotg_@plt>

LLVM IR (-O0):
define i32 @fff_blas_drotg(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call i32 @drotg_(double* %9, double* %10, double* %11, double* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fff_blas_drotg(double* %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @drotg_(double* %0, double* %1, double* %2, double* %3)
ret i32 %5
}
/* Variables and functions */
unsigned long base64_decode_long(char const *, int);
unsigned long str2unum(const char *str) { return base64_decode_long(str, 5); }


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

x86 assembly (clang, -O2):
<str2unum>:
mov    $0x5,%esi
jmp    1030 <base64_decode_long@plt>

LLVM IR (-O0):
define i64 @str2unum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @base64_decode_long(i8* %3, i32 5)
ret i64 %4
}

LLVM IR (-O2):
define i64 @str2unum(i8* %0) {
%2 = tail call i64 @base64_decode_long(i8* %0, i32 5)
ret i64 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strptrcmp(const void *a, const void *b) {
  const char *as = *(char **)a;
  const char *bs = *(char **)b;
  return strcmp(as, bs);
}


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

x86 assembly (clang, -O2):
<strptrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strptrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strptrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct mm_config {
  int dummy;
};

/* Variables and functions */
void *stkp_create(void *, struct mm_config *);
void *__stkp_create_agent(void *addr, struct mm_config *cfg) {
  return stkp_create(addr, cfg);
}


x86 assembly (clang, -O0):
<__stkp_create_agent>:
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 <stkp_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stkp_create_agent>:
jmp    1030 <stkp_create@plt>

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

LLVM IR (-O2):
%struct.mm_config = type { i32 }
define i8* @__stkp_create_agent(i8* %0, %struct.mm_config* %1) {
%3 = tail call i8* @stkp_create(i8* %0, %struct.mm_config* %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int str_isEmpty(char *str) { return strcmp(str, "") == 0; }


x86 assembly (clang, -O0):
<str_isEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isEmpty>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @str_isEmpty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @str_isEmpty(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void unknown(char *buff) { return; }


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

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

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

LLVM IR (-O2):
define void @unknown(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int string_equal(const void *key1, const void *key2) {
  return strcmp((const char *)key1, (const char *)key2) == 0;
}


x86 assembly (clang, -O0):
<string_equal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equal(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 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double __lgamma(double);
double __gamma(double arg) {
  double result;
  result = __lgamma(arg);
  return result;
}


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

x86 assembly (clang, -O2):
<__gamma>:
jmp    1030 <__lgamma@plt>

LLVM IR (-O0):
define double @__gamma(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @__lgamma(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @__gamma(double %0) {
%2 = tail call double @__lgamma(double %0)
ret double %2
}
int ssds_num_classes(int fd) { return 4; }


x86 assembly (clang, -O0):
<ssds_num_classes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ssds_num_classes(i32 %0) {
ret i32 4
}
/* Variables and functions */
void kmemcpy(void *dest, void *src, size_t sz) {
  unsigned int i;
  for (i = 0; i < sz; i++) {
    ((char *)dest)[i] = ((char *)src)[i];
  }
}


x86 assembly (clang, -O0):
<kmemcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1146 <kmemcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <kmemcpy+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmemcpy>:
test   %rdx,%rdx
je     111f <kmemcpy+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%eax
cmp    %rdx,%rax
jb     1110 <kmemcpy+0x10>
ret

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

LLVM IR (-O2):
define void @kmemcpy(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
main() {
  int x[10] = {1, [3] = 5};
  int t = 0;
  for (int i = 0; i < 10; i++)
    t += x[i];
  return t;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1171 <main+0x61>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    114b <main+0x3b>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
void really(char *p) {
  int i;
  for (i = 0; i < 1; i++)
    p[i] = 'z';
  free(p);
  p = malloc(10);
  __ESBMC_assume(p);
  p[1] = 'z';
  p[2] = 'z';
}


x86 assembly (clang, -O0):
<really>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1167 <really+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <really+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
movb   $0x7a,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x7a,0x2(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<really>:
push   %rbx
movb   $0x7a,(%rdi)
call   1030 <free@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
movw   $0x7a7a,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @really(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 122, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = call i32 @free(i8* %16)
%18 = call i8* @malloc(i32 10)
store i8* %18, i8** %2
%19 = load i8*, i8** %2
%20 = call i32 @__ESBMC_assume(i8* %19)
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 122, i8* %22
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 122, i8* %24
ret void
}

LLVM IR (-O2):
define void @really(i8* nocapture %0) {
store i8 122, i8* %0
%2 = tail call i32 @free(i8* %0)
%3 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%4 = tail call i32 @__ESBMC_assume(i8* %3)
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 122, i8* %5
%6 = getelementptr inbounds i8, i8* %3, i64 2
store i8 122, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ perror(char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void initialiser_signaux(void) {
  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
    perror("signal");
}


x86 assembly (clang, -O0):
<initialiser_signaux>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <initialiser_signaux+0x37>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiser_signaux>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     1146 <initialiser_signaux+0x26>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [7 x i8] c"signal\00"
define void @initialiser_signaux() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [7 x i8] c"signal\00"
define void @initialiser_signaux() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
int strlen(char const *);
char *until_first(const char str[], char c) {
  const char *result = strchr(str, c);
  if (result == NULL) {
    result = str + strlen(str);
  }
  return (char *)result;
}


x86 assembly (clang, -O0):
<until_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <until_first+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<until_first>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <until_first+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @until_first(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %8, %5 ], [ %3, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ mount(char const *, int);
void wmount_command(const char *dev) { mount(dev, 1); }


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

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

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

LLVM IR (-O2):
define void @wmount_command(i8* %0) {
%2 = tail call i32 @mount(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ h1();
int main() {
  f();
  g();
  h1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x0,%al
call   1050 <h1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
call   1050 <h1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 (...) @g()
%4 = call i32 (...) @h1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @h1()
ret i32 0
}
int f4(float x) { return x == 0.0; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f4(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 0.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f4(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_1d(void *p) { free(p); }


x86 assembly (clang, -O0):
<free_1d>:
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):
<free_1d>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_1d(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 @free_1d(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int getPort(unsigned char *p) {
  return ((0x000000ff & p[0]) << 8) + (0x000000ff & p[1]);
}


x86 assembly (clang, -O0):
<getPort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPort>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @getPort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 255, %6
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 255, %12
%14 = add nsw i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @getPort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
void gdk_window_invalidate_region() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_invalidate_region() {
ret void
}