xunge/DecIR huggingface dataset:
void gen_expr_cond(char *cond) {
  puts("cmpq %rdx, %rax");
  printf("set%d %al", cond);
  puts("movzbq %al, %rax");
}


x86 assembly (clang, -O0):
<gen_expr_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_expr_cond>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"cmpq %rdx, %rax\00"
@.str.1 = [10 x i8] c"set%d %al\00"
@.str.2 = [17 x i8] c"movzbq %al, %rax\00"
define void @gen_expr_cond(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"cmpq %rdx, %rax\00"
@.str.1 = [10 x i8] c"set%d %al\00"
@.str.2 = [17 x i8] c"movzbq %al, %rax\00"
define void @gen_expr_cond(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void job_add(void) { printf("\nEngine initialization..\n"); }


x86 assembly (clang, -O0):
<job_add>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<job_add>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AEngine initialization..\0A\00"
define void @job_add() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0AEngine initialization..\00"
define void @job_add() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double abs_float(double);
double float_abs(double f) { return abs_float(f); }


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

x86 assembly (clang, -O2):
<float_abs>:
jmp    1030 <abs_float@plt>

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

LLVM IR (-O2):
define double @float_abs(double %0) {
%2 = tail call double @abs_float(double %0)
ret double %2
}
int test3(int c) { return (c & 1) ^ 1; }


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

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
void open_ltcjack(char *autoconnect) { ; }


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

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

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

LLVM IR (-O2):
define void @open_ltcjack(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct core_instr_params {
  int dummy;
};
struct core_cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ core_cpu_i__call(struct core_cpu *,
                                    struct core_instr_params *, int);
void core_cpu_i_op_co(struct core_cpu *cpu, struct core_instr_params *p) {
  core_cpu_i__call(cpu, p, 0x04);
}


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

x86 assembly (clang, -O2):
<core_cpu_i_op_co>:
mov    $0x4,%edx
jmp    1030 <core_cpu_i__call@plt>

LLVM IR (-O0):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_co(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = alloca %struct.core_cpu*
%4 = alloca %struct.core_instr_params*
store %struct.core_cpu* %0, %struct.core_cpu** %3
store %struct.core_instr_params* %1, %struct.core_instr_params** %4
%5 = load %struct.core_cpu*, %struct.core_cpu** %3
%6 = load %struct.core_instr_params*, %struct.core_instr_params** %4
%7 = call i32 @core_cpu_i__call(%struct.core_cpu* %5, %struct.core_instr_params* %6, i32 4)
ret void
}

LLVM IR (-O2):
%struct.core_cpu = type { i32 }
%struct.core_instr_params = type { i32 }
define void @core_cpu_i_op_co(%struct.core_cpu* %0, %struct.core_instr_params* %1) {
%3 = tail call i32 @core_cpu_i__call(%struct.core_cpu* %0, %struct.core_instr_params* %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_writef_function() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_writef_function"
         "\n");
}


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

x86 assembly (clang, -O2):
<pa_sndfile_writef_function>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_sndfile_writef_function\0A\00"
define i32 @pa_sndfile_writef_function() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_sndfile_writef_function\00"
define i32 @pa_sndfile_writef_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x8c() {
  Assert_real((isdigit(140) == 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_isdigit.c",
              705, ("isdigit should be 0 for 0x8c"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8c\00"
define void @t_isdigit_0x8c() {
%1 = call i64 @isdigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8c\00"
define void @t_isdigit_0x8c() {
%1 = tail call i64 @isdigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ym2151_state_save_register(int numchips) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void help(FILE *f, const char *argv0) {
  fprintf(f,
          "call: %s CMD ARGV0 [ARGV1]...\n"
          "\n"
          "Execute command with a non-default ARGV[0] value.\n"
          "\n"
          "Standalone replacement for e.g.:\n"
          "\n"
          "    bash -c 'exec -a ARGV0 CMD ARGV1'\n"
          "\n",
          argv0);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [156 x i8] c"call: %s CMD ARGV0 [ARGV1]...\0A\0AExecute command with a non-default ARGV[0] value.\0A\0AStandalone replacement for e.g.:\0A\0A bash -c 'exec -a ARGV0 CMD ARGV1'\0A\0A\00"
define void @help(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [156 x i8] c"call: %s CMD ARGV0 [ARGV1]...\0A\0AExecute command with a non-default ARGV[0] value.\0A\0AStandalone replacement for e.g.:\0A\0A bash -c 'exec -a ARGV0 CMD ARGV1'\0A\0A\00"
define void @help(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int is_num(char c) {
  if (c > 47 && c < 58)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jle    1130 <is_num+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
jge    1130 <is_num+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_num+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 47
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 58
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double fmod(double, int);
double lonmod(double lon) {
  lon = fmod(lon, 360);
  if (lon < -180)
    lon += 360;
  if (lon > 180)
    lon -= 360;
  return lon;
}


x86 assembly (clang, -O0):
<lonmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x168,%edi
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xec7(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1156 <lonmod+0x46>
movsd  0xebc(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1183 <lonmod+0x73>
movsd  -0x8(%rbp),%xmm0
movsd  0xe8e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lonmod>:
push   %rax
mov    $0x168,%edi
call   1030 <fmod@plt>
movsd  0xedd(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xed4(%rip),%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movsd  0xec8(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xec4(%rip),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lonmod(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, i32 360)
store double %4, double* %2
%5 = load double, double* %2
%6 = fcmp olt double %5, -1.800000e+02
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fadd double %8, 3.600000e+02
store double %9, double* %2
br label %10
10: ; preds = %7, %1
%11 = load double, double* %2
%12 = fcmp ogt double %11, 1.800000e+02
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fsub double %14, 3.600000e+02
store double %15, double* %2
br label %16
16: ; preds = %13, %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @lonmod(double %0) {
%2 = tail call double @fmod(double %0, i32 360)
%3 = fcmp olt double %2, -1.800000e+02
%4 = fadd double %2, 3.600000e+02
%5 = select i1 %3, double %4, double %2
%6 = fcmp ogt double %5, 1.800000e+02
%7 = fadd double %5, -3.600000e+02
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ XPropertyEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XPropertyEvent(void) {
  XPropertyEvent *_p = (XPropertyEvent *)malloc(sizeof(XPropertyEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XPropertyEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XPropertyEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XPropertyEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XPropertyEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XPropertyEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XPropertyEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void crazyflie_step(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ rbuf_putc(struct ringbuf *, char);
void rbuf_nputc(struct ringbuf *r, int n, char ch) {
  while (n-- > 0)
    rbuf_putc(r, ch);
}


x86 assembly (clang, -O0):
<rbuf_nputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    114a <rbuf_nputc+0x3a>
mov    -0x8(%rbp),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <rbuf_putc@plt>
jmp    1124 <rbuf_nputc+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbuf_nputc>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <rbuf_nputc+0x32>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
movsbl %dl,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <rbuf_putc@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <rbuf_nputc+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ringbuf = type { i32 }
define void @rbuf_nputc(%struct.ringbuf* %0, i32 %1, i8 signext %2) {
%4 = alloca %struct.ringbuf*
%5 = alloca i32
%6 = alloca i8
store %struct.ringbuf* %0, %struct.ringbuf** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %5
%9 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load %struct.ringbuf*, %struct.ringbuf** %4
%13 = load i8, i8* %6
%14 = call i32 @rbuf_putc(%struct.ringbuf* %12, i8 signext %13)
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.ringbuf = type { i32 }
define void @rbuf_nputc(%struct.ringbuf* %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %1, %3 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @rbuf_putc(%struct.ringbuf* %0, i8 signext %2)
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
int signum_i_ex(float a, float eps) {
  if (a > eps)
    return 1;
  if (a < -eps)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<signum_i_ex>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1129 <signum_i_ex+0x29>
movl   $0x1,-0x4(%rbp)
jmp    115c <signum_i_ex+0x5c>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
ucomiss %xmm1,%xmm0
jbe    1155 <signum_i_ex+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <signum_i_ex+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_i_ex>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm1,%xmm2
xor    %ecx,%ecx
ucomiss %xmm0,%xmm2
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @signum_i_ex(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = fneg float %1
%5 = fcmp ogt float %4, %0
%6 = sext i1 %5 to i32
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
int foo() {
  int i;
#pragma omp parallel for
  for (i = 0; i < 10; ++i)
    return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111c <foo+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Type definitions */
struct predicate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
bool pred_exit(const char *path, int flags, struct predicate *pred) {
  exit(0);
  return true;
}


x86 assembly (clang, -O0):
<pred_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<pred_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.predicate = type { i32 }
define i32 @pred_exit(i8* %0, i32 %1, %struct.predicate* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.predicate*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.predicate* %2, %struct.predicate** %6
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.predicate = type { i32 }
define i32 @pred_exit(i8* nocapture readnone %0, i32 %1, %struct.predicate* nocapture readnone %2) {
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ isASCIIHexDigit(unsigned short);
int toASCIIHexValue(unsigned short c) {
  ASSERT(isASCIIHexDigit(c));
  return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF;
}


x86 assembly (clang, -O0):
<toASCIIHexValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <isASCIIHexDigit@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
movzwl -0x2(%rbp),%eax
cmp    $0x41,%eax
jge    115b <toASCIIHexValue+0x3b>
movzwl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <toASCIIHexValue+0x4b>
movzwl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toASCIIHexValue>:
push   %rbx
mov    %edi,%ebx
call   1040 <isASCIIHexDigit@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
lea    -0x30(%rbx),%ecx
mov    %ebx,%eax
add    $0x9,%eax
and    $0xf,%eax
cmp    $0x41,%bx
cmovb  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toASCIIHexValue(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @isASCIIHexDigit(i16 zeroext %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = icmp slt i32 %7, 65
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = sub nsw i32 %11, 48
br label %19
13: ; preds = %1
%14 = load i16, i16* %2
%15 = zext i16 %14 to i32
%16 = sub nsw i32 %15, 65
%17 = add nsw i32 %16, 10
%18 = and i32 %17, 15
br label %19
19: ; preds = %13, %9
%20 = phi i32 [ %12, %9 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @toASCIIHexValue(i16 zeroext %0) {
%2 = tail call i32 @isASCIIHexDigit(i16 zeroext %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = zext i16 %0 to i32
%5 = icmp ult i16 %0, 65
%6 = add nsw i32 %4, -48
%7 = add nuw nsw i32 %4, 9
%8 = and i32 %7, 15
%9 = select i1 %5, i32 %6, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int /*<<< orphan*/ *gets(char *);
int main() {
  char sz[1024] = {'\0'};
  while (gets(sz) != NULL) {
    f(sz);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     117c <main+0x4c>
lea    -0x410(%rbp),%rdi
call   1030 <f@plt>
jmp    1155 <main+0x25>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     1175 <main+0x45>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = bitcast [1024 x i8]* %2 to i8*
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i32* @gets(i8* %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 @f(i8* %9)
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32* @gets(i8* %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @f(i8* %2)
%7 = call i32* @gets(i8* %2)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_60() {
  Assert_real((isqrt(60) == 7),
              "/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/stdlib/isqrt.c",
              305, ("Integer square root of 60 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x131,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_60>:
push   %rax
mov    $0x3c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x131,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 60 should be 7\00"
define void @t_sqrt_60() {
%1 = call i32 @isqrt(i32 60)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 60 should be 7\00"
define void @t_sqrt_60() {
%1 = tail call i32 @isqrt(i32 60)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_388() { return 388; }


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

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

LLVM IR (-O0):
define i32 @do_388() {
ret i32 388
}

LLVM IR (-O2):
define i32 @do_388() {
ret i32 388
}
char *concatenatestring(s1, s2)
char *s1;
char *s2;
{
  char *p;
  p = (char *)checkmalloc(strlen(s1) + strlen(s2) + 1);
  snprintf(p, sizeof p, "%s%s", s1, s2);
  return p;
}


x86 assembly (clang, -O0):
<concatenatestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1030 <checkmalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x8,%esi
lea    0xe7a(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenatestring>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
xor    %eax,%eax
call   1030 <checkmalloc@plt>
movslq %eax,%rbx
lea    0xe9c(%rip),%rdx
mov    $0x8,%esi
mov    %rbx,%rdi
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @concatenatestring(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 1
%12 = call i32 (i64, ...) bitcast (i32 (...)* @checkmalloc to i32 (i64, ...)*)(i64 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %15, i64 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @concatenatestring(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i32 (i64, ...) bitcast (i32 (...)* @checkmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) %9, i64 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int);
int /*<<< orphan*/ stderr;
void CaseException(const char *s, unsigned int high, unsigned int lineno) {
  fprintf(stderr, "%s:%d:case statement has no matching selection\n", s,
          lineno);
  _exit(1);
}


x86 assembly (clang, -O0):
<CaseException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<CaseException>:
push   %rax
mov    %edx,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"%s:%d:case statement has no matching selection\0A\00"
define void @CaseException(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"%s:%d:case statement has no matching selection\0A\00"
define void @CaseException(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
%6 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int sleep(int);
int slp(int n) { return sleep(n); }


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

x86 assembly (clang, -O2):
<slp>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define i32 @slp(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelDisable(uint32_t ui32Base, uint32_t ui32ChannelNum) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000002C))) = 1 << ui32ChannelNum;
}


x86 assembly (clang, -O0):
<uDMAChannelDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelDisable>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
movslq %edi,%rcx
mov    %rax,0x2c(%rcx)
ret

LLVM IR (-O0):
define void @uDMAChannelDisable(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 = shl i32 1, %5
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 44
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @uDMAChannelDisable(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = add nsw i32 %0, 44
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int tcflush(int, int /*<<< orphan*/);
int term_find(int);
int term_flush(int fd) {
  int rval, r;
  rval = 0;
  do {
    r = term_find(fd);
    if (r < 0) {
      rval = -1;
      break;
    }
    r = tcflush(fd, TCIOFLUSH);
    if (r < 0) {
      rval = -1;
      break;
    }
  } while (0);
  return rval;
}


x86 assembly (clang, -O0):
<term_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <term_find@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1153 <term_flush+0x33>
movl   $0xffffffff,-0x8(%rbp)
jmp    1182 <term_flush+0x62>
mov    -0x4(%rbp),%edi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1040 <tcflush@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    117d <term_flush+0x5d>
movl   $0xffffffff,-0x8(%rbp)
jmp    1182 <term_flush+0x62>
jmp    1182 <term_flush+0x62>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_flush>:
push   %rbx
mov    %edi,%ebx
call   1030 <term_find@plt>
test   %eax,%eax
js     1141 <term_flush+0x21>
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <tcflush@plt>
sar    $0x1f,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define i32 @term_flush(i32 %0) {
%2 = tail call i32 @term_find(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @TCIOFLUSH
%6 = tail call i32 @tcflush(i32 %0, i32 %5)
%7 = ashr i32 %6, 31
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
unsigned int BKDRHash(const char *str) {
  unsigned int seed = 131;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * seed + (*str++);
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x83,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <BKDRHash+0x46>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <BKDRHash+0x16>
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <BKDRHash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int *);
int /*<<< orphan*/ h264nal_set_type(int *, int);
void h264aud_init(uint8_t *p_h264aud) {
  h264nal_init(p_h264aud);
  h264nal_set_type(p_h264aud, 9);
  p_h264aud[4] = 0x10;
}


x86 assembly (clang, -O0):
<h264aud_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x9,%esi
call   1030 <h264nal_set_type@plt>
mov    -0x8(%rbp),%rax
movl   $0x10,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264aud_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <h264nal_set_type@plt>
movl   $0x10,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @h264aud_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_type(i32* %5, i32 9)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32 16, i32* %8
ret void
}

LLVM IR (-O2):
define void @h264aud_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_type(i32* %0, i32 9)
%4 = getelementptr inbounds i32, i32* %0, i64 4
store i32 16, i32* %4
ret void
}
int _search(int n, int Traversal[n], int start, int end, int value) {
  for (int i = start; i <= end; i++) {
    if (Traversal[i] == value) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<_search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1159 <_search+0x59>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    1146 <_search+0x46>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <_search+0x60>
jmp    114b <_search+0x4b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111b <_search+0x1b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_search>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jg     1130 <_search+0x30>
movslq %edx,%rdi
add    $0x1,%ecx
lea    (%rsi,%rdi,4),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %r8d,(%rsi)
je     1131 <_search+0x31>
add    $0x1,%edx
add    $0x4,%rsi
cmp    %edx,%ecx
jne    1120 <_search+0x20>
ret
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_search(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%13 = load i32, i32* %7
%14 = zext i32 %13 to i64
%15 = load i32, i32* %9
store i32 %15, i32* %12
br label %16
16: ; preds = %31, %5
%17 = load i32, i32* %12
%18 = load i32, i32* %10
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = load i32*, i32** %8
%22 = load i32, i32* %12
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %11
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %20
%29 = load i32, i32* %12
store i32 %29, i32* %6
br label %35
30: ; preds = %20
br label %31
31: ; preds = %30
%32 = load i32, i32* %12
%33 = add nsw i32 %32, 1
store i32 %33, i32* %12
br label %16
34: ; preds = %16
store i32 -1, i32* %6
br label %35
35: ; preds = %34, %28
%36 = load i32, i32* %6
ret i32 %36
}

LLVM IR (-O2):
define i32 @_search(i32 %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %2, %3
br i1 %6, label %21, label %7
7: ; preds = %5
%8 = sext i32 %2 to i64
%9 = add i32 %3, 1
br label %10
10: ; preds = %7, %15
%11 = phi i64 [ %8, %7 ], [ %16, %15 ]
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %4
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = add nsw i64 %11, 1
%17 = trunc i64 %16 to i32
%18 = icmp eq i32 %9, %17
br i1 %18, label %21, label %10
19: ; preds = %10
%20 = trunc i64 %11 to i32
br label %21
21: ; preds = %15, %19, %5
%22 = phi i32 [ -1, %5 ], [ %20, %19 ], [ -1, %15 ]
ret i32 %22
}
/* Variables and functions */
double quakap_(double *, double *);
double cquakap(double *f, double *para) { return quakap_(f, para); }


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

x86 assembly (clang, -O2):
<cquakap>:
jmp    1030 <quakap_@plt>

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

LLVM IR (-O2):
define double @cquakap(double* %0, double* %1) {
%3 = tail call double @quakap_(double* %0, double* %1)
ret double %3
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void print_timeofday() {
  struct timeval t;
  gettimeofday(&t, NULL);
  printf("%ld.%ld\n", t.tv_sec, t.tv_usec);
}


x86 assembly (clang, -O0):
<print_timeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timeofday>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [9 x i8] c"%ld.%ld\0A\00"
define void @print_timeofday() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [9 x i8] c"%ld.%ld\0A\00"
define void @print_timeofday() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setregid(int /*<<< orphan*/, int /*<<< orphan*/);
int pthread_setregid_np(gid_t rgid, gid_t egid) { return setregid(rgid, egid); }


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

x86 assembly (clang, -O2):
<pthread_setregid_np>:
jmp    1030 <setregid@plt>

LLVM IR (-O0):
define i32 @pthread_setregid_np(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 @setregid(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_setregid_np(i32 %0, i32 %1) {
%3 = tail call i32 @setregid(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_945gm(uint32_t devid, uint32_t pch) {
  return ((devid) == 0x27A2 || (devid) == 0x27AE);
}


x86 assembly (clang, -O0):
<is_945gm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x27a2,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1129 <is_945gm+0x29>
cmpl   $0x27ae,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_945gm>:
cmp    $0x27a2,%edi
sete   %al
cmp    $0x27ae,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_945gm(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 = icmp eq i32 %5, 10146
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 10158
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_945gm(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 10146
%4 = icmp eq i32 %0, 10158
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}