xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  double pi = 3.1416;
  printf("pi");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xed5(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"pi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 3.141600e+00, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"pi\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int yPos(int v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @yPos(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
uint32_t uu_spdr_get_pid(void) { return (uint32_t)getpid(); }


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

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

LLVM IR (-O0):
define i32 @uu_spdr_get_pid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @uu_spdr_get_pid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
__attribute__((always_)) int numa_node_id(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numa_node_id() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void diag(const char *msg) { fprintf(stderr, "[error: %s]\n", msg); }


x86 assembly (clang, -O0):
<diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diag>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"[error: %s]\0A\00"
define void @diag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"[error: %s]\0A\00"
define void @diag(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int foo(void) {
  static int a[1];
  a[0] = 0;
  return a[0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,0x2f16(%rip)
mov    0x2f10(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@foo.a = internal global [1 x i32] zeroinitializer
define i32 @foo() {
store i32 0, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @foo.a, i64 0, i64 0)
%1 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @foo.a, i64 0, i64 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void on_error() {
  printf("\n\nToo much entropy. \n");
  exit(130);
}


x86 assembly (clang, -O0):
<on_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x82,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x82,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A\0AToo much entropy. \0A\00"
define void @on_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 130)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"\0A\0AToo much entropy. \00"
define void @on_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 130)
unreachable
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int close_fd(int fd) {
  while (close(fd) == -1)
    if (errno != EINTR)
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<close_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1157 <close_fd+0x47>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     1152 <close_fd+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <close_fd+0x4e>
jmp    111b <close_fd+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_fd>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    114b <close_fd+0x3b>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1130 <close_fd+0x20>
mov    $0xffffffff,%eax
jmp    114d <close_fd+0x3d>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @close_fd(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %2, %5
%10 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_ps(float *, int /*<<< orphan*/);
void test_mm_storeu_ps(float *x, __m128 y) { _mm_storeu_ps(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_storeu_ps>:
jmp    1030 <_mm_storeu_ps@plt>

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

LLVM IR (-O2):
define void @test_mm_storeu_ps(float* %0, i32 %1) {
%3 = tail call i32 @_mm_storeu_ps(float* %0, i32 %1)
ret void
}
/* Variables and functions */
int fun_f(int);
__attribute__((always_)) int fun_e(int arge) {
  static int loce = 0;
  loce += arge;
  return fun_f(loce);
}


x86 assembly (clang, -O0):
<fun_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f08(%rip),%eax
mov    %eax,0x2f02(%rip)
mov    0x2efc(%rip),%edi
call   1030 <fun_f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_e>:
add    0x2f16(%rip),%edi
mov    %edi,0x2f10(%rip)
jmp    1030 <fun_f@plt>

LLVM IR (-O0):
@fun_e.loce = internal global i32 0
define i32 @fun_e(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @fun_e.loce
%5 = add nsw i32 %4, %3
store i32 %5, i32* @fun_e.loce
%6 = load i32, i32* @fun_e.loce
%7 = call i32 @fun_f(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@fun_e.loce = internal unnamed_addr global i32 0
define i32 @fun_e(i32 %0) {
%2 = load i32, i32* @fun_e.loce
%3 = add nsw i32 %2, %0
store i32 %3, i32* @fun_e.loce
%4 = tail call i32 @fun_f(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_del();
int insert_mode();
int do_change(void) {
  if (!do_del())
    return insert_mode();
  return 1;
}


x86 assembly (clang, -O0):
<do_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <do_del@plt>
cmp    $0x0,%eax
jne    1147 <do_change+0x27>
mov    $0x0,%al
call   1030 <insert_mode@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <do_change+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_change>:
push   %rax
xor    %eax,%eax
call   1040 <do_del@plt>
test   %eax,%eax
je     1133 <do_change+0x13>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <insert_mode@plt>

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

LLVM IR (-O2):
define i32 @do_change() {
%1 = tail call i32 (...) @do_del()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @insert_mode()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t NumberOfSetBits(uint32_t i) {
  i = i - ((i >> 1) & 0x55555555);
  i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<NumberOfSetBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberOfSetBits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @NumberOfSetBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul nsw i32 %18, 16843009
%20 = ashr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @NumberOfSetBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul nsw i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ uint_least16_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_uint_least16_t(uint_least16_t const k1,
                                                uint_least16_t const k2) {
  return k1 < k2;
}


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

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_uint_least16_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int yas_mma8452q_read_reg_byte(int);
int /*<<< orphan*/ yas_mma8452q_write_reg_byte(int, int);
int yas_mma8452q_power_up(void) {
  yas_mma8452q_write_reg_byte(
      0x0f, ((yas_mma8452q_read_reg_byte(0x0f) & ~0x10) | ((1) << 4)));
  yas_mma8452q_write_reg_byte(
      0x2a, ((yas_mma8452q_read_reg_byte(0x2a) & ~0x01) | ((1) << 0)));
  return (0);
}


x86 assembly (clang, -O0):
<yas_mma8452q_power_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x10,%esi
mov    $0xf,%edi
call   1030 <yas_mma8452q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
mov    %eax,%esi
and    $0xfffffffe,%esi
or     $0x1,%esi
mov    $0x2a,%edi
call   1030 <yas_mma8452q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_mma8452q_power_up>:
push   %rax
mov    $0xf,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
or     $0x10,%eax
mov    $0xf,%edi
mov    %eax,%esi
call   1030 <yas_mma8452q_write_reg_byte@plt>
mov    $0x2a,%edi
call   1040 <yas_mma8452q_read_reg_byte@plt>
or     $0x1,%eax
mov    $0x2a,%edi
mov    %eax,%esi
call   1030 <yas_mma8452q_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_mma8452q_power_up() {
%1 = call i32 @yas_mma8452q_read_reg_byte(i32 15)
%2 = and i32 %1, -17
%3 = or i32 %2, 16
%4 = call i32 @yas_mma8452q_write_reg_byte(i32 15, i32 %3)
%5 = call i32 @yas_mma8452q_read_reg_byte(i32 42)
%6 = and i32 %5, -2
%7 = or i32 %6, 1
%8 = call i32 @yas_mma8452q_write_reg_byte(i32 42, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @yas_mma8452q_power_up() {
%1 = tail call i32 @yas_mma8452q_read_reg_byte(i32 15)
%2 = or i32 %1, 16
%3 = tail call i32 @yas_mma8452q_write_reg_byte(i32 15, i32 %2)
%4 = tail call i32 @yas_mma8452q_read_reg_byte(i32 42)
%5 = or i32 %4, 1
%6 = tail call i32 @yas_mma8452q_write_reg_byte(i32 42, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(int, char *, char *);
int sscanf(char *, char *, long *, char *);
void checkarg(char *arg) {
  long i;
  char c;
  if (*arg == '#') {
    if (sscanf(arg, "#%ld%c", &i, &c) != 1)
      fatal(1, "bad argument: '%s'\n", arg);
  }
}


x86 assembly (clang, -O0):
<checkarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1177 <checkarg+0x57>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x11(%rbp),%rcx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1172 <checkarg+0x52>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xe9a(%rip),%rsi
call   1040 <fatal@plt>
jmp    1177 <checkarg+0x57>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkarg>:
push   %rbx
sub    $0x10,%rsp
cmpb   $0x23,(%rdi)
jne    115c <checkarg+0x3c>
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x7(%rsp),%rcx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     115c <checkarg+0x3c>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"#%ld%c\00"
@.str.1 = [20 x i8] c"bad argument: '%s'\0A\00"
define void @checkarg(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 35
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %3, i8* %4)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32 @fatal(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %9
br label %17
17: ; preds = %16, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"#%ld%c\00"
@.str.1 = [20 x i8] c"bad argument: '%s'\0A\00"
define void @checkarg(i8* %0) {
%2 = alloca i64
%3 = alloca i8
%4 = bitcast i64* %2 to i8*
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 35
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %2, i8* %3)
%9 = icmp eq i32 %8, 1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @fatal(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %7, %10, %1
ret void
}
void emit_int16(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int16(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int16(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
void destroy_tokens(char **tokens) {
  if (tokens) {
    for (int i = 0; tokens[i]; i++)
      free(tokens[i]);
    free(tokens);
  }
}


x86 assembly (clang, -O0):
<destroy_tokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <destroy_tokens+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <destroy_tokens+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <destroy_tokens+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_tokens>:
test   %rdi,%rdi
je     1150 <destroy_tokens+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <destroy_tokens+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <destroy_tokens+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destroy_tokens(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %8, %3
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
br label %15
8: ; preds = %3, %8
%9 = phi i64 [ %11, %8 ], [ 0, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %9, 1
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %6, label %8
15: ; preds = %6, %1
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int toupper(int);
int digittoint(int c) {
  c = toupper(c);
  if (isdigit(c))
    return c - '0';
  else if (c >= 'A' && c <= 'F')
    return c - 'A' + 10;
  else
    return 0;
}


x86 assembly (clang, -O0):
<digittoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1156 <digittoint+0x36>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <digittoint+0x62>
cmpl   $0x41,-0x8(%rbp)
jl     117b <digittoint+0x5b>
cmpl   $0x46,-0x8(%rbp)
jg     117b <digittoint+0x5b>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <digittoint+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digittoint>:
push   %rbx
call   1040 <toupper@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1139 <digittoint+0x19>
add    $0xffffffd0,%ebx
jmp    1149 <digittoint+0x29>
lea    -0x41(%rbx),%eax
add    $0xffffffc9,%ebx
xor    %ecx,%ecx
cmp    $0x6,%eax
cmovb  %ebx,%ecx
mov    %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @digittoint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @toupper(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @isdigit(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %23
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %23
22: ; preds = %15, %12
store i32 0, i32* %2
br label %23
23: ; preds = %22, %18, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @digittoint(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
%3 = tail call i64 @isdigit(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i32 %2, -65
%9 = icmp ult i32 %8, 6
%10 = add nsw i32 %2, -55
%11 = select i1 %9, i32 %10, i32 0
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memset(void *const, int /*<<< orphan*/, size_t const);
void zero(void *const addr, const size_t len) {
  assert(((addr)) && "Unexpected null pointer.");
  ;
  memset(addr, 0, len);
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114a <zero+0x2a>
mov    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    114a <zero+0x2a>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Unexpected null pointer.\00"
define void @zero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
%9 = phi i1 [ false, %2 ], [ true, %7 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
ret void
}

LLVM IR (-O2):
define void @zero(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
int CtoF(int C) { return C / (5.0 / 9.0) + 32; }


x86 assembly (clang, -O0):
<CtoF>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CtoF>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @CtoF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 0x3FE1C71C71C71C72
%6 = fadd double %5, 3.200000e+01
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @CtoF(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 0x3FE1C71C71C71C72
%4 = fadd double %3, 3.200000e+01
%5 = fptosi double %4 to i32
ret i32 %5
}
void xen_invalidate_map_cache(void) {}


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

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

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

LLVM IR (-O2):
define void @xen_invalidate_map_cache() {
ret void
}
unsigned uDivTest11(unsigned X, unsigned Y) { return X / ((unsigned)4); }


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

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

LLVM IR (-O0):
define i32 @uDivTest11(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 = udiv i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @uDivTest11(i32 %0, i32 %1) {
%3 = lshr i32 %0, 2
ret i32 %3
}
/* Variables and functions */
bool is_upper(const char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_upper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_upper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int test_fifo(int, int, int);
int test_fifo_10_2_3(int argc, const char **argv) {
  return test_fifo(10, 2, 3);
}


x86 assembly (clang, -O0):
<test_fifo_10_2_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <test_fifo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fifo_10_2_3>:
mov    $0xa,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <test_fifo@plt>

LLVM IR (-O0):
define i32 @test_fifo_10_2_3(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @test_fifo(i32 10, i32 2, i32 3)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_fifo_10_2_3(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_fifo(i32 10, i32 2, i32 3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DecodeI_xxxxxxxxssmmmrrr();
int /*<<< orphan*/ DoBinOpSub(int /*<<< orphan*/);
void DoCodeSubI(void) { DoBinOpSub(DecodeI_xxxxxxxxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeSubI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
call   1040 <DoBinOpSub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeSubI>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoBinOpSub@plt>

LLVM IR (-O0):
define void @DoCodeSubI() {
%1 = call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = call i32 @DoBinOpSub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeSubI() {
%1 = tail call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = tail call i32 @DoBinOpSub(i32 %1)
ret void
}
int jsk_bind(int s, const char *addr) { return 0; }


x86 assembly (clang, -O0):
<jsk_bind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @jsk_bind(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ user_free(void *);
int os_munmap(void *ptr, size_t size) { return (user_free(ptr) != 0) ? 0 : -1; }


x86 assembly (clang, -O0):
<os_munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <user_free@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_munmap>:
push   %rax
call   1030 <user_free@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @os_munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i64 @user_free(i8* %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @os_munmap(i8* %0, i64 %1) {
%3 = tail call i64 @user_free(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int *p = (int *)malloc(sizeof(int));
  printf("Hello leak\n");
  p = NULL;
  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)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello leak\0A\00"
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 i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32* null, i32** %6
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello leak\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void zylonite_pxa320_init(void) {
  if (cpu_is_pxa320())
    panic("%s: PXA320 not supported\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<zylonite_pxa320_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpu_is_pxa320@plt>
cmp    $0x0,%eax
je     1149 <zylonite_pxa320_init+0x29>
lea    0xec5(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1040 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zylonite_pxa320_init>:
push   %rax
xor    %eax,%eax
call   1030 <cpu_is_pxa320@plt>
test   %eax,%eax
je     1142 <zylonite_pxa320_init+0x22>
lea    0xecd(%rip),%rdi
lea    0xee0(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <panic@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%s: PXA320 not supported\0A\00"
@__FUNCTION__.zylonite_pxa320_init = [21 x i8] c"zylonite_pxa320_init\00"
define void @zylonite_pxa320_init() {
%1 = call i32 (...) @cpu_is_pxa320()
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.zylonite_pxa320_init, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s: PXA320 not supported\0A\00"
@__FUNCTION__.zylonite_pxa320_init = [21 x i8] c"zylonite_pxa320_init\00"
define void @zylonite_pxa320_init() {
%1 = tail call i32 (...) @cpu_is_pxa320()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.zylonite_pxa320_init, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
int main() {
  long long l = 1;
  printf("literal is %s\n", get_literal());
  printf("long is %i\n", (int)l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_literal@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_literal@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"literal is %s\0A\00"
@.str.1 = [12 x i8] c"long is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
%3 = call i32 (...) @get_literal()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"literal is %s\0A\00"
@.str.1 = [12 x i8] c"long is %i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_literal()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit_test(int);
int /*<<< orphan*/ print_error(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strsignal(int);
void exception_handler(int sig) {
  print_error("%s\n", strsignal(sig));
  exit_test(1);
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <print_error@plt>
mov    $0x1,%edi
call   1040 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_handler>:
push   %rax
call   1050 <strsignal@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <print_error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <exit_test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @exception_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @strsignal(i32 %3)
%5 = call i32 @print_error(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit_test(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @exception_handler(i32 %0) {
%2 = tail call i32 @strsignal(i32 %0)
%3 = tail call i32 @print_error(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit_test(i32 1)
ret void
}
void test_one(int x) {
#pragma omp distribute parallel for simd
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
int lgph_find_random(struct Graph *);
int lgph_find_random_skip(struct Graph *lgph, int skipped) {
  int result;
  do {
    result = lgph_find_random(lgph);
  } while (result == skipped);
  return result;
}


x86 assembly (clang, -O0):
<lgph_find_random_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lgph_find_random@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     111f <lgph_find_random_skip+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgph_find_random_skip>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <lgph_find_random@plt>
cmp    %ebp,%eax
je     1120 <lgph_find_random_skip+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define i32 @lgph_find_random_skip(%struct.Graph* %0, i32 %1) {
%3 = alloca %struct.Graph*
%4 = alloca i32
%5 = alloca i32
store %struct.Graph* %0, %struct.Graph** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load %struct.Graph*, %struct.Graph** %3
%8 = call i32 @lgph_find_random(%struct.Graph* %7)
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
br i1 %12, label %6, label %13
13: ; preds = %9
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define i32 @lgph_find_random_skip(%struct.Graph* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @lgph_find_random(%struct.Graph* %0)
%5 = icmp eq i32 %4, %1
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 %4
}
/* Variables and functions */
size_t strLen(const char *str) {
  size_t result = 0;
  while (str[result] != 0)
    result++;
  return result;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strLen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strLen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strLen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
char GetEncoding13() { return 0x10; }


x86 assembly (clang, -O0):
<GetEncoding13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding13>:
mov    $0x10,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding13() {
ret i8 16
}

LLVM IR (-O2):
define signext i8 @GetEncoding13() {
ret i8 16
}
/* Variables and functions */
int strlen(char *);
char *strstr(char *, char *);
char *getptr(char *s, char *id) {
  char *c;
  c = strstr(s, id);
  if (c)
    return (c + strlen(id));
  return (0);
}


x86 assembly (clang, -O0):
<getptr>:
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   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1172 <getptr+0x52>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    117a <getptr+0x5a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getptr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strstr@plt>
test   %rax,%rax
je     1143 <getptr+0x23>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
jmp    1145 <getptr+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @getptr(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ null, %2 ]
ret i8* %10
}
signed int f3(signed int v_foo) {
  signed int v_shr = ((unsigned int)v_foo) >> 22;
  signed int v_and = v_shr & 12;
  return v_and;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x16,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
shr    $0x16,%eax
and    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 22
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 12
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = lshr i32 %0, 22
%3 = and i32 %2, 12
ret i32 %3
}