xunge/DecIR huggingface dataset:
int git__signum(int val) { return ((val > 0) - (val < 0)); }


x86 assembly (clang, -O0):
<git__signum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__signum>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
sar    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @git__signum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @git__signum(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main() {
  pid_t pid;
  int num = 2;
  if (!(pid = fork())) {
    num++;
    printf("in child num = %d\n", num);
    return 0;
  }
  printf("in parent num = %d\n", num);
  wait(&pid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    117d <main+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    119c <main+0x6c>
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
je     115d <main+0x2d>
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
jmp    116e <main+0x3e>
lea    0xe9c(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"in child num = %d\0A\00"
@.str.1 = [20 x i8] c"in parent num = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @fork()
store i32 %3, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
br label %10
7: ; preds = %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = call i32 @wait(i32* %1)
br label %10
10: ; preds = %7, %5
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct woption {
  int dummy;
};

/* Variables and functions */
int _wgetopt_internal(int, int /*<<< orphan*/ *const *,
                      int /*<<< orphan*/ const *, struct woption const *, int *,
                      int);
int wgetopt_long_only(int argc, wchar_t *const *argv, const wchar_t *options,
                      const struct woption *long_options, int *opt_index) {
  return _wgetopt_internal(argc, argv, options, long_options, opt_index, 1);
}


x86 assembly (clang, -O0):
<wgetopt_long_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <_wgetopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wgetopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <_wgetopt_internal@plt>

LLVM IR (-O0):
%struct.woption = type { i32 }
define i32 @wgetopt_long_only(i32 %0, i32** %1, i32* %2, %struct.woption* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca %struct.woption*
%10 = alloca i32*
store i32 %0, i32* %6
store i32** %1, i32*** %7
store i32* %2, i32** %8
store %struct.woption* %3, %struct.woption** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32**, i32*** %7
%13 = load i32*, i32** %8
%14 = load %struct.woption*, %struct.woption** %9
%15 = load i32*, i32** %10
%16 = call i32 @_wgetopt_internal(i32 %11, i32** %12, i32* %13, %struct.woption* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.woption = type { i32 }
define i32 @wgetopt_long_only(i32 %0, i32** %1, i32* %2, %struct.woption* %3, i32* %4) {
%6 = tail call i32 @_wgetopt_internal(i32 %0, i32** %1, i32* %2, %struct.woption* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int setup_fmap_ascii(char *);
int setup(char *file_path) { return setup_fmap_ascii(file_path); }


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

x86 assembly (clang, -O2):
<setup>:
jmp    1030 <setup_fmap_ascii@plt>

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

LLVM IR (-O2):
define i32 @setup(i8* %0) {
%2 = tail call i32 @setup_fmap_ascii(i8* %0)
ret i32 %2
}
int test_imm_78uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_78uint64_lowword_reg>:
test   $0x78,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void close_resource_stream(FILE *stream) {
  if (stream != stdin && stream != stdout)
    fclose(stream);
}


x86 assembly (clang, -O0):
<close_resource_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
je     114d <close_resource_stream+0x3d>
mov    -0x8(%rbp),%rax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
je     114d <close_resource_stream+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_resource_stream>:
mov    0x2ed1(%rip),%rax
cmp    %rdi,(%rax)
je     112d <close_resource_stream+0x1d>
mov    0x2eb5(%rip),%rax
cmp    %rdi,(%rax)
je     112d <close_resource_stream+0x1d>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
define void @close_resource_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** @stdin
%5 = icmp ne i32* %3, %4
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32*, i32** @stdout
%9 = icmp ne i32* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
define void @close_resource_stream(i32* nocapture %0) {
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %2, %0
%4 = load i32*, i32** @stdout
%5 = icmp eq i32* %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
scalar_t__ COND_HI();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_shi_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_HI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_shi_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_HI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_shi_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_HI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_shi_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_HI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_shi_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_HI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
float get_load_factor() { return 9.0; }


x86 assembly (clang, -O0):
<get_load_factor>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_load_factor>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @get_load_factor() {
ret float 9.000000e+00
}

LLVM IR (-O2):
define float @get_load_factor() {
ret float 9.000000e+00
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double to_seconds(uint32_t timestamp) { return timestamp / 100.0; }


x86 assembly (clang, -O0):
<to_seconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_seconds>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_seconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+02
ret double %4
}

LLVM IR (-O2):
define double @to_seconds(double %0) {
%2 = fdiv double %0, 1.000000e+02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, char *, int);
int q_msg_queue_create(char *str, int num) {
  qprintf("*** "
          "msg_queue_create"
          "('%s', %d)\n",
          str, num);
  return 0;
}


x86 assembly (clang, -O0):
<q_msg_queue_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_msg_queue_create>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"*** msg_queue_create('%s', %d)\0A\00"
define i32 @q_msg_queue_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @qprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"*** msg_queue_create('%s', %d)\0A\00"
define i32 @q_msg_queue_create(i8* %0, i32 %1) {
%3 = tail call i32 @qprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main() {
  test("");
  test("a");
  test("ab");
  test("abc");
  test("aa");
  test("aaa");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeef(%rip),%rdi
call   1030 <test@plt>
lea    0xee2(%rip),%rdi
call   1030 <test@plt>
lea    0xecd(%rip),%rdi
call   1030 <test@plt>
lea    0xec4(%rip),%rdi
call   1030 <test@plt>
lea    0xebd(%rip),%rdi
call   1030 <test@plt>
lea    0xeb0(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <test@plt>
lea    0xee5(%rip),%rdi
call   1030 <test@plt>
lea    0xed0(%rip),%rdi
call   1030 <test@plt>
lea    0xec7(%rip),%rdi
call   1030 <test@plt>
lea    0xec0(%rip),%rdi
call   1030 <test@plt>
lea    0xeb3(%rip),%rdi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [4 x i8] c"abc\00"
@.str.4 = [3 x i8] c"aa\00"
@.str.5 = [4 x i8] c"aaa\00"
define i32 @main() {
%1 = call i32 @test(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [3 x i8] c"ab\00"
@.str.3 = [4 x i8] c"abc\00"
@.str.4 = [3 x i8] c"aa\00"
@.str.5 = [4 x i8] c"aaa\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @test(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init_server();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ process_client_connection();
int main(void) {
  init_server();
  process_client_connection();
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_server@plt>
mov    $0x0,%al
call   1050 <process_client_connection@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_server@plt>
xor    %eax,%eax
call   1050 <process_client_connection@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_server()
%2 = tail call i32 (...) @process_client_connection()
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int handler(char *msg) {
  printf("I am here in category:%s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"I am here in category:%s\0A\00"
define i32 @handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"I am here in category:%s\0A\00"
define i32 @handler(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int recv(int, void *, size_t, int /*<<< orphan*/);
int recv_info(int fd, void *buff, size_t buff_len) {
  return recv(fd, buff, buff_len, 0);
}


x86 assembly (clang, -O0):
<recv_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_info>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @recv_info(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ random2d();
main() { random2d(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @random2d()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @random2d()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int medium(int x) {
  printf("x=%d\n", x);
  return medium(x + 1);
}


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

x86 assembly (clang, -O2):
<medium>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <medium+0x10>

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

LLVM IR (-O2):
@.str = [6 x i8] c"x=%d\0A\00"
define i32 @medium(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nsw i32 %3, 1
br label %2
}
void RTPathSharedLibs(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathSharedLibs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Disable_Cursor(int);
void CwLnx_hidecursor(int fd) { Disable_Cursor(fd); }


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

x86 assembly (clang, -O2):
<CwLnx_hidecursor>:
jmp    1030 <Disable_Cursor@plt>

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

LLVM IR (-O2):
define void @CwLnx_hidecursor(i32 %0) {
%2 = tail call i32 @Disable_Cursor(i32 %0)
ret void
}
/* Variables and functions */
double vtc_get_mac_margin();
double(mr1calccoulomb_get_tree_margin__)(void) {
  return (vtc_get_mac_margin());
}


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

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

LLVM IR (-O0):
define double @mr1calccoulomb_get_tree_margin__() {
%1 = call double (...) @vtc_get_mac_margin()
ret double %1
}

LLVM IR (-O2):
define double @mr1calccoulomb_get_tree_margin__() {
%1 = tail call double (...) @vtc_get_mac_margin()
ret double %1
}
/* Variables and functions */
int render_string_ex(unsigned char *, int, int, char *, int);
int render_string(unsigned char *font, int x, int y, char *str) {
  return render_string_ex(font, x, y, str, 256);
}


x86 assembly (clang, -O0):
<render_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x100,%r8d
call   1030 <render_string_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_string>:
mov    $0x100,%r8d
jmp    1030 <render_string_ex@plt>

LLVM IR (-O0):
define i32 @render_string(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @render_string_ex(i8* %9, i32 %10, i32 %11, i8* %12, i32 256)
ret i32 %13
}

LLVM IR (-O2):
define i32 @render_string(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @render_string_ex(i8* %0, i32 %1, i32 %2, i8* %3, i32 256)
ret i32 %5
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_bool_exp(int /*<<< orphan*/, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_false_exp(unsigned loc) {
  return ({ Cyc_Absyn_bool_exp(0, loc); });
}


x86 assembly (clang, -O0):
<Cyc_Absyn_false_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <Cyc_Absyn_bool_exp@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_false_exp>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1030 <Cyc_Absyn_bool_exp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_false_exp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @Cyc_Absyn_bool_exp(i32 0, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %8
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_false_exp(i32 %0) {
%2 = tail call i32 @Cyc_Absyn_bool_exp(i32 0, i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %4
}
int flcmp_cb_inc(void *a, void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @flcmp_cb_inc(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @flcmp_cb_inc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
void *string_dup(char *);
void *trlang_rawnamenode_hook_copy(void *hook) {
  char *rawname = (char *)hook;
  if (rawname) {
    return string_dup(rawname);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<trlang_rawnamenode_hook_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <trlang_rawnamenode_hook_copy+0x31>
mov    -0x18(%rbp),%rdi
call   1030 <string_dup@plt>
mov    %rax,-0x8(%rbp)
jmp    1149 <trlang_rawnamenode_hook_copy+0x39>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trlang_rawnamenode_hook_copy>:
test   %rdi,%rdi
je     111a <trlang_rawnamenode_hook_copy+0xa>
jmp    1030 <string_dup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @trlang_rawnamenode_hook_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i8* @string_dup(i8* %9)
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* null, i8** %2
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @trlang_rawnamenode_hook_copy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @string_dup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
char *hmac224base64(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((char *)hmaccomp(224, 3, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac224base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0xe0,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac224base64>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0xe0,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac224base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 224, i32 3, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac224base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 224, i32 3, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
int always_true(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @always_true() {
ret i32 1
}

LLVM IR (-O2):
define i32 @always_true() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ IO_wait_for_interrupt();
void iddle_thread_func(void *arg) {
  (void)arg;
  while (1)
    IO_wait_for_interrupt();
}


x86 assembly (clang, -O0):
<iddle_thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <IO_wait_for_interrupt@plt>
jmp    111c <iddle_thread_func+0xc>

x86 assembly (clang, -O2):
<iddle_thread_func>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <IO_wait_for_interrupt@plt>
jmp    1120 <iddle_thread_func+0x10>

LLVM IR (-O0):
define void @iddle_thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %1, %4
%5 = call i32 (...) @IO_wait_for_interrupt()
br label %4
}

LLVM IR (-O2):
define void @iddle_thread_func(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @IO_wait_for_interrupt()
br label %2
}
/* Type definitions */
struct patron {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct patron *);
void patron_free(struct patron *p) { free(p); }


x86 assembly (clang, -O0):
<patron_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):
<patron_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.patron = type { i32 }
define void @patron_free(%struct.patron* nocapture %0) {
%2 = tail call i32 @free(%struct.patron* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j;
  while (i < 10) {
    printf("1\n");
    if (i == 1)
      break;
  }
  while (i < 20) {
    printf("2\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1149 <main+0x39>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1144 <main+0x34>
jmp    1149 <main+0x39>
jmp    111f <main+0xf>
jmp    114e <main+0x3e>
cmpl   $0x14,-0x8(%rbp)
jge    1169 <main+0x59>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <main+0x3e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void sub3(const int *i) {}


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

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

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

LLVM IR (-O2):
define void @sub3(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "%s: QUERY DOCSET_PATH\n", progname);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"%s: QUERY DOCSET_PATH\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
unsigned can_monitor_mode(const char *adapter_name) {
  if (strstr(adapter_name, "\\airpcap"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<can_monitor_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <can_monitor_mode+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <can_monitor_mode+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_monitor_mode>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\\airpcap\00"
define i32 @can_monitor_mode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"\\airpcap\00"
define i32 @can_monitor_mode(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_void_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_clear_area(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
xcb_void_cookie_t xcb_aux_clear_window(xcb_connection_t *dpy, xcb_window_t w) {
  return xcb_clear_area(dpy, 0, w, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<xcb_aux_clear_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <xcb_clear_area@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_aux_clear_window>:
push   %rax
mov    %esi,%edx
movl   $0x0,(%rsp)
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <xcb_clear_area@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xcb_aux_clear_window(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 @xcb_clear_area(i32* %5, i32 0, i32 %6, i32 0, i32 0, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xcb_aux_clear_window(i32* %0, i32 %1) {
%3 = tail call i32 @xcb_clear_area(i32* %0, i32 0, i32 %1, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int a;
  a = 42;
  printf("%d\n", a);
  int b = 64;
  printf("%d\n", b);
  int c = 12, d = 34;
  printf("%d, %d\n", c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x40,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xc,-0x10(%rbp)
movl   $0x22,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeec(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0xc,%esi
mov    $0x22,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 64)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 12, i32 34)
ret i32 0
}
void glGenTransformFeedbacks(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGenTransformFeedbacks() {
ret void
}
__attribute__((constructor)) void f(void) {
  asm("push 6845231\n"
      "push 1852400175\n"
      "mov %rsp, %rdi\n"
      "xor %rsi, %rsi\n"
      "xor %rdx, %rdx\n"
      "xor %rax, %rax\n"
      "mov $59, %al\n"
      "syscall\n"
      "inf:\n"
      "jmp inf\n");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
push   0x68732f
push   0x6e69622f
mov    %rsp,%rdi
xor    %rsi,%rsi
xor    %rdx,%rdx
xor    %rax,%rax
mov    $0x3b,%al
syscall

x86 assembly (clang, -O2):
<f>:
push   0x68732f
push   0x6e69622f
mov    %rsp,%rdi
xor    %rsi,%rsi
xor    %rdx,%rdx
xor    %rax,%rax
mov    $0x3b,%al
syscall

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }]
define void @f() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* null }]
define void @f() {
tail call void asm sideeffect "push 6845231\0Apush 1852400175\0Amov %rsp, %rdi\0Axor %rsi, %rsi\0Axor %rdx, %rdx\0Axor %rax, %rax\0Amov $$59, %al\0Asyscall\0Ainf:\0Ajmp inf\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x81() {
  Assert_real((isbdigit(129) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              650, ("isbdigit should be 0 for 0x81"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x81>:
push   %rbp
mov    %rsp,%rbp
mov    $0x81,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28a,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x81>:
push   %rax
mov    $0x81,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x28a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x81\00"
define void @t_isbdigit_0x81() {
%1 = call i64 @isbdigit(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x81\00"
define void @t_isbdigit_0x81() {
%1 = tail call i64 @isbdigit(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int isLetter(char c) {
  return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isLetter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isLetter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isLetter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((always_)) int ffs(int x) { return __builtin_ffs(x); }


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
void SCHaMOFTimes() {}


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

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

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

LLVM IR (-O2):
define void @SCHaMOFTimes() {
ret void
}
float lte_float(float a, float b) { return a <= b; }


x86 assembly (clang, -O0):
<lte_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lte_float>:
cmpless %xmm1,%xmm0
movss  0xef3(%rip),%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lte_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @lte_float(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
void c_pomp_unset_lock_(omp_lock_t *s) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @c_pomp_unset_lock_(i32* nocapture %0) {
ret void
}
/* Variables and functions */
double cos(double);
double intr_wrap_027(double p1) { return cos(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_027>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @intr_wrap_027(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}