xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetBlueVideoBlackLevel(void *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned short);
void UPnPRenderingControl_SetBlueVideoBlackLevel(
    void *upnptoken, unsigned int InstanceID,
    unsigned short DesiredBlueVideoBlackLevel) {
  printf("Invoke: UPnPRenderingControl_SetBlueVideoBlackLevel(%u,%u);\r\n",
         InstanceID, DesiredBlueVideoBlackLevel);
  UPnPResponse_RenderingControl_SetBlueVideoBlackLevel(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetBlueVideoBlackLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
movzwl -0xe(%rbp),%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_RenderingControl_SetBlueVideoBlackLevel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_SetBlueVideoBlackLevel>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_SetBlueVideoBlackLevel@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Invoke: UPnPRenderingControl_SetBlueVideoBlackLevel(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBlueVideoBlackLevel(i8* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %5
%8 = load i16, i16* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %7, i16 zeroext %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_SetBlueVideoBlackLevel(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Invoke: UPnPRenderingControl_SetBlueVideoBlackLevel(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBlueVideoBlackLevel(i8* %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_SetBlueVideoBlackLevel(i8* %0)
ret void
}
/* Variables and functions */
void *clad_gar_resize(void **, size_t *, int, int);
void *clad_par_resize(void **arr, size_t *nmemb, int delta) {
  return clad_gar_resize(arr, nmemb, sizeof(void *), delta);
}


x86 assembly (clang, -O0):
<clad_par_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    $0x8,%edx
call   1030 <clad_gar_resize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_par_resize>:
mov    %edx,%ecx
mov    $0x8,%edx
jmp    1030 <clad_gar_resize@plt>

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

LLVM IR (-O2):
define i8* @clad_par_resize(i8** %0, i64* %1, i32 %2) {
%4 = tail call i8* @clad_gar_resize(i8** %0, i64* %1, i32 8, i32 %2)
ret i8* %4
}
void gdk_utf8_to_string_target() {}


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

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

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

LLVM IR (-O2):
define void @gdk_utf8_to_string_target() {
ret void
}
void foo390(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo390(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int i, j, k;
  k = 0;
  while (k < 10) {
    k++;
    if (j > i)
      j = 5;
    else
      j = 3;
  }
  if (k != 10)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    115d <main+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1151 <main+0x41>
movl   $0x5,-0xc(%rbp)
jmp    1158 <main+0x48>
movl   $0x3,-0xc(%rbp)
jmp    1126 <main+0x16>
cmpl   $0xa,-0x10(%rbp)
je     116e <main+0x5e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
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
store i32 0, i32* %4
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 5, i32* %3
br label %16
15: ; preds = %8
store i32 3, i32* %3
br label %16
16: ; preds = %15, %14
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int isMultiple(int num1, int num2) { return num1 % num2 == 0; }


x86 assembly (clang, -O0):
<isMultiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMultiple>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @isMultiple(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @isMultiple(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ m;

/* Variables and functions */
int /*<<< orphan*/ findUniqueRows(int, int, int **);
int main() {
  int m[][5] = {
      {0, 1, 0, 0, 1}, {1, 0, 1, 1, 0}, {0, 1, 0, 0, 1}, {1, 0, 1, 0, 0}};
  int row = sizeof(m) / sizeof(m[0]);
  int col = sizeof(m[0]) / sizeof(m[0][0]);
  findUniqueRows(row, col, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x64(%rbp)
movl   $0x5,-0x68(%rbp)
mov    -0x64(%rbp),%edi
mov    -0x68(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1030 <findUniqueRows@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <findUniqueRows@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

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

LLVM IR (-O2):
@__const.main.m = [4 x [5 x i32]] [[5 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1], [5 x i32] [i32 1, i32 0, i32 1, i32 1, i32 0], [5 x i32] [i32 0, i32 1, i32 0, i32 0, i32 1], [5 x i32] [i32 1, i32 0, i32 1, i32 0, i32 0]]
define i32 @main() {
%1 = alloca [4 x [5 x i32]]
%2 = bitcast [4 x [5 x i32]]* %1 to i8*
%3 = bitcast [4 x [5 x i32]]* %1 to i32**
%4 = call i32 @findUniqueRows(i32 4, i32 5, i32** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void log_open(const char *name) {
  openlog(name, LOG_NDELAY | LOG_PID, LOG_DAEMON);
}


x86 assembly (clang, -O0):
<log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open>:
mov    0x2eb1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_NDELAY
%5 = load i32, i32* @LOG_PID
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i8* %3, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_NDELAY = global i32 0
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_open(i8* %0) {
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_PID
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_DAEMON
%6 = tail call i32 @openlog(i8* %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ q_select(int *, int, int /*<<< orphan*/, int);
int main(int argc, const char *argv[]) {
  int a[] = {0, 2, 1, 3, 4};
  int k = 2;
  q_select(a, k, 0, 5);
  printf("%d\n", a[k - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x2,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1040 <q_select@plt>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1040 <q_select@plt>
mov    0x4(%rsp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 0, i32 2, i32 1, i32 3, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i32]* %6 to i8*
store i32 2, i32* %7
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%10 = load i32, i32* %7
%11 = call i32 @q_select(i32* %9, i32 %10, i32 0, i32 5)
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 0, i32 2, i32 1, i32 3, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @q_select(i32* %5, i32 2, i32 0, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank5(int);
void vrc7setParamsC010(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank5(val << 10);
}


x86 assembly (clang, -O0):
<vrc7setParamsC010>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank5@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrc7setParamsC010>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank5@plt>

LLVM IR (-O0):
define void @vrc7setParamsC010(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank5(i32 %7)
ret void
}

LLVM IR (-O2):
define void @vrc7setParamsC010(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank5(i32 %3)
ret void
}
int test_imm_FCuint32_mem(unsigned int *val) {
  return ((*val) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xfc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FCuint32_mem>:
testb  $0xfc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FCuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 252
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_FCuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 252
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__float128 from_uns_short_load(unsigned short *a) { return (__float128)*a; }


x86 assembly (clang, -O0):
<from_uns_short_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edi
call   1120 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<from_uns_short_load>:
push   %rax
movzwl (%rdi),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @from_uns_short_load(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = uitofp i16 %4 to fp128
ret fp128 %5
}

LLVM IR (-O2):
define fp128 @from_uns_short_load(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = uitofp i16 %2 to fp128
ret fp128 %3
}
int hcf(int a, int b) { return (b == 0) ? a : hcf(b, a % b); }


x86 assembly (clang, -O0):
<hcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <hcf+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <hcf+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <hcf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcf>:
mov    %edi,%eax
test   %esi,%esi
je     111d <hcf+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <hcf+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hcf(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = call i32 @hcf(i32 %10, i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i32 [ %8, %7 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @hcf(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void adcZp8(void) { adc8(readmem65816(zeropage())); }


x86 assembly (clang, -O0):
<adcZp8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <zeropage@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcZp8>:
push   %rax
xor    %eax,%eax
call   1040 <zeropage@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcZp8() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcZp8() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
/* Variables and functions */
int SSIZE_MAX;
int read(int, unsigned char *, int);
int serial_read(int sid, unsigned char *buf, int size) {
  int n;
  if (size > SSIZE_MAX)
    size = (int)SSIZE_MAX;
  n = read(sid, buf, size);
  return (n);
}


x86 assembly (clang, -O0):
<serial_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%eax
jle    1140 <serial_read+0x30>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_read>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
cmp    %edx,%eax
cmovl  %eax,%edx
jmp    1030 <read@plt>

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

LLVM IR (-O2):
@SSIZE_MAX = global i32 0
define i32 @serial_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SSIZE_MAX
%5 = icmp slt i32 %4, %2
%6 = select i1 %5, i32 %4, i32 %2
%7 = tail call i32 @read(i32 %0, i8* %1, i32 %6)
ret i32 %7
}
int test_imm_1Dint64_midword_reg(long long val) {
  return ((val >> 16) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Dint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Dint64_midword_reg>:
test   $0x1d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Dint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 29
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Dint64_midword_reg(i64 %0) {
%2 = and i64 %0, 1900544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void calibrate_clock(void) {}


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

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

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

LLVM IR (-O2):
define void @calibrate_clock() {
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_test_log_1_svc(char *, void *, struct svc_req *);
int _l2tp_test_log_1(char **argp, void *result, struct svc_req *rqstp) {
  return (l2tp_test_log_1_svc(*argp, result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_test_log_1>:
mov    (%rdi),%rdi
jmp    1030 <l2tp_test_log_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_test_log_1(i8** %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load %struct.svc_req*, %struct.svc_req** %6
%11 = call i32 @l2tp_test_log_1_svc(i8* %8, i8* %9, %struct.svc_req* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_test_log_1(i8** nocapture %0, i8* %1, %struct.svc_req* %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @l2tp_test_log_1_svc(i8* %4, i8* %1, %struct.svc_req* %2)
ret i32 %5
}
unsigned xrop3_234_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_234_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_234_0_0>:
and    %esi,%edi
shl    $0x8,%edi
lea    0xff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_234_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_234_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, %0
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = or i32 %5, 255
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *strchr(char *, char);
void read_till_nl(FILE *in) {
  char buf[4 + 1];
  do {
    fgets(buf, 4, in);
  } while (strchr(buf, '\n') == NULL);
}


x86 assembly (clang, -O0):
<read_till_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4,%esi
call   1040 <fgets@plt>
lea    -0xd(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     112c <read_till_nl+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_till_nl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x3(%rsp),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1130 <read_till_nl+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @read_till_nl(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %8, %1
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @fgets(i8* %5, i32 4, i32* %6)
br label %8
8: ; preds = %4
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = call i32* @strchr(i8* %9, i8 signext 10)
%11 = icmp eq i32* %10, null
br i1 %11, label %4, label %12
12: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @read_till_nl(i32* nocapture %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @fgets(i8* %3, i32 4, i32* %0)
%6 = call i32* @strchr(i8* %3, i8 signext 10)
%7 = icmp eq i32* %6, null
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Type definitions */
struct measure {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct measure *);
void measures_free(struct measure *measures) { free(measures); }


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

x86 assembly (clang, -O2):
<measures_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.measure = type { i32 }
define void @measures_free(%struct.measure* nocapture %0) {
%2 = tail call i32 @free(%struct.measure* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, size_t);
bool hubbub_string_match(const uint8_t *a, size_t a_len, const uint8_t *b,
                         size_t b_len) {
  if (a_len != b_len)
    return false;
  return memcmp((const char *)a, (const char *)b, b_len) == 0;
}


x86 assembly (clang, -O0):
<hubbub_string_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1142 <hubbub_string_match+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1162 <hubbub_string_match+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hubbub_string_match>:
xor    %eax,%eax
cmp    %rcx,%rsi
jne    1135 <hubbub_string_match+0x25>
push   %rax
mov    %rsi,%r8
mov    %rdx,%rsi
mov    %r8,%rdx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @hubbub_string_match(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = bitcast i32* %0 to i8*
%8 = bitcast i32* %2 to i8*
%9 = tail call i64 @memcmp(i8* %7, i8* %8, i64 %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %6
%13 = phi i32 [ %11, %6 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _perf_output_report(int, int /*<<< orphan*/);
void perf_output_report(int id) { _perf_output_report(id, 0); }


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

x86 assembly (clang, -O2):
<perf_output_report>:
xor    %esi,%esi
jmp    1030 <_perf_output_report@plt>

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

LLVM IR (-O2):
define void @perf_output_report(i32 %0) {
%2 = tail call i32 @_perf_output_report(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "smoothin via Sampled Gaussian kernel convolution:  \n");
  fprintf(stderr,
          "        gaussconv_sampled_kernel in sigma k(truncation) out \n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xefc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf06(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"smoothin via Sampled Gaussian kernel convolution: \0A\00"
@.str.1 = [62 x i8] c" gaussconv_sampled_kernel in sigma k(truncation) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"smoothin via Sampled Gaussian kernel convolution: \0A\00"
@.str.1 = [62 x i8] c" gaussconv_sampled_kernel in sigma k(truncation) out \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void putc_ll(unsigned char value) {}


x86 assembly (clang, -O0):
<putc_ll>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putc_ll(i8 zeroext %0) {
ret void
}
int print_binlog_query_event(struct query_event *query_ev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.query_event = type opaque
define i32 @print_binlog_query_event(%struct.query_event* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct mx_getopt_ctl {
  int dummy;
};

/* Variables and functions */
int _mx_getopt_long(struct mx_getopt_ctl *, int *);
int mx_getopt_long(struct mx_getopt_ctl *optctl, int *optindex) {
  return _mx_getopt_long(optctl, optindex);
}


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

x86 assembly (clang, -O2):
<mx_getopt_long>:
jmp    1030 <_mx_getopt_long@plt>

LLVM IR (-O0):
%struct.mx_getopt_ctl = type { i32 }
define i32 @mx_getopt_long(%struct.mx_getopt_ctl* %0, i32* %1) {
%3 = alloca %struct.mx_getopt_ctl*
%4 = alloca i32*
store %struct.mx_getopt_ctl* %0, %struct.mx_getopt_ctl** %3
store i32* %1, i32** %4
%5 = load %struct.mx_getopt_ctl*, %struct.mx_getopt_ctl** %3
%6 = load i32*, i32** %4
%7 = call i32 @_mx_getopt_long(%struct.mx_getopt_ctl* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.mx_getopt_ctl = type { i32 }
define i32 @mx_getopt_long(%struct.mx_getopt_ctl* %0, i32* %1) {
%3 = tail call i32 @_mx_getopt_long(%struct.mx_getopt_ctl* %0, i32* %1)
ret i32 %3
}
char *R2Settings_getVersion() { return "Artoo version 0.9"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Artoo version 0.9\00"
define i8* @R2Settings_getVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"Artoo version 0.9\00"
define i8* @R2Settings_getVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int v[], int s, int f) {
  int m = 0;
  if (s < f) {
    m = ((s + f) / 2);
    merge_sort(v, s, m);
    merge_sort(v, m + 1, f);
    merge(v, s, m, f);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <merge_sort+0x69>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %edx,%esi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
char *leakproof_malloc(char const *, unsigned int, int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *leakproof_strdup(const char *file, unsigned line, const char *str) {
  int len = strlen(str);
  char *s2 = leakproof_malloc(file, line, len + 1);
  if (s2)
    strcpy(s2, str);
  return s2;
}


x86 assembly (clang, -O0):
<leakproof_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1050 <leakproof_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     117d <leakproof_strdup+0x4d>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leakproof_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <leakproof_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <leakproof_strdup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @leakproof_strdup(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 1
%15 = call i8* @leakproof_malloc(i8* %11, i32 %12, i32 %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load i8*, i8** %8
%20 = load i8*, i8** %6
%21 = call i32 @strcpy(i8* %19, i8* %20)
br label %22
22: ; preds = %18, %3
%23 = load i8*, i8** %8
ret i8* %23
}

LLVM IR (-O2):
define i8* @leakproof_strdup(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @leakproof_malloc(i8* %0, i32 %1, i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %2)
br label %10
10: ; preds = %8, %3
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f3();
int main(void) {
  f1();
  f3();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f1@plt>
mov    $0x0,%al
call   1030 <f3@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f3()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f3()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int load_int(char *p) {
  return ((p[0] & 255) + ((p[1] & 255) << 8) + ((p[2] & 255) << 16) +
          ((p[3] & 255) << 24));
}


x86 assembly (clang, -O0):
<load_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_int>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @load_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ menu_close();
int /*<<< orphan*/ moo_close();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sys_close();
void close() {
  printf("-- Closing MooBoy --\n");
  moo_close();
  menu_close();
  sys_close();
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <moo_close@plt>
mov    $0x0,%al
call   1030 <menu_close@plt>
mov    $0x0,%al
call   1050 <sys_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <moo_close@plt>
xor    %eax,%eax
call   1030 <menu_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <sys_close@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"-- Closing MooBoy --\0A\00"
define void @close() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @moo_close()
%3 = call i32 (...) @menu_close()
%4 = call i32 (...) @sys_close()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"-- Closing MooBoy --\00"
define void @close() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @moo_close()
%3 = tail call i32 (...) @menu_close()
%4 = tail call i32 (...) @sys_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(const int *array, const size_t size) {
  for (size_t i = 0; i < size; i++)
    printf("%d ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <printArray+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printArray+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <printArray+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
void bar(int is[2]) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int main(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
ret i32 0
}
int xtensa_simm32(v)
int v;
{ return 1; }


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

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

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

LLVM IR (-O2):
define i32 @xtensa_simm32(i32 %0) {
ret i32 1
}