xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
char *UTIL_mallocStr(size_t size) {
  char *ptr = (char *)malloc(sizeof(char) * (size + 1));
  if (ptr)
    return ptr;
  printf("Error : cannot allocate space\n");
  exit(1);
}


x86 assembly (clang, -O0):
<UTIL_mallocStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <UTIL_mallocStr+0x38>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<UTIL_mallocStr>:
push   %rax
add    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <UTIL_mallocStr+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error : cannot allocate space\0A\00"
define i8* @UTIL_mallocStr(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
14: ; preds = %1
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"Error : cannot allocate space\00"
define i8* @UTIL_mallocStr(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
ret i8* %7
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *make_string_strtoul(unsigned long, int);
int /*<<< orphan*/ test_string_strtoul(char const *, unsigned long, int);
void test_value_with_base_strtoul(unsigned long value, int base) {
  const char *s;
  s = make_string_strtoul(value, base);
  test_string_strtoul(s, value, base);
}


x86 assembly (clang, -O0):
<test_value_with_base_strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <make_string_strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <test_string_strtoul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_value_with_base_strtoul>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <make_string_strtoul@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <test_string_strtoul@plt>

LLVM IR (-O0):
define void @test_value_with_base_strtoul(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = call i8* @make_string_strtoul(i64 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* %3
%11 = load i32, i32* %4
%12 = call i32 @test_string_strtoul(i8* %9, i64 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_value_with_base_strtoul(i64 %0, i32 %1) {
%3 = tail call i8* @make_string_strtoul(i64 %0, i32 %1)
%4 = tail call i32 @test_string_strtoul(i8* %3, i64 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initPlayer(int, int);
void playerJoin(int p) { initPlayer(p, 1); }


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

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

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

LLVM IR (-O2):
define void @playerJoin(i32 %0) {
%2 = tail call i32 @initPlayer(i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(float, float, float, float);
void SetupRC(void) { glClearColor(0.0f, 0.0f, 1.0f, 1.0f); }


x86 assembly (clang, -O0):
<SetupRC>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm1,%xmm1
movss  0xee1(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetupRC>:
movss  0xee8(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm3
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @SetupRC() {
%1 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @SetupRC() {
%1 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_quaddobl_size(int *n) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(317, n, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_quaddobl_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x13d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_quaddobl_size>:
mov    %rdi,%rsi
mov    $0x13d,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syspool_quaddobl_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 317, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syspool_quaddobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 317, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int main() {
  a();
  b();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int a, b;
  scanf("%i %i", &a, &b);
  printf("%i", a * b);
  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    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = mul nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
double _orbita_models_pointmass_rho(const void *M, const double *R) {
  return 0.;
}


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

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

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

LLVM IR (-O2):
define double @_orbita_models_pointmass_rho(i8* nocapture readnone %0, double* nocapture readnone %1) {
ret double 0.000000e+00
}
int fn3(int a, int b) {
  int tem1 = a & b;
  int tem2 = b | a;
  return tem1 + tem2;
}


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

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

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int fitsBits(int x, int n) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
ret i32 2
}
int re_search(bufp, string, size, startpos, range, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, startpos, range;
struct re_registers *regs;
{
  return re_search_2(bufp, 0, 0, string, size, startpos, range, regs, size);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <re_search_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%r10
mov    %r8d,%r11d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
push   %r11
call   1030 <re_search_2@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int signo) {
  printf("catch SIGXFSZ\n");
  return;
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"catch SIGXFSZ\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"catch SIGXFSZ\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MacMsgDisplayOff();
void DoMessageModeKey(int key) {
  if (0x08 == key) {
    MacMsgDisplayOff();
  }
}


x86 assembly (clang, -O0):
<DoMessageModeKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x8,%eax
cmp    -0x4(%rbp),%eax
jne    1130 <DoMessageModeKey+0x20>
mov    $0x0,%al
call   1030 <MacMsgDisplayOff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoMessageModeKey>:
cmp    $0x8,%edi
jne    111c <DoMessageModeKey+0xc>
xor    %eax,%eax
jmp    1030 <MacMsgDisplayOff@plt>
ret

LLVM IR (-O0):
define void @DoMessageModeKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 8, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @MacMsgDisplayOff()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @DoMessageModeKey(i32 %0) {
%2 = icmp eq i32 %0, 8
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @MacMsgDisplayOff()
br label %5
5: ; preds = %3, %1
ret void
}
void sesc_begin_versioning(void) {}


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

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

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

LLVM IR (-O2):
define void @sesc_begin_versioning() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main() {
  int a[10] = {3, 5, 11, 34, 56, 57, 67, 89, 93, 100};
  int index = search(a, 10, 34);
  printf("Found the element in index : %d \n", index);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
mov    $0x22,%edx
call   1040 <search@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
mov    $0x22,%edx
call   1040 <search@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 3, i32 5, i32 11, i32 34, i32 56, i32 57, i32 67, i32 89, i32 93, i32 100]
@.str = [34 x i8] c"Found the element in index : %d \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @search(i32* %4, i32 10, i32 34)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 3, i32 5, i32 11, i32 34, i32 56, i32 57, i32 67, i32 89, i32 93, i32 100]
@.str = [34 x i8] c"Found the element in index : %d \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 10, i32 34)
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int min(int a, int b) { return (a > b) ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int led_get();
int /*<<< orphan*/ led_set(int);
void led_off(uint32_t led_id) { led_set(led_get() & (~(1 << (led_id << 4)))); }


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <led_get@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1040 <led_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <led_get@plt>
shl    $0x4,%ebx
btr    %ebx,%eax
mov    %eax,%edi
pop    %rbx
jmp    1040 <led_set@plt>

LLVM IR (-O0):
define void @led_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @led_get()
%4 = load i32, i32* %2
%5 = shl i32 %4, 4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = and i32 %3, %7
%9 = call i32 @led_set(i32 %8)
ret void
}

LLVM IR (-O2):
define void @led_off(i32 %0) {
%2 = tail call i32 (...) @led_get()
%3 = shl i32 %0, 4
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = and i32 %2, %5
%7 = tail call i32 @led_set(i32 %6)
ret void
}
void gen_cvt_ftoi(int t) {}


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

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

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

LLVM IR (-O2):
define void @gen_cvt_ftoi(i32 %0) {
ret void
}
/* Variables and functions */
int open(char const *, int);
int open_ashmem(const char *path, int flags) { return open(path, flags); }


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

x86 assembly (clang, -O2):
<open_ashmem>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @open_ashmem(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 = call i32 @open(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @open_ashmem(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void bitfield_order(FILE *f) {
  union {
    struct {
      unsigned int field1 : 1;
      unsigned int dummys : 6;
      unsigned int field2 : 1;
    } bits;
    unsigned int value;
  } tmp;
  tmp.value = 0;
  tmp.bits.field1 = 1;
  if (tmp.value == 1) {
    fprintf(f, "#define MACH_BITFIELDS_LSB_FIRST\n");
  } else {
    fprintf(f, "#define MACH_BITFIELDS_MSB_FIRST\n");
  }
}


x86 assembly (clang, -O0):
<bitfield_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%al
and    $0xfe,%al
or     $0x1,%al
mov    %al,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    114c <bitfield_order+0x3c>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115c <bitfield_order+0x4c>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitfield_order>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
%struct.anon = type { i8, [3 x i8] }
@.str = [34 x i8] c"#define MACH_BITFIELDS_LSB_FIRST\0A\00"
@.str.1 = [34 x i8] c"#define MACH_BITFIELDS_MSB_FIRST\0A\00"
define void @bitfield_order(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = bitcast %union.anon* %3 to i32*
store i32 0, i32* %4
%5 = bitcast %union.anon* %3 to %struct.anon*
%6 = bitcast %struct.anon* %5 to i8*
%7 = load i8, i8* %6
%8 = and i8 %7, -2
%9 = or i8 %8, 1
store i8 %9, i8* %6
%10 = bitcast %union.anon* %3 to i32*
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32*, i32** %2
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %19
16: ; preds = %1
%17 = load i32*, i32** %2
%18 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"#define MACH_BITFIELDS_LSB_FIRST\0A\00"
define void @bitfield_order(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 33, i64 1, i32* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *malloc2(size_t size) { return (malloc(size)); }


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

x86 assembly (clang, -O2):
<malloc2>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @malloc2(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ report_and_exit();
int /*<<< orphan*/ test_add_membership();
int /*<<< orphan*/ test_drop_membership();
int main() {
  initialize();
  test_add_membership();
  test_drop_membership();
  report_and_exit();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initialize@plt>
xor    %eax,%eax
call   1060 <test_add_membership@plt>
xor    %eax,%eax
call   1050 <test_drop_membership@plt>
xor    %eax,%eax
call   1030 <report_and_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @test_add_membership()
%4 = call i32 (...) @test_drop_membership()
%5 = call i32 (...) @report_and_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @test_add_membership()
%3 = tail call i32 (...) @test_drop_membership()
%4 = tail call i32 (...) @report_and_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ system(char *);
int close_and_system(char *cmd) {
  int i, pid;
  pid = fork();
  if (pid == 0) {
    for (i = 3; i < 1024; i++) {
      close(i);
    }
    system(cmd);
    exit(9);
  }
}


x86 assembly (clang, -O0):
<close_and_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    119d <close_and_system+0x5d>
movl   $0x3,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    118a <close_and_system+0x4a>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <close_and_system+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
mov    $0x9,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_and_system>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %eax,%eax
je     1158 <close_and_system+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x3,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1040 <close@plt>
add    $0x1,%ebp
cmp    $0x400,%ebp
jne    1160 <close_and_system+0x20>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    $0x9,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @close_and_system(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i32 (...) @fork()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %1
store i32 3, i32* %4
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 1024
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %4
%15 = call i32 @close(i32 %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %10
19: ; preds = %10
%20 = load i8*, i8** %3
%21 = call i32 @system(i8* %20)
%22 = call i32 @exit(i32 9)
unreachable
23: ; preds = %1
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @close_and_system(i8* nocapture %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 3, %1 ]
%6 = tail call i32 @close(i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 1024
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = tail call i32 @system(i8* %0)
%11 = tail call i32 @exit(i32 9)
unreachable
12: ; preds = %1
ret i32 undef
}
unsigned dns_dnlen(register const unsigned char *dn) {
  register unsigned c;
  const unsigned char *d = dn;
  while ((c = *d++) != 0)
    d += c;
  return d - dn;
}


x86 assembly (clang, -O0):
<dns_dnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1143 <dns_dnlen+0x43>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <dns_dnlen+0x10>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_dnlen>:
mov    (%rdi),%cl
mov    %rdi,%rax
test   %cl,%cl
je     1127 <dns_dnlen+0x27>
mov    %rdi,%rdx
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rdx,%rcx,1),%rax
add    $0x1,%rax
movzbl 0x1(%rdx,%rcx,1),%ecx
mov    %rax,%rdx
test   %cl,%cl
jne    1110 <dns_dnlen+0x10>
sub    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dns_dnlen(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = zext i8 %5 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8* [ %0, %1 ], [ %9, %4 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}
int elem_exists(int set[], int size, int value) {
  int i;
  for (i = 0; i < size; i++) {
    if (set[i] == value)
      return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<elem_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <elem_exists+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <elem_exists+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <elem_exists+0x5b>
jmp    1146 <elem_exists+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <elem_exists+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @elem_exists(i32* nocapture %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char num[10] = "128";
  printf("%d\n", atoi(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%esi
lea    0xeb3(%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
mov    $0x80,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.num = [10 x i8] c"128\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @atoi(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 128)
ret i32 0
}
int do_110() { return 110; }


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

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

LLVM IR (-O0):
define i32 @do_110() {
ret i32 110
}

LLVM IR (-O2):
define i32 @do_110() {
ret i32 110
}
/* Variables and functions */
int /*<<< orphan*/ sync_main_sub();
void sub_idle_init() { sync_main_sub(); }


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

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

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

LLVM IR (-O2):
define void @sub_idle_init() {
%1 = tail call i32 (...) @sync_main_sub()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int isANumber(const char *str) {
  int i;
  for (i = 0; str[i]; ++i)
    if (!isdigit(str[i]))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isANumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116e <isANumber+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    115b <isANumber+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1175 <isANumber+0x65>
jmp    1160 <isANumber+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isANumber+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isANumber>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isANumber+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isANumber+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isANumber+0x20>
jmp    114b <isANumber+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isANumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = tail call i32 @isdigit(i8 signext %10)
%12 = icmp eq i32 %11, 0
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
void buzzer(unsigned char offon) {
  if (offon) {
    (*(volatile unsigned long *)(0xE0028000 + 0x14)) = (1 << 17);
  } else {
    (*(volatile unsigned long *)(0xE0028000 + 0x1C)) = (1 << 17);
  }
}


x86 assembly (clang, -O0):
<buzzer>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1125 <buzzer+0x25>
mov    $0xe0028014,%eax
movq   $0x20000,(%rax)
jmp    1131 <buzzer+0x31>
mov    $0xe002801c,%eax
movq   $0x20000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzer>:
mov    $0xe0028014,%eax
lea    0x8(%rax),%rcx
test   %edi,%edi
cmovne %rax,%rcx
movq   $0x20000,(%rcx)
ret

LLVM IR (-O0):
define void @buzzer(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store volatile i64 131072, i64* inttoptr (i64 3758260244 to i64*)
br label %7
6: ; preds = %1
store volatile i64 131072, i64* inttoptr (i64 3758260252 to i64*)
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @buzzer(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i64* inttoptr (i64 3758260252 to i64*), i64* inttoptr (i64 3758260244 to i64*)
store volatile i64 131072, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __bitmap_andnot(unsigned long *, unsigned long const *,
                                   unsigned long const *, int);
void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
                   const unsigned long *src2, int nbits) {
  if (nbits <= ((int)sizeof(unsigned long) * 8))
    *dst = *src1 & ~(*src2);
  else
    __bitmap_andnot(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_andnot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jg     1152 <bitmap_andnot+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1166 <bitmap_andnot+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_andnot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_andnot>:
cmp    $0x40,%ecx
jg     1122 <bitmap_andnot+0x12>
mov    (%rdx),%rax
not    %rax
and    (%rsi),%rax
mov    %rax,(%rdi)
ret
jmp    1030 <__bitmap_andnot@plt>

LLVM IR (-O0):
define void @bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sle i32 %9, 64
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = load i64*, i64** %7
%15 = load i64, i64* %14
%16 = xor i64 %15, -1
%17 = and i64 %13, %16
%18 = load i64*, i64** %5
store i64 %17, i64* %18
br label %25
19: ; preds = %4
%20 = load i64*, i64** %5
%21 = load i64*, i64** %6
%22 = load i64*, i64** %7
%23 = load i32, i32* %8
%24 = call i32 @__bitmap_andnot(i64* %20, i64* %21, i64* %22, i32 %23)
br label %25
25: ; preds = %19, %11
ret void
}

LLVM IR (-O2):
define void @bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp slt i32 %3, 65
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = xor i64 %8, -1
%10 = and i64 %7, %9
store i64 %10, i64* %0
br label %13
11: ; preds = %4
%12 = tail call i32 @__bitmap_andnot(i64* %0, i64* %1, i64* %2, i32 %3)
br label %13
13: ; preds = %11, %6
ret void
}
_Igstr() {
  extern char *_Iinpt;
  return (*_Iinpt++);
}


x86 assembly (clang, -O0):
<_Igstr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    0x2ec4(%rip),%rcx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Igstr>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rax)
movsbl (%rcx),%eax
ret

LLVM IR (-O0):
@_Iinpt = external global i8*
define i32 @_Igstr() {
%1 = load i8*, i8** @_Iinpt
%2 = getelementptr inbounds i8, i8* %1, i32 1
store i8* %2, i8** @_Iinpt
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@_Iinpt = external global i8*
define i32 @_Igstr() {
%1 = load i8*, i8** @_Iinpt
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8* %2, i8** @_Iinpt
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}
long int strtol(const char *str) {}


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

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

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

LLVM IR (-O2):
define i64 @strtol(i8* nocapture readnone %0) {
ret i64 undef
}
void tp(void) {
  int qt;
  qt = 0;
  if (qt != 0) {
    if (0) {
    h5:
      qt = 0;
      while (qt < 1) {
      }
    }
    ++qt;
  }
  goto h5;
}


x86 assembly (clang, -O0):
<tp>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <tp+0x4d>
xor    %eax,%eax
test   $0x1,%al
jne    1124 <tp+0x24>
jmp    1144 <tp+0x44>
jmp    1129 <tp+0x29>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    113f <tp+0x3f>
jmp    1130 <tp+0x30>
jmp    1144 <tp+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <tp+0x29>

x86 assembly (clang, -O2):
<tp>:
jmp    1100 <tp>

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

LLVM IR (-O2):
define void @tp() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ PDC_check_bios_key();
int TRUE;
bool PDC_breakout() {
  extern int c_pindex;
  extern int c_gindex;
  extern int c_ungind;
  if (c_ungind)
    return (TRUE);
  if (c_pindex > c_gindex)
    return (TRUE);
  return ((bool)PDC_check_bios_key());
}


x86 assembly (clang, -O0):
<PDC_breakout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cmpl   $0x0,(%rax)
je     1139 <PDC_breakout+0x29>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <PDC_breakout+0x5c>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%eax
jle    1162 <PDC_breakout+0x52>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <PDC_breakout+0x5c>
mov    $0x0,%al
call   1030 <PDC_check_bios_key@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_breakout>:
push   %rax
mov    0x2ed0(%rip),%rax
cmpl   $0x0,(%rax)
jne    1131 <PDC_breakout+0x21>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
jle    113c <PDC_breakout+0x2c>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <PDC_check_bios_key@plt>
pop    %rcx
ret

LLVM IR (-O0):
@c_ungind = external global i32
@TRUE = global i32 0
@c_pindex = external global i32
@c_gindex = external global i32
define i32 @PDC_breakout() {
%1 = alloca i32
%2 = load i32, i32* @c_ungind
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @TRUE
store i32 %5, i32* %1
br label %15
6: ; preds = %0
%7 = load i32, i32* @c_pindex
%8 = load i32, i32* @c_gindex
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = load i32, i32* @TRUE
store i32 %11, i32* %1
br label %15
12: ; preds = %6
%13 = call i64 (...) @PDC_check_bios_key()
%14 = trunc i64 %13 to i32
store i32 %14, i32* %1
br label %15
15: ; preds = %12, %10, %4
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@c_ungind = external global i32
@TRUE = global i32 0
@c_pindex = external global i32
@c_gindex = external global i32
define i32 @PDC_breakout() {
%1 = load i32, i32* @c_ungind
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load i32, i32* @TRUE
br label %14
5: ; preds = %0
%6 = load i32, i32* @c_pindex
%7 = load i32, i32* @c_gindex
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = load i32, i32* @TRUE
br label %14
11: ; preds = %5
%12 = tail call i64 (...) @PDC_check_bios_key()
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %11, %9, %3
%15 = phi i32 [ %4, %3 ], [ %10, %9 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(unsigned int);
void *check_malloc(unsigned n) {
  void *res = malloc(n);
  assert(res != NULL);
  return res;
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @check_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @check_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}