xunge/DecIR huggingface dataset:
int null_PCAP_SET_DATALINK(void *hPcap, int datalink) { return -1; }


x86 assembly (clang, -O0):
<null_PCAP_SET_DATALINK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_PCAP_SET_DATALINK(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
long evaltable();
scalar_t__ test(char *);
long evalfrom() {
  long val;
  for (val = evaltable(); test("&&");) {
    if (!evaltable() != 0)
      val = 0;
  }
  return (val);
}


x86 assembly (clang, -O0):
<evalfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <evaltable@plt>
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <test@plt>
cmp    $0x0,%rax
je     1174 <evalfrom+0x54>
mov    $0x0,%al
call   1030 <evaltable@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     116f <evalfrom+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1133 <evalfrom+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalfrom>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <evaltable@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
call   1040 <test@plt>
test   %rax,%rax
je     116b <evalfrom+0x4b>
lea    0xeba(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <evaltable@plt>
test   %rax,%rax
cmove  %rax,%rbx
mov    %r14,%rdi
call   1040 <test@plt>
test   %rax,%rax
jne    1150 <evalfrom+0x30>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"&&\00"
define i64 @evalfrom() {
%1 = alloca i64
%2 = call i64 (...) @evaltable()
store i64 %2, i64* %1
br label %3
3: ; preds = %13, %0
%4 = call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i64 (...) @evaltable()
%8 = icmp ne i64 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
store i64 0, i64* %1
br label %13
13: ; preds = %12, %6
br label %3
14: ; preds = %3
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"&&\00"
define i64 @evalfrom() {
%1 = tail call i64 (...) @evaltable()
%2 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i64 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i64 (...) @evaltable()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 0, i64 %5
%9 = tail call i64 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = phi i64 [ %1, %0 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_nibble(unsigned char);
void __console_tx_hex8(unsigned char byte) {
  __console_tx_nibble(byte >> 4);
  __console_tx_nibble(byte & 0x0f);
}


x86 assembly (clang, -O0):
<__console_tx_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1030 <__console_tx_nibble@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <__console_tx_nibble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__console_tx_hex8>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <__console_tx_nibble@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <__console_tx_nibble@plt>

LLVM IR (-O0):
define void @__console_tx_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = trunc i32 %5 to i8
%7 = call i32 @__console_tx_nibble(i8 zeroext %6)
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i8
%12 = call i32 @__console_tx_nibble(i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @__console_tx_hex8(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @__console_tx_nibble(i8 zeroext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @__console_tx_nibble(i8 zeroext %4)
ret void
}
/* Variables and functions */
int findIndex(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  int A[10] = {-3, -2, -1, 2, 3, 5, 9, 11, 12, 14};
  printf("Found index = %d\n", findIndex(A, 10));
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <findIndex@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1050 <findIndex@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [10 x i32] [i32 -3, i32 -2, i32 -1, i32 2, i32 3, i32 5, i32 9, i32 11, i32 12, i32 14]
@.str = [18 x i8] c"Found index = %d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @findIndex(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [10 x i32] [i32 -3, i32 -2, i32 -1, i32 2, i32 3, i32 5, i32 9, i32 11, i32 12, i32 14]
@.str = [18 x i8] c"Found index = %d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @findIndex(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void f(int k, int l, int a[20]) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32* nocapture %2) {
ret void
}
float en_buyuk_float(float birinci, float ikinci, float ucuncu) {
  float max_float;
  max_float = birinci;
  if (max_float < ikinci) {
    max_float = ikinci;
  }
  if (max_float < ucuncu) {
    max_float = ucuncu;
  }
  return max_float;
}


x86 assembly (clang, -O0):
<en_buyuk_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <en_buyuk_float+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1157 <en_buyuk_float+0x57>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<en_buyuk_float>:
maxss  %xmm0,%xmm1
maxss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @en_buyuk_float(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
store float %8, float* %7
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load float, float* %5
store float %13, float* %7
br label %14
14: ; preds = %12, %3
%15 = load float, float* %7
%16 = load float, float* %6
%17 = fcmp olt float %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load float, float* %6
store float %19, float* %7
br label %20
20: ; preds = %18, %14
%21 = load float, float* %7
ret float %21
}

LLVM IR (-O2):
define float @en_buyuk_float(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp olt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Variables and functions */
int pow(int n, int x) {
  if (x == 0)
    return 1;
  while (x-- > 1) {
    n = n * n;
  }
  return n;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <pow+0x20>
movl   $0x1,-0x4(%rbp)
jmp    114e <pow+0x4e>
jmp    1125 <pow+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x1,%eax
jle    1148 <pow+0x48>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <pow+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
test   %esi,%esi
je     111c <pow+0x1c>
mov    %edi,%eax
cmp    $0x2,%esi
jl     111b <pow+0x1b>
add    $0x1,%esi
xchg   %ax,%ax
imul   %eax,%eax
add    $0xffffffff,%esi
cmp    $0x2,%esi
ja     1110 <pow+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %20
9: ; preds = %2
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %5
%12 = add nsw i32 %11, -1
store i32 %12, i32* %5
%13 = icmp sgt i32 %11, 1
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %4
br label %10
18: ; preds = %10
%19 = load i32, i32* %4
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 1
br i1 %5, label %6, label %12
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = phi i32 [ %10, %6 ], [ %0, %4 ]
%9 = add nsw i32 %7, -1
%10 = mul nsw i32 %8, %8
%11 = icmp ugt i32 %7, 2
br i1 %11, label %6, label %12
12: ; preds = %6, %4, %2
%13 = phi i32 [ 1, %2 ], [ %0, %4 ], [ %10, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t be16toh(uint16_t big_endian_16bits) {
  return bswap_16(big_endian_16bits);
}


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

x86 assembly (clang, -O2):
<be16toh>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @be16toh(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           void const *, void const *);
int /*<<< orphan*/ stderr;
void check_ptrs(const void *actual, const void *expected, const char *msg) {
  if (expected == actual) {
    return;
  }
  fprintf(stderr, "FAIL: %s Expected '%p' but was '%p'\n", msg, expected,
          actual);
  exit(1);
}


x86 assembly (clang, -O0):
<check_ptrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1148 <check_ptrs+0x28>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check_ptrs>:
cmp    %rdi,%rsi
jne    1126 <check_ptrs+0x6>
ret
push   %rax
mov    %rsi,%rcx
mov    %rdi,%r8
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"FAIL: %s Expected '%p' but was '%p'\0A\00"
define void @check_ptrs(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, %0
br i1 %4, label %5, label %6
5: ; preds = %3
ret void
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1, i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LDA_();
int /*<<< orphan*/ c64_memZeroX();
void LDA_zpx(void) {
  c64_memZeroX();
  LDA_();
}


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

x86 assembly (clang, -O2):
<LDA_zpx>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memZeroX@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <LDA_@plt>

LLVM IR (-O0):
define void @LDA_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @LDA_()
ret void
}

LLVM IR (-O2):
define void @LDA_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @LDA_()
ret void
}
const char *unqlite_lib_copyright(void) {
  return "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine "
         "<chm@symisc.net>] 2012-2018, http://unqlite.org/";
}


x86 assembly (clang, -O0):
<unqlite_lib_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unqlite_lib_copyright>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [108 x i8] c"Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2018, http://unqlite.org/\00"
define i8* @unqlite_lib_copyright() {
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [108 x i8] c"Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2018, http://unqlite.org/\00"
define i8* @unqlite_lib_copyright() {
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0)
}
void ufshpb_destroy_lu(struct ufs_hba *hba, struct scsi_device *sdev) {}


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

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

LLVM IR (-O0):
%struct.ufs_hba = type opaque
%struct.scsi_device = type opaque
define void @ufshpb_destroy_lu(%struct.ufs_hba* %0, %struct.scsi_device* %1) {
%3 = alloca %struct.ufs_hba*
%4 = alloca %struct.scsi_device*
store %struct.ufs_hba* %0, %struct.ufs_hba** %3
store %struct.scsi_device* %1, %struct.scsi_device** %4
ret void
}

LLVM IR (-O2):
%struct.ufs_hba = type opaque
%struct.scsi_device = type opaque
define void @ufshpb_destroy_lu(%struct.ufs_hba* nocapture %0, %struct.scsi_device* nocapture %1) {
ret void
}
void core_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @core_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ task(long);
int main() {
  printf("Main started\n");
  long t;
  for (t = 0; t < 5; t++) {
    task(t);
  }
  printf("Main completed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x5,-0x10(%rbp)
jge    1168 <main+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <task@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <main+0x23>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Main started\0A\00"
@.str.1 = [16 x i8] c"Main completed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %2
br label %4
4: ; preds = %10, %0
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* %2
%9 = call i32 @task(i64 %8)
br label %10
10: ; preds = %7
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 1
store i64 %12, i64* %2
br label %4
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@str = [13 x i8] c"Main started\00"
@str.2 = [15 x i8] c"Main completed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @task(i64 0)
%3 = tail call i32 @task(i64 1)
%4 = tail call i32 @task(i64 2)
%5 = tail call i32 @task(i64 3)
%6 = tail call i32 @task(i64 4)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_byte(char const);
void SerialOutputString(const char *s) {
  while (*s != 0) {
    print_byte(*s);
    if (*s == '\n')
      print_byte('\r');
    s++;
  }
}


x86 assembly (clang, -O0):
<SerialOutputString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <SerialOutputString+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <print_byte@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1152 <SerialOutputString+0x42>
mov    $0xd,%edi
call   1030 <print_byte@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <SerialOutputString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialOutputString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <SerialOutputString+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    112b <SerialOutputString+0x1b>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1145 <SerialOutputString+0x35>
movsbl %al,%edi
call   1030 <print_byte@plt>
cmpb   $0xa,-0x1(%rbx)
jne    1120 <SerialOutputString+0x10>
mov    $0xd,%edi
call   1030 <print_byte@plt>
jmp    1120 <SerialOutputString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @SerialOutputString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i32 @print_byte(i8 signext %5)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @print_byte(i8 signext 13)
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stmg_no_wrap();
int /*<<< orphan*/ stmg_wrap();
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  stmg_no_wrap();
  write(1, "\n", 1);
  stmg_wrap();
  write(1, "\n", 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <stmg_no_wrap@plt>
mov    $0x1,%edx
lea    0xeae(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x0,%al
call   1050 <stmg_wrap@plt>
mov    $0x1,%edx
lea    0xe94(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <stmg_no_wrap@plt>
lea    0xec1(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
call   1050 <stmg_wrap@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @stmg_no_wrap()
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (...) @stmg_wrap()
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int *getFlag(int *array, int *node, int *n) {
  return array + node[2] * n[0] * n[1] + node[1] * n[0] + node[0];
}


x86 assembly (clang, -O0):
<getFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
mov    -0x18(%rbp),%rdx
imul   0x4(%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFlag>:
movslq 0x8(%rsi),%rax
movslq (%rdx),%rcx
imul   %rcx,%rax
movslq 0x4(%rdx),%rdx
imul   %rax,%rdx
lea    (%rdi,%rdx,4),%rax
movslq 0x4(%rsi),%rdx
imul   %rcx,%rdx
lea    (%rax,%rdx,4),%rax
movslq (%rsi),%rcx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define i32* @getFlag(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = mul nsw i32 %10, %13
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %7, i64 %19
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %23, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %20, i64 %28
%30 = load i32*, i32** %5
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %29, i64 %33
ret i32* %34
}

LLVM IR (-O2):
define i32* @getFlag(i32* readnone %0, i32* nocapture %1, i32* nocapture %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = load i32, i32* %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, %5
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %12, i64 %16
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
ret i32* %20
}
/* Variables and functions */
int f(int *);
main() {
  int x[] = {1, 2, 3};
  return f(x);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <f@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = call i32 @f(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 %4
}
void free_critbit_node(void *const ctx, void *const node) {
  (void)ctx;
  (void)node;
}


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

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

LLVM IR (-O0):
define void @free_critbit_node(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @free_critbit_node(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int mydbl(int input) { return input * 2; }


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

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

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

LLVM IR (-O2):
define i32 @mydbl(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int getw(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n;
  FILE *fp;
  fp = fopen("abc.txt", "rb");
  n = getw(fp);
  printf("%d", n);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <getw@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <getw@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @getw(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = tail call i32 @fclose(i32* %1)
ret void
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <check_prime+0x50>
jmp    113b <check_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %2
br label %20
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 1, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void myReshape(int x, int y) { glViewport(0, 0, x, y); }


x86 assembly (clang, -O0):
<myReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myReshape>:
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <glViewport@plt>

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

LLVM IR (-O2):
define void @myReshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
double exp(double);
double unitpdf(double x) {
  return exp(-0.5 * x * x) * 0.39894228040143267793994605993;
}


x86 assembly (clang, -O0):
<unitpdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unitpdf>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @unitpdf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -5.000000e-01, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
%8 = fmul double %7, 0x3FD9884533D43651
ret double %8
}

LLVM IR (-O2):
define double @unitpdf(double %0) {
%2 = fmul double %0, -5.000000e-01
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
%5 = fmul double %4, 0x3FD9884533D43651
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ umask(int);
int main() {
  umask(0);
  umask(7);
  umask(077);
  umask(0666);
  umask(0777);
  umask(01777);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <umask@plt>
mov    $0x7,%edi
call   1030 <umask@plt>
mov    $0x3f,%edi
call   1030 <umask@plt>
mov    $0x1b6,%edi
call   1030 <umask@plt>
mov    $0x1ff,%edi
call   1030 <umask@plt>
mov    $0x3ff,%edi
call   1030 <umask@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @umask(i32 0)
%3 = call i32 @umask(i32 7)
%4 = call i32 @umask(i32 63)
%5 = call i32 @umask(i32 438)
%6 = call i32 @umask(i32 511)
%7 = call i32 @umask(i32 1023)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i32 @umask(i32 7)
%3 = tail call i32 @umask(i32 63)
%4 = tail call i32 @umask(i32 438)
%5 = tail call i32 @umask(i32 511)
%6 = tail call i32 @umask(i32 1023)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int32_t mult32x16(int32_t x, int16_t y) {
  int32_t z;
  z = ((int32_t)y * (uint16_t)x) >> 15;
  z += ((int32_t)(x >> 16) * y) << 1;
  return z;
}


x86 assembly (clang, -O0):
<mult32x16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
imul   -0x8(%rbp),%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult32x16>:
mov    %esi,%eax
imul   %edi,%eax
sar    $0xf,%eax
sar    $0x10,%edi
imul   %esi,%edi
lea    (%rax,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @mult32x16(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 15
%5 = ashr i32 %0, 16
%6 = shl i32 %1, 1
%7 = mul i32 %6, %5
%8 = add nsw i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int avg(int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", avg(5, 8, 7, 3, 9, 10)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
call   1040 <avg@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
call   1040 <avg@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @avg(i32 5, i32 8, i32 7, i32 3, i32 9, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void lll_prof_exit_radio(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_action_disconnect_proxy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprint_justified(int /*<<< orphan*/, char const *, int, int,
                                    int);
int /*<<< orphan*/ stdout;
void print_justified(const char *p, int blankheader, int margin, int hor) {
  fprint_justified(stdout, p, blankheader, margin, hor);
}


x86 assembly (clang, -O0):
<print_justified>:
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    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <fprint_justified@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_justified>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_justified@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_justified(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @fprint_justified(i32 %9, i8* %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_justified(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprint_justified(i32 %5, i8* %0, i32 %1, i32 %2, i32 %3)
ret void
}
char *str_find_last(const char *s, int c) {
  const char *check;
  const char *last = 0;
  for (check = s; *check != '\0'; check++) {
    if (*check == c) {
      last = check;
    }
  }
  return (char *)last;
}


x86 assembly (clang, -O0):
<str_find_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <str_find_last+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1143 <str_find_last+0x43>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1148 <str_find_last+0x48>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <str_find_last+0x1b>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_find_last>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <str_find_last+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_find_last+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_find_last(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ null, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
ret i8* %16
}
char *mktemp(as)
char *as;
{ return (_gettemp(as, (int *)((void *)0)) ? as : (char *)((void *)0)); }


x86 assembly (clang, -O0):
<mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <_gettemp@plt>
cmp    $0x0,%eax
je     1141 <mktemp+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114c <mktemp+0x3c>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    114c <mktemp+0x3c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
xor    %esi,%esi
xor    %eax,%eax
call   1030 <_gettemp@plt>
test   %eax,%eax
cmove  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mktemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, ...)*)(i8* %3, i32* null)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @mktemp(i8* %0) {
%2 = tail call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, ...)*)(i8* %0, i32* null)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler1(int signum) {
  printf("this is sighandler1: %d\n", signum);
  return;
}


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

x86 assembly (clang, -O2):
<sighandler1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"this is sighandler1: %d\0A\00"
define void @sighandler1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"this is sighandler1: %d\0A\00"
define void @sighandler1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello, my cat\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, my cat\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 ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, my cat\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_trivial_prime(int n) { return n <= 2; }


x86 assembly (clang, -O0):
<is_trivial_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_trivial_prime>:
xor    %eax,%eax
cmp    $0x3,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @is_trivial_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_trivial_prime(i32 %0) {
%2 = icmp slt i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
void TIM2_OC2_IRQHandler(void) {}


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

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

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

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