xunge/DecIR huggingface dataset:
/* Variables and functions */
char *flon_conf_string(char const *, char *);
char *flu_canopath(char *);
int /*<<< orphan*/ free(char *);
char *flon_conf_path(const char *key, char *def) {
  char *v = flon_conf_string(key, def);
  if (v == NULL)
    return NULL;
  char *r = flu_canopath(v);
  if (v != def)
    free(v);
  return r;
}


x86 assembly (clang, -O0):
<flon_conf_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <flon_conf_string@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1169 <flon_conf_path+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1195 <flon_conf_path+0x65>
mov    -0x20(%rbp),%rdi
call   1040 <flu_canopath@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     118d <flon_conf_path+0x5d>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flon_conf_path>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
call   1050 <flon_conf_string@plt>
test   %rax,%rax
je     115f <flon_conf_path+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <flu_canopath@plt>
mov    %rax,%r14
cmp    %r15,%rbx
je     1162 <flon_conf_path+0x32>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1162 <flon_conf_path+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @flon_conf_path(i8* %0, i8* %1) {
%3 = tail call i8* @flon_conf_string(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @flu_canopath(i8* %3)
%7 = icmp eq i8* %3, %1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @free(i8* %3)
br label %10
10: ; preds = %5, %8, %2
%11 = phi i8* [ null, %2 ], [ %6, %8 ], [ %6, %5 ]
ret i8* %11
}
int DRO_VALID(unsigned int dro) {
  if (dro >= (1 << 10))
    return (0);
  else
    return (!((0)));
}


x86 assembly (clang, -O0):
<DRO_VALID>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jb     1120 <DRO_VALID+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1127 <DRO_VALID+0x27>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DRO_VALID>:
xor    %eax,%eax
cmp    $0x400,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @DRO_VALID(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp uge i32 %4, 1024
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @DRO_VALID(i32 %0) {
%2 = icmp ult i32 %0, 1024
%3 = zext i1 %2 to i32
ret i32 %3
}
void XwcResetIC() {}


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

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

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

LLVM IR (-O2):
define void @XwcResetIC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_basic_sb_comments() {
  test_parser_verify_parse(
      test_parser_sourcefile("structured_basic", " REM comment"),
      "structured_basic", "", "REM comment", 0);
}


x86 assembly (clang, -O0):
<test_basic_sb_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec9(%rip),%rdx
lea    0xec4(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_basic_sb_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed2(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"structured_basic\00"
@.str.1 = [13 x i8] c" REM comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"REM comment\00"
define void @test_basic_sb_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"structured_basic\00"
@.str.1 = [13 x i8] c" REM comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c"REM comment\00"
define void @test_basic_sb_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initwks();
int /*<<< orphan*/ localinit();
int /*<<< orphan*/ xldinit();
int /*<<< orphan*/ xlminit();
void xlinit(void) {
  xlminit();
  xldinit();
  { initwks(); }
  localinit();
}


x86 assembly (clang, -O0):
<xlinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <xlminit@plt>
mov    $0x0,%al
call   1030 <xldinit@plt>
mov    $0x0,%al
call   1050 <initwks@plt>
mov    $0x0,%al
call   1040 <localinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlinit>:
push   %rax
xor    %eax,%eax
call   1060 <xlminit@plt>
xor    %eax,%eax
call   1030 <xldinit@plt>
xor    %eax,%eax
call   1050 <initwks@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <localinit@plt>

LLVM IR (-O0):
define void @xlinit() {
%1 = call i32 (...) @xlminit()
%2 = call i32 (...) @xldinit()
%3 = call i32 (...) @initwks()
%4 = call i32 (...) @localinit()
ret void
}

LLVM IR (-O2):
define void @xlinit() {
%1 = tail call i32 (...) @xlminit()
%2 = tail call i32 (...) @xldinit()
%3 = tail call i32 (...) @initwks()
%4 = tail call i32 (...) @localinit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main(int, char **);
int /*<<< orphan*/ puts(char *);
void __start() {
  char *t_argv[4];
  puts("__start: OK A\n");
  t_argv[0] = "tk_dummy";
  main(1, t_argv);
}


x86 assembly (clang, -O0):
<__start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1040 <main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__start>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <main@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"__start: OK A\0A\00"
@.str.1 = [9 x i8] c"tk_dummy\00"
define void @__start() {
%1 = alloca [4 x i8*]
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%5 = call i32 @main(i32 1, i8** %4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"__start: OK A\0A\00"
@.str.1 = [9 x i8] c"tk_dummy\00"
define void @__start() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = call i32 @main(i32 1, i8** %4)
ret void
}
/* Variables and functions */
char *read_key(char const *, char const *, int /*<<< orphan*/);
char *textfile_get(const char *pathname, const char *key) {
  return read_key(pathname, key, 0);
}


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

x86 assembly (clang, -O2):
<textfile_get>:
xor    %edx,%edx
jmp    1030 <read_key@plt>

LLVM IR (-O0):
define i8* @textfile_get(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 i8* @read_key(i8* %5, i8* %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @textfile_get(i8* %0, i8* %1) {
%3 = tail call i8* @read_key(i8* %0, i8* %1, i32 0)
ret i8* %3
}
void gtk_stock_item_free() {}


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

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

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

LLVM IR (-O2):
define void @gtk_stock_item_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _kill(int pid __attribute__((unused)), int sig __attribute__((unused))) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
unsigned int dec(unsigned int);
unsigned int inc(unsigned int);
unsigned int add_iter(unsigned int a, unsigned int b) {
  if (a == 0) {
    return b;
  } else {
    return add_iter(dec(a), inc(b));
  }
}


x86 assembly (clang, -O0):
<add_iter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <add_iter+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <add_iter+0x43>
mov    -0x8(%rbp),%edi
call   1030 <dec@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <inc@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <add_iter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_iter>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
test   %edi,%edi
je     1146 <add_iter+0x26>
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <dec@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <inc@plt>
mov    %eax,%ebx
test   %ebp,%ebp
jne    1130 <add_iter+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @add_iter(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = tail call i32 @dec(i32 %6)
%8 = tail call i32 @inc(i32 %5)
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ %1, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ parloop(int);
int main(void) {
  parloop(10000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2710,%edi
call   1030 <parloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @parloop(i32 10000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parloop(i32 10000)
ret i32 0
}
double fless(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<fless>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fless>:
cmpltsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fless(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @fless(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
double mhz_full(int, int);
double mhz(int verbose) { return mhz_full(verbose, 2); }


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

x86 assembly (clang, -O2):
<mhz>:
mov    $0x2,%esi
jmp    1030 <mhz_full@plt>

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

LLVM IR (-O2):
define double @mhz(i32 %0) {
%2 = tail call double @mhz_full(i32 %0, i32 2)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int i;
  printf("Inside main\n");
  fflush(stdout);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Inside main\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [12 x i8] c"Inside main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *MAP_FAILED;
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *xmmap(void *addr, size_t length, int prot, int flags, int fd,
            off_t offset) {
  void *ret = mmap(addr, length, prot, flags, fd, offset);
  if (ret == MAP_FAILED) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    1166 <xmmap+0x56>
jmp    1166 <xmmap+0x56>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmmap>:
jmp    1030 <mmap@plt>

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

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define i8* @xmmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i8* %7
}
void dot_matrix_3x_generic_output(void *data, unsigned *out_width,
                                  unsigned *out_height, unsigned width,
                                  unsigned height) {
  *out_width = width * 3;
  *out_height = height * 3;
}


x86 assembly (clang, -O0):
<dot_matrix_3x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
imul   $0x3,-0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x3,-0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_matrix_3x_generic_output>:
lea    (%rcx,%rcx,2),%eax
mov    %eax,(%rsi)
lea    (%r8,%r8,2),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @dot_matrix_3x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = mul i32 %11, 3
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = mul i32 %14, 3
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @dot_matrix_3x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = mul i32 %3, 3
store i32 %6, i32* %1
%7 = mul i32 %4, 3
store i32 %7, i32* %2
ret void
}
int bar_hello(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @bar_hello() {
ret i32 1
}

LLVM IR (-O2):
define i32 @bar_hello() {
ret i32 1
}
void starttls_disable(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @CoarseLevelling() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int *, int /*<<< orphan*/);
void chld_handler() {
  int st;
  while ((waitpid(-1, &st, WNOHANG)) > 0)
    ;
}


x86 assembly (clang, -O0):
<chld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x4(%rbp),%rsi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    113e <chld_handler+0x2e>
jmp    1118 <chld_handler+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chld_handler>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <chld_handler+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @chld_handler() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* @WNOHANG
%4 = call i64 @waitpid(i32 -1, i32* %1, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @chld_handler() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* %1, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int dummy;
};
typedef int /*<<< orphan*/ mask;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
int /*<<< orphan*/ memset(struct in_addr *, int /*<<< orphan*/, int);
uint32_t prefix2mask(int prefix) {
  struct in_addr mask;
  memset(&mask, 0, sizeof(mask));
  if (prefix) {
    return htonl(~((1 << (32 - prefix)) - 1));
  } else {
    return htonl(0);
  }
}


x86 assembly (clang, -O0):
<prefix2mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0x8(%rbp)
je     1167 <prefix2mask+0x47>
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
sub    $0x1,%edi
xor    $0xffffffff,%edi
call   1030 <htonl@plt>
mov    %eax,-0x4(%rbp)
jmp    1171 <prefix2mask+0x51>
xor    %edi,%edi
call   1030 <htonl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix2mask>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,%ecx
neg    %cl
mov    $0xffffffff,%edi
shl    %cl,%edi
test   %ebx,%ebx
cmove  %ebx,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @prefix2mask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.in_addr
store i32 %0, i32* %3
%5 = call i32 @memset(%struct.in_addr* %4, i32 0, i32 4)
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 32, %9
%11 = shl i32 1, %10
%12 = sub nsw i32 %11, 1
%13 = xor i32 %12, -1
%14 = call i32 @htonl(i32 %13)
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = call i32 @htonl(i32 0)
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @prefix2mask(i32 %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @memset(%struct.in_addr* %2, i32 0, i32 4)
%5 = icmp eq i32 %0, 0
%6 = sub nsw i32 32, %0
%7 = shl nsw i32 -1, %6
%8 = select i1 %5, i32 0, i32 %7
%9 = call i32 @htonl(i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(
      stderr,
      "usage: brandelf [-lv] [-f ELF_ABI_number] [-t string] file ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"usage: brandelf [-lv] [-f ELF_ABI_number] [-t string] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"usage: brandelf [-lv] [-f ELF_ABI_number] [-t string] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ flip(int *, int /*<<< orphan*/, int);
int test_flip_all() {
  int input[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int expected[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  flip(input, 0, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_flip_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <flip@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flip_all>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf00(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <flip@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_flip_all.input = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.test_flip_all.expected = [10 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
define i32 @test_flip_all() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @flip(i32* %5, i32 0, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_flip_all.input = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.test_flip_all.expected = [10 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
define i32 @test_flip_all() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @flip(i32* %5, i32 0, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sla_dmxv(double *, double *, double *);
void csla_dmxv(double dm[3][3], double va[3], double vb[3]) {
  sla_dmxv(&(dm[0][0]), va, vb);
}


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

x86 assembly (clang, -O2):
<csla_dmxv>:
jmp    1030 <sla_dmxv@plt>

LLVM IR (-O0):
define void @csla_dmxv([3 x double]* %0, double* %1, double* %2) {
%4 = alloca [3 x double]*
%5 = alloca double*
%6 = alloca double*
store [3 x double]* %0, [3 x double]** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load [3 x double]*, [3 x double]** %4
%8 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0
%9 = getelementptr inbounds [3 x double], [3 x double]* %8, i64 0, i64 0
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = call i32 @sla_dmxv(double* %9, double* %10, double* %11)
ret void
}

LLVM IR (-O2):
define void @csla_dmxv([3 x double]* %0, double* %1, double* %2) {
%4 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%5 = tail call i32 @sla_dmxv(double* %4, double* %1, double* %2)
ret void
}
int __attribute__((weak)) fun(void) {
  printf("[%s]\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"[%s]\0A\00"
@__FUNCTION__.fun = [4 x i8] c"fun\00"
define weak i32 @fun() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.fun, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
@__FUNCTION__.fun = [4 x i8] c"fun\00"
define weak i32 @fun() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.fun, i64 0, i64 0))
ret i32 0
}
double test_double(const double *par, const double *x) { return (0); }


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @test_double(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @test_double(double* nocapture readnone %0, double* nocapture readnone %1) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ alloc_memory(size_t, int, void *, int);
uint32_t *alloc_uint32(size_t nmemb, void *to_free, int n) {
  return (uint32_t *)alloc_memory(nmemb, sizeof(uint32_t), to_free, n);
}


x86 assembly (clang, -O0):
<alloc_uint32>:
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),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%esi
call   1030 <alloc_memory@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_uint32>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x4,%esi
jmp    1030 <alloc_memory@plt>

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

LLVM IR (-O2):
define i32* @alloc_uint32(i64 %0, i8* %1, i32 %2) {
%4 = tail call i64 @alloc_memory(i64 %0, i32 4, i8* %1, i32 %2)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void g_signal_user_interrupt(void (*func)(int)) { signal(SIGINT, func); }


x86 assembly (clang, -O0):
<g_signal_user_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_signal_user_interrupt>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @g_signal_user_interrupt(void (i32)* %0) {
%2 = alloca void (i32)*
store void (i32)* %0, void (i32)** %2
%3 = load i32, i32* @SIGINT
%4 = load void (i32)*, void (i32)** %2
%5 = call i32 @signal(i32 %3, void (i32)* %4)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @g_signal_user_interrupt(void (i32)* %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* %0)
ret void
}
__attribute__((no, noclone)) int f6(int x) { return x >= 0 ? x : ~x; }


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

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

LLVM IR (-O0):
define i32 @f6(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 %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = xor i32 %8, -1
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f6(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
ret i32 %3
}
void storePhysicalMemory(int *paddr, int data) { *paddr = data; }


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

x86 assembly (clang, -O2):
<storePhysicalMemory>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @storePhysicalMemory(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 = load i32*, i32** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @storePhysicalMemory(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
void nondet_assume(int expr) {}


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

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

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

LLVM IR (-O2):
define void @nondet_assume(i32 %0) {
ret void
}
double genann_act_linear(double a) { return a; }


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

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

LLVM IR (-O0):
define double @genann_act_linear(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @genann_act_linear(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Helllo World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Helllo World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Helllo World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int StringBitVal(const char *Key, int n) {
  return (Key[n >> 3] >> ((7 ^ n) & 7)) & 1;
}


x86 assembly (clang, -O0):
<StringBitVal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
xor    $0x7,%ecx
and    $0x7,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringBitVal>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @StringBitVal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %4
%13 = xor i32 7, %12
%14 = and i32 %13, 7
%15 = ashr i32 %11, %14
%16 = and i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @StringBitVal(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %1, 7
%9 = xor i32 %8, 7
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
int shell_str_len(char *str) {
  int i = 0;
  while (str[i++] != 0)
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<shell_str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <shell_str_len+0x33>
jmp    110f <shell_str_len+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <shell_str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @shell_str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main(int argc, char *argv[]) {
  foo();
  exit(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)
mov    $0x0,%al
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
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 = call i32 (...) @foo()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @exit(i32 0)
unreachable
}
int isdigit(int c) { return ((c >= '0') && (c <= '9')) ? 1 : 0; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int apply(int (*fp)(const char *, ...), int val) { (*fp)("%d\n", val); }


x86 assembly (clang, -O0):
<apply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   *%rcx
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rcx
lea    0xef6(%rip),%rdi
xor    %eax,%eax
jmp    *%rcx

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @apply(i32 (i8*, ...)* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) %0(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
double xt_core_percentage(double part, double whole) {
  double percent;
  if (0 != whole) {
    percent = part / whole;
  } else {
    percent = 0.0;
  }
  return percent;
}


x86 assembly (clang, -O0):
<xt_core_percentage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1127 <xt_core_percentage+0x27>
jp     1127 <xt_core_percentage+0x27>
jmp    113b <xt_core_percentage+0x3b>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1143 <xt_core_percentage+0x43>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_percentage>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    110c <xt_core_percentage+0xc>
jnp    1114 <xt_core_percentage+0x14>
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @xt_core_percentage(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fcmp une double 0.000000e+00, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fdiv double %9, %10
store double %11, double* %5
br label %13
12: ; preds = %2
store double 0.000000e+00, double* %5
br label %13
13: ; preds = %12, %8
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @xt_core_percentage(double %0, double %1) {
%3 = fcmp une double %1, 0.000000e+00
%4 = fdiv double %0, %1
%5 = select i1 %3, double %4, double 0.000000e+00
ret double %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_multprec_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(492, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<write_multprec_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ec,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_multprec_target_system>:
mov    $0x1ec,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_multprec_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 492, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_multprec_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 492, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void default_oom(void) {
  fprintf(stderr, "%s", "Out of memory!\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [16 x i8] c"Out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define void @default_oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [16 x i8] c"Out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define void @default_oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}