xunge/DecIR huggingface dataset:
/* Variables and functions */
int MCD(int, int);
int mcm(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  printf("%d\n%d", MCD(n, m), mcm(n, m));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <MCD@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mcm@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <MCD@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <mcm@plt>
lea    0xe87(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @MCD(i32 %6, i32 %7)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @mcm(i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %11)
ret i32 0
}
void gtk_widget_get_extension_events() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_extension_events() {
ret void
}
int adreno_cmd_is_ib(unsigned int cmd) {
  return (cmd == (((unsigned int)3 << 30) | (((2) - 1) << 16) |
                  (((0x3F) & 0xFF) << 8)) ||
          cmd == (((unsigned int)3 << 30) | (((2) - 1) << 16) |
                  (((0x37) & 0xFF) << 8)) ||
          cmd == (((unsigned int)3 << 30) | (((2) - 1) << 16) |
                  (((0x3A) & 0xFF) << 8)) ||
          cmd == (((unsigned int)3 << 30) | (((2) - 1) << 16) |
                  (((0x32) & 0xFF) << 8)));
}


x86 assembly (clang, -O0):
<adreno_cmd_is_ib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xc0013f00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <adreno_cmd_is_ib+0x4a>
mov    $0x1,%al
cmpl   $0xc0013700,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <adreno_cmd_is_ib+0x4a>
mov    $0x1,%al
cmpl   $0xc0013a00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <adreno_cmd_is_ib+0x4a>
cmpl   $0xc0013200,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adreno_cmd_is_ib>:
mov    $0x1,%eax
cmp    $0xc0013700,%edi
je     1128 <adreno_cmd_is_ib+0x28>
cmp    $0xc0013a00,%edi
je     1128 <adreno_cmd_is_ib+0x28>
cmp    $0xc0013f00,%edi
je     1128 <adreno_cmd_is_ib+0x28>
xor    %eax,%eax
cmp    $0xc0013200,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @adreno_cmd_is_ib(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1073660160
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1073662208
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, -1073661440
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, -1073663488
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @adreno_cmd_is_ib(i32 %0) {
switch i32 %0, label %2 [
i32 -1073660160, label %5
i32 -1073661440, label %5
i32 -1073662208, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, -1073663488
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *rcc_reencode(char *str) {
  char *result = str;
  assert(str != NULL);
  return result;
}


x86 assembly (clang, -O0):
<rcc_reencode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%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):
<rcc_reencode>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @rcc_reencode(i8* readnone returned %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i8* %0
}
void free_checksum_pages(void) {}


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

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

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

LLVM IR (-O2):
define void @free_checksum_pages() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(252, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_target_system>:
mov    $0xfc,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 252, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int A() { return 10; }


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

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

LLVM IR (-O0):
define i32 @A() {
ret i32 10
}

LLVM IR (-O2):
define i32 @A() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ _write2file();
int main(int argc, char *argv[]) {
  _write2file();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @_write2file()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @_write2file()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CDC_StartOfFrame();
void USB_SOF_Event(void) { CDC_StartOfFrame(); }


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

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

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

LLVM IR (-O2):
define void @USB_SOF_Event() {
%1 = tail call i32 (...) @CDC_StartOfFrame()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_alib();
int /*<<< orphan*/ test_post_alib();
int /*<<< orphan*/ test_pre_alib();
int main(int argc, char *argv[]) {
  printf("This is a \"bin\" target.\n");
  test_pre_alib();
  test_alib();
  test_post_alib();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_pre_alib@plt>
mov    $0x0,%al
call   1050 <test_alib@plt>
mov    $0x0,%al
call   1060 <test_post_alib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_pre_alib@plt>
xor    %eax,%eax
call   1050 <test_alib@plt>
xor    %eax,%eax
call   1060 <test_post_alib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"This is a \22bin\22 target.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_pre_alib()
%8 = call i32 (...) @test_alib()
%9 = call i32 (...) @test_post_alib()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"This is a \22bin\22 target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_pre_alib()
%5 = tail call i32 (...) @test_alib()
%6 = tail call i32 (...) @test_post_alib()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_slli_epi64(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi64(int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
__m128i shift_right_in(__m128i a, unsigned num_bytes) {
  unsigned count = num_bytes * 8;
  __m128i result, tmp;
  result = _mm_srli_epi64(a, count);
  tmp = _mm_srli_si128(a, 8);
  tmp = _mm_slli_epi64(tmp, 64 - (count));
  result = _mm_or_si128(result, tmp);
  return result;
}


x86 assembly (clang, -O0):
<shift_right_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_mm_srli_epi64@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x40,%esi
sub    -0xc(%rbp),%esi
call   1060 <_mm_slli_epi64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <_mm_or_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_right_in>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
shl    $0x3,%ebx
mov    %ebx,%esi
call   1030 <_mm_srli_epi64@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    $0x8,%esi
call   1040 <_mm_srli_si128@plt>
mov    $0x40,%esi
sub    %ebx,%esi
mov    %eax,%edi
call   1060 <_mm_slli_epi64@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @shift_right_in(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = mul i32 %8, 8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @_mm_srli_epi64(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = call i32 @_mm_srli_si128(i32 %13, i32 8)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %5
%17 = sub i32 64, %16
%18 = call i32 @_mm_slli_epi64(i32 %15, i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @_mm_or_si128(i32 %19, i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @shift_right_in(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i32 @_mm_srli_epi64(i32 %0, i32 %3)
%5 = tail call i32 @_mm_srli_si128(i32 %0, i32 8)
%6 = sub i32 64, %3
%7 = tail call i32 @_mm_slli_epi64(i32 %5, i32 %6)
%8 = tail call i32 @_mm_or_si128(i32 %4, i32 %7)
ret i32 %8
}
float PLUS(float a, float b) {
  if ((a == -1) || (b == -1)) {
    return -1;
  }
  return (a + b);
}


x86 assembly (clang, -O0):
<PLUS>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    112f <PLUS+0x2f>
jp     112f <PLUS+0x2f>
jmp    114b <PLUS+0x4b>
movss  -0xc(%rbp),%xmm0
movss  0xec4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    115d <PLUS+0x5d>
jp     115d <PLUS+0x5d>
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116c <PLUS+0x6c>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PLUS>:
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  0xef1(%rip),%xmm3
cmpeqss %xmm3,%xmm1
movaps %xmm1,%xmm4
andnps %xmm2,%xmm4
andps  %xmm3,%xmm1
orps   %xmm4,%xmm1
cmpeqss %xmm3,%xmm0
movaps %xmm0,%xmm2
andnps %xmm1,%xmm2
andps  %xmm3,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @PLUS(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, -1.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, float* %5
%10 = fcmp oeq float %9, -1.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store float -1.000000e+00, float* %3
br label %16
12: ; preds = %8
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fadd float %13, %14
store float %15, float* %3
br label %16
16: ; preds = %12, %11
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @PLUS(float %0, float %1) {
%3 = fcmp oeq float %0, -1.000000e+00
%4 = fcmp oeq float %1, -1.000000e+00
%5 = or i1 %3, %4
%6 = fadd float %0, %1
%7 = select i1 %5, float -1.000000e+00, float %6
ret float %7
}
int main() {
  int a, b, c;
  if (a = a + 1) {
    b = 0;
    c = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     112b <main+0x2b>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ncsTempListRefresh() { return; }


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

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

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

LLVM IR (-O2):
define void @ncsTempListRefresh() {
ret void
}
/* Type definitions */
typedef int val;
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t *ui32_to_bytes(uint8_t *buf, uint32_t val) {
  buf[0] = (val >> 24) & 0xff;
  buf[1] = (val >> 16) & 0xff;
  buf[2] = (val >> 8) & 0xff;
  buf[3] = (val)&0xff;
  return buf + 4;
}


x86 assembly (clang, -O0):
<ui32_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui32_to_bytes>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
lea    0x10(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @ui32_to_bytes(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 4
ret i32* %25
}

LLVM IR (-O2):
define i32* @ui32_to_bytes(i32* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
%12 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %12
}
void free_submatrix(b, nrl, nrh, ncl, nch) float **b;
int nrl, nrh, ncl, nch;
{ free((char *)(b + nrl)); }


x86 assembly (clang, -O0):
<free_submatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_submatrix>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_submatrix(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float*, float** %11, i64 %13
%15 = bitcast float** %14 to i8*
ret void
}

LLVM IR (-O2):
define void @free_submatrix(float** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds float*, float** %0, i64 %6
%8 = bitcast float** %7 to i8*
tail call void @free(i8* %8)
ret void
}
/* Type definitions */
struct trie__view {
  int dummy;
};

/* Variables and functions */
int goto_node_zero(struct trie__view *);
int trie__iter(struct trie__view *t) { return goto_node_zero(t); }


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

x86 assembly (clang, -O2):
<trie__iter>:
jmp    1030 <goto_node_zero@plt>

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

LLVM IR (-O2):
%struct.trie__view = type { i32 }
define i32 @trie__iter(%struct.trie__view* %0) {
%2 = tail call i32 @goto_node_zero(%struct.trie__view* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void inthander(int s) {
  printf("Calling with signal %d\n", s);
  sleep(2);
  printf("Done handling signal %d\n", s);
}


x86 assembly (clang, -O0):
<inthander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthander>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Calling with signal %d\0A\00"
@.str.1 = [25 x i8] c"Done handling signal %d\0A\00"
define void @inthander(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Calling with signal %d\0A\00"
@.str.1 = [25 x i8] c"Done handling signal %d\0A\00"
define void @inthander(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
void set_XErrorEvent_type(void *_p, int _v) {
  ((XErrorEvent *)_p)->type = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XErrorEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XErrorEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int xToI();
int main(void) {
  printf("the answer is %d\n", xToI());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <xToI@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
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 <xToI@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"the answer is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @xToI()
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"the answer is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @xToI()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t get_next(const char **list) {
  do {
    (*list)++;
  } while (*(*list) != '\0');
  return (uint8_t) * (++(*list));
}


x86 assembly (clang, -O0):
<get_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1108 <get_next+0x8>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl 0x1(%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_next(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %5, %3 ], [ %2, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 2
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
ret i32 %11
}
int aa_pro_ctr_a1c(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a1c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a1c>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1c = [15 x i8] c"aa_pro_ctr_a1c\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1c(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1c, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a1c = [15 x i8] c"aa_pro_ctr_a1c\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a1c(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a1c, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
int ldchar2(src, len, dst)
char *src;
register char *dst;
int len;
{
  register char *p;
  if (len <= 0)
    return 0;
  memcpy((void *)dst, (const void *)src, len);
  *(dst + len) = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<ldchar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1139 <ldchar2+0x29>
movl   $0x0,-0x4(%rbp)
jmp    115d <ldchar2+0x4d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldchar2>:
test   %esi,%esi
jle    113a <ldchar2+0x2a>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rax
mov    %esi,%ebx
mov    %rdx,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ldchar2(i8* nocapture %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %0, i64 %6, i1 false)
%7 = getelementptr inbounds i8, i8* %2, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %3, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ com_putc(unsigned char);
void sendcommand(unsigned char c) {
  com_putc(0xA5);
  com_putc(c);
}


x86 assembly (clang, -O0):
<sendcommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xa5,%edi
call   1030 <com_putc@plt>
movzbl -0x1(%rbp),%edi
call   1030 <com_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendcommand>:
push   %rbx
mov    %edi,%ebx
mov    $0xa5,%edi
call   1030 <com_putc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <com_putc@plt>

LLVM IR (-O0):
define void @sendcommand(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @com_putc(i8 zeroext -91)
%4 = load i8, i8* %2
%5 = call i32 @com_putc(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @sendcommand(i8 zeroext %0) {
%2 = tail call i32 @com_putc(i8 zeroext -91)
%3 = tail call i32 @com_putc(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_array();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int key;
  read_array();
  printf("\nEnter number to be searched: ");
  scanf("%d", &key);
  binary_search(key);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <read_array@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <binary_search@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <read_array@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <binary_search@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0AEnter number to be searched: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @read_array()
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @binary_search(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AEnter number to be searched: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @read_array()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @binary_search(i32 %6)
ret i32 0
}
int Media_deinit() {}


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

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

LLVM IR (-O0):
define i32 @Media_deinit() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @Media_deinit() {
ret i32 undef
}
void swap(void **a, void **b) {
  void *temp = *a;
  *a = *b;
  *b = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int __attribute__((annotate("realtime"))) main() {
  malloc(123);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpuc72nbax/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @main to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 17, i8* null }], section "llvm.metadata"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @malloc(i32 123)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpuc72nbax/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @main to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 17, i8* null }], section "llvm.metadata"
define i32 @main() {
%1 = tail call i32 @malloc(i32 123)
ret i32 0
}
long long int foo(long long x, int in) {
  short a = in & 0xffff;
  short b = (in & 0xffff0000) >> 16;
  return x + b * a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    %ax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl -0x10(%rbp),%ecx
movswl -0xe(%rbp),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movswl %si,%eax
sar    $0x10,%esi
imul   %esi,%eax
cltq
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 65535
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i32, i32* %4
%11 = and i32 %10, -65536
%12 = lshr i32 %11, 16
%13 = trunc i32 %12 to i16
store i16 %13, i16* %6
%14 = load i64, i64* %3
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = load i16, i16* %5
%18 = sext i16 %17 to i32
%19 = mul nsw i32 %16, %18
%20 = sext i32 %19 to i64
%21 = add nsw i64 %14, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i32 %1) {
%3 = ashr i32 %1, 16
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
%6 = mul nsw i32 %5, %3
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %0
ret i64 %8
}
void _start(void) {
  asm("    finit;      \n");
  asm("    call main;  \n");
  asm("1:  iret;       \n");
  asm("    jmp 1;      \n");
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
finit
call   1030 <main@plt>
iret
jmp    1 <_init-0xfff>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
finit
call   1030 <main@plt>
iret
jmp    1 <_init-0xfff>
ret

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

LLVM IR (-O2):
define void @_start() {
tail call void asm sideeffect " finit; \0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " call main; \0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "1: iret; \0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " jmp 1; \0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int fun635() { return 635; }


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

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

LLVM IR (-O0):
define i32 @fun635() {
ret i32 635
}

LLVM IR (-O2):
define i32 @fun635() {
ret i32 635
}
void ath5k_debug_finish_device(struct ath5k_softc *sc) {}


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

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

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

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
define void @ath5k_debug_finish_device(%struct.ath5k_softc* nocapture %0) {
ret void
}
void gtk_window_get_role() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_role() {
ret void
}
int brk(const void *end_data_segment) {
  int status = 0;
  asm("movl $45, %%eax \n\t"
      "movl %1, %%ebx \n\t"
      "int $0x80 \n\t"
      "movl %%eax, %0 \n\t"
      : "=r"(status)
      : "m"(end_data_segment));
  return status;
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x2d,%eax
mov    -0x8(%rbp),%ebx
int    $0x80
mov    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
mov    %rdi,-0x8(%rsp)
mov    $0x2d,%eax
mov    -0x8(%rsp),%ebx
int    $0x80
mov    %eax,%eax
ret

LLVM IR (-O0):
define i32 @brk(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 asm "movl $$45, %eax \0A\09movl $1, %ebx \0A\09int $$0x80 \0A\09movl %eax, $0 \0A\09", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 asm "movl $$45, %eax \0A\09movl $1, %ebx \0A\09int $$0x80 \0A\09movl %eax, $0 \0A\09", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %2)
ret i32 %3
}
/* Variables and functions */
int pq_implementation_start();
int /*<<< orphan*/ pq_quit_state_set(int /*<<< orphan*/);
int pq_start(void) {
  pq_quit_state_set(0);
  return pq_implementation_start();
}


x86 assembly (clang, -O0):
<pq_start>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <pq_quit_state_set@plt>
mov    $0x0,%al
call   1030 <pq_implementation_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_start>:
push   %rax
xor    %edi,%edi
call   1040 <pq_quit_state_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pq_implementation_start@plt>

LLVM IR (-O0):
define i32 @pq_start() {
%1 = call i32 @pq_quit_state_set(i32 0)
%2 = call i32 (...) @pq_implementation_start()
ret i32 %2
}

LLVM IR (-O2):
define i32 @pq_start() {
%1 = tail call i32 @pq_quit_state_set(i32 0)
%2 = tail call i32 (...) @pq_implementation_start()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_condcode_d(int *, double, double);
int xil_fpo_condcode_d(double a, double b) {
  int res_int;
  xip_fpo_condcode_d(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_condcode_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x14(%rbp),%rdi
call   1030 <xip_fpo_condcode_d@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_condcode_d>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_condcode_d@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_condcode_d(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_condcode_d(i32* %3, double %0, double %1)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
void CL_InitKeyCommands(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_InitKeyCommands() {
ret void
}
void f_fnptr1(int f, int (*fp)(int)) { return; }


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

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

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

LLVM IR (-O2):
define void @f_fnptr1(i32 %0, i32 (i32)* nocapture %1) {
ret void
}
char extract_short_option(const char *arg) { return arg[1]; }


x86 assembly (clang, -O0):
<extract_short_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_short_option>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @extract_short_option(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @extract_short_option(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
float acos(float);
float Float_acos(float x) { return acos(x); }


x86 assembly (clang, -O0):
<Float_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_acos>:
jmp    1030 <acos@plt>

LLVM IR (-O0):
define float @Float_acos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @acos(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Float_acos(float %0) {
%2 = tail call float @acos(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int desejada, lida;
  scanf("%d%d", &desejada, &lida);
  printf("%d", desejada - lida);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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    0x4(%rsp),%esi
sub    (%rsp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}