xunge/DecIR huggingface dataset:
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("factorial(%d) = %d\n", 5, factorial(5));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <factorial@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"factorial(%d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
/* Variables and functions */
int f170(int *);
int f171(int *p) { return f170(p); }


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

x86 assembly (clang, -O2):
<f171>:
jmp    1030 <f170@plt>

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

LLVM IR (-O2):
define i32 @f171(i32* %0) {
%2 = tail call i32 @f170(i32* %0)
ret i32 %2
}
void UARTIdleModeConfigure(unsigned int baseAdd, unsigned int modeFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x54)))) &= ~((0x00000018u));
  (*((volatile unsigned int *)(baseAdd + (0x54)))) |=
      (modeFlag & (0x00000018u));
}


x86 assembly (clang, -O0):
<UARTIdleModeConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffe7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x18,%edx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIdleModeConfigure>:
add    $0x54,%edi
andl   $0xffffffe7,(%rdi)
and    $0x18,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTIdleModeConfigure(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 = add i32 %5, 84
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -25
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 24
%13 = load i32, i32* %3
%14 = add i32 %13, 84
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTIdleModeConfigure(i32 %0, i32 %1) {
%3 = add i32 %0, 84
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -25
store volatile i32 %7, i32* %5
%8 = and i32 %1, 24
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_standard_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(759, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @read_standard_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 759, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_operational_state(int ifindex, char **state) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_operational_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_operational_state>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_operational_state(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_operational_state(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _octal2str(long, char *);
char *octal2str(long val, char *out) {
  _octal2str(val, out);
  return out;
}


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

x86 assembly (clang, -O2):
<octal2str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <_octal2str@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @octal2str(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = call i32 @_octal2str(i64 %5, i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @octal2str(i64 %0, i8* returned %1) {
%3 = tail call i32 @_octal2str(i64 %0, i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *skey_usage();
void skey_showusage() { printf("usage : skey %s", skey_usage()); }


x86 assembly (clang, -O0):
<skey_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <skey_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skey_showusage>:
push   %rax
xor    %eax,%eax
call   1030 <skey_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"usage : skey %s\00"
define void @skey_showusage() {
%1 = call i8* (...) @skey_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"usage : skey %s\00"
define void @skey_showusage() {
%1 = tail call i8* (...) @skey_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
double derive_step(double x) { return 1.0; }


x86 assembly (clang, -O0):
<derive_step>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @derive_step(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @derive_step(double %0) {
ret double 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr, "usage: csvunpipe [OPTIONS] [FILE]");
  fprintf(stderr, "options:");
  fprintf(stderr, "-p header,row,to,print\n");
  fprintf(stderr, "  Header row to print first\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: csvunpipe [OPTIONS] [FILE]\00"
@.str.1 = [9 x i8] c"options:\00"
@.str.2 = [24 x i8] c"-p header,row,to,print\0A\00"
@.str.3 = [29 x i8] c" Header row to print first\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: csvunpipe [OPTIONS] [FILE]\00"
@.str.1 = [9 x i8] c"options:\00"
@.str.2 = [24 x i8] c"-p header,row,to,print\0A\00"
@.str.3 = [29 x i8] c" Header row to print first\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void proc_call_2(int p0, int p1) {}


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

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

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

LLVM IR (-O2):
define void @proc_call_2(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hallo mein Feind\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Hallo mein Feind\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_w32(int);
int rd_rn_rm(int, int, int /*<<< orphan*/);
void emit_jno_unlikely(int a) {
  assem_debug("addvc pc,pc,#? (%x)", a);
  output_w32(0x72800000 | rd_rn_rm(15, 15, 0));
}


x86 assembly (clang, -O0):
<emit_jno_unlikely>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xf,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <rd_rn_rm@plt>
mov    %eax,%edi
or     $0x72800000,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_jno_unlikely>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xf,%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1050 <rd_rn_rm@plt>
or     $0x72800000,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"addvc pc,pc,#? (%x)\00"
define void @emit_jno_unlikely(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @rd_rn_rm(i32 15, i32 15, i32 0)
%6 = or i32 1920991232, %5
%7 = call i32 @output_w32(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"addvc pc,pc,#? (%x)\00"
define void @emit_jno_unlikely(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @rd_rn_rm(i32 15, i32 15, i32 0)
%4 = or i32 %3, 1920991232
%5 = tail call i32 @output_w32(i32 %4)
ret void
}
char *RCSid() {
  return RCSid("$Id: readline.c,v 1.58 2011/09/04 12:01:37 markisch Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: readline.c,v 1.58 2011/09/04 12:01:37 markisch Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void DPMSInfo() {}


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

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

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

LLVM IR (-O2):
define void @DPMSInfo() {
ret void
}
/* Variables and functions */
unsigned int cpu_get_stack_value(unsigned int);
unsigned int read_5200_stack(unsigned int addr) {
  return cpu_get_stack_value(addr & 0xff);
}


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

x86 assembly (clang, -O2):
movzbl %dil,%edi
jmp    1030 <cpu_get_stack_value@plt>

LLVM IR (-O0):
define i32 @read_5200_stack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @cpu_get_stack_value(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @read_5200_stack(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @cpu_get_stack_value(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *,
                      unsigned int *);
int g_tcp_socket_ok(int sck) {
  int opt;
  unsigned int opt_len;
  opt_len = sizeof(opt);
  if (getsockopt(sck, SOL_SOCKET, SO_ERROR, (char *)(&opt), &opt_len) == 0) {
    if (opt == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<g_tcp_socket_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
jne    1169 <g_tcp_socket_ok+0x59>
cmpl   $0x0,-0xc(%rbp)
jne    1164 <g_tcp_socket_ok+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1170 <g_tcp_socket_ok+0x60>
jmp    1169 <g_tcp_socket_ok+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_tcp_socket_ok>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
test   %rax,%rax
sete   %al
cmpl   $0x0,0x4(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @g_tcp_socket_ok(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_ERROR
%9 = bitcast i32* %4 to i8*
%10 = call i64 @getsockopt(i32 %6, i32 %7, i32 %8, i8* %9, i32* %5)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %2
br label %18
16: ; preds = %12
br label %17
17: ; preds = %16, %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @g_tcp_socket_ok(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i32* %3)
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int O_EXCL;
int O_NONBLOCK;
int delete_module(char const *, int);
int manual_rmmod(const char *name) {
  return delete_module(name, O_NONBLOCK | O_EXCL);
}


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

x86 assembly (clang, -O2):
<manual_rmmod>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <delete_module@plt>

LLVM IR (-O0):
@O_NONBLOCK = global i32 0
@O_EXCL = global i32 0
define i32 @manual_rmmod(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_NONBLOCK
%5 = load i32, i32* @O_EXCL
%6 = or i32 %4, %5
%7 = call i32 @delete_module(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
@O_EXCL = global i32 0
define i32 @manual_rmmod(i8* %0) {
%2 = load i32, i32* @O_NONBLOCK
%3 = load i32, i32* @O_EXCL
%4 = or i32 %3, %2
%5 = tail call i32 @delete_module(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, eCos world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello, eCos world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello, eCos world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int bam_is_big_endian() {
  long one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<bam_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bam_is_big_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bam_is_big_endian() {
ret i32 0
}
/* Variables and functions */
int d32(int);
int d33(int a) { return d32(d32(a)); }


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

x86 assembly (clang, -O2):
<d33>:
push   %rax
call   1030 <d32@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d32@plt>

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

LLVM IR (-O2):
define i32 @d33(i32 %0) {
%2 = tail call i32 @d32(i32 %0)
%3 = tail call i32 @d32(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_umod(void) {
  gen_pop();
  gen_call("_umod");
}


x86 assembly (clang, -O0):
<gen_umod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_umod>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"_umod\00"
define void @gen_umod() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"_umod\00"
define void @gen_umod() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int runVm(int, char **);
int main(int argc, char **argv) { return runVm(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <runVm@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @runVm(i32 %0, i8** %1)
ret i32 %3
}
float g(float x) { return x * (x >= 0.f ? -1.f : 1.f); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xee5(%rip),%xmm4
movss  0xee1(%rip),%xmm3
xorps  %xmm1,%xmm1
cmpless %xmm2,%xmm1
movaps %xmm1,%xmm2
andps  %xmm4,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cmpless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, float -1.000000e+00, float 1.000000e+00
%8 = fmul float %3, %7
ret float %8
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void eglSwapInterval(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglSwapInterval() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x76() {
  Assert_real((isdigit(118) == 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",
              595, ("isdigit should be 0 for v"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x76>:
push   %rax
mov    $0x76,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x253,%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 = [26 x i8] c"isdigit should be 0 for v\00"
define void @t_isdigit_0x76() {
%1 = call i64 @isdigit(i32 118)
%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 595, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isdigit should be 0 for v\00"
define void @t_isdigit_0x76() {
%1 = tail call i64 @isdigit(i32 118)
%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 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc1(int status, void *arg) {
  printf("Executing exitfunc"
         "1"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc1>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc1 (status=%d, arg=%lu)\0A\00"
define void @exitfunc1(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 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc1 (status=%d, arg=%lu)\0A\00"
define void @exitfunc1(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
void ScaleRowDown34_0_Box_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_0_Box_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgnot(void) { gen("notl\t%eax"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"notl\09%eax\00"
define void @cgnot() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"notl\09%eax\00"
define void @cgnot() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int mdrv_sd_at_process(unsigned int type, unsigned int addr,
                                unsigned int data, unsigned char *buf,
                                unsigned int *err) {
  return 0;
}


x86 assembly (clang, -O0):
<mdrv_sd_at_process>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mdrv_sd_at_process(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @mdrv_sd_at_process(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
int climb(int n) {
  int res = 0;
  if (n <= 1) {
    return 1;
  }
  res = climb(n - 1) + climb(n - 2);
  return res;
}


x86 assembly (clang, -O0):
<climb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1138 <climb+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1161 <climb+0x51>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <climb@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <climb@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<climb>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <climb+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <climb@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <climb+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @climb(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @climb(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_data_bus_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 32);
}


x86 assembly (clang, -O0):
<hea_cq_aer_data_bus_err_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x20,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_cq_aer_data_bus_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x20,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_data_bus_err_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 32)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_data_bus_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 32)
store i32 %3, i32* %0
ret void
}
unsigned int ht_stringhash(void *ky) {
  char *p = ky;
  unsigned int hash = 5381;
  int c;
  while ((c = *p++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<ht_stringhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1149 <ht_stringhash+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ht_stringhash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_stringhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <ht_stringhash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <ht_stringhash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @ht_stringhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int close(int);
int sendfile_aes_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<sendfile_aes_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @sendfile_aes_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int log_erro(char *msg, char *sensor) {}


x86 assembly (clang, -O0):
<log_erro>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @log_erro(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ chk_curs_draw();
void curs_attrset(long at) {
  if (!chk_curs_draw())
    return;
}


x86 assembly (clang, -O0):
<curs_attrset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <chk_curs_draw@plt>
cmp    $0x0,%eax
jne    1131 <curs_attrset+0x21>
jmp    1131 <curs_attrset+0x21>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @curs_attrset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @chk_curs_draw()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @curs_attrset(i64 %0) {
%2 = tail call i32 (...) @chk_curs_draw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Done");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"Done\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ directory_exists(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void get_library_path(char *path) {
  if (directory_exists("/usr/lib64") != 0) {
    sprintf(path, "%s", "lib64");
    return;
  }
  sprintf(path, "%s", "lib");
}


x86 assembly (clang, -O0):
<get_library_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <directory_exists@plt>
cmp    $0x0,%rax
je     115e <get_library_path+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
lea    0xeb1(%rip),%rdx
call   1040 <sprintf@plt>
jmp    1175 <get_library_path+0x55>
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
lea    0xe9e(%rip),%rdx
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_library_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <directory_exists@plt>
test   %rax,%rax
je     1133 <get_library_path+0x23>
movw   $0x34,0x4(%rbx)
movl   $0x3662696c,(%rbx)
pop    %rbx
ret
movl   $0x62696c,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"/usr/lib64\00"
@.str.2 = [6 x i8] c"lib64\00"
define void @get_library_path(i8* nocapture writeonly %0) {
%2 = tail call i64 @directory_exists(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 6, i1 false)
br label %7
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
store i32 6449516, i32* %6
br label %7
7: ; preds = %5, %4
ret void
}
int ft_strlen(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ft_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double wy2u01(uint64_t r) {
  const double _wynorm = 1.0 / (1ull << 52);
  return (r >> 12) * _wynorm;
}


x86 assembly (clang, -O0):
<wy2u01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wy2u01>:
sar    $0xc,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wy2u01(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0x3CB0000000000000, double* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 12
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3CB0000000000000
ret double %7
}

LLVM IR (-O2):
define double @wy2u01(i32 %0) {
%2 = ashr i32 %0, 12
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CB0000000000000
ret double %4
}
void ff_hevc_put_hevc_uni_epel_v24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int tputchar(int c) {
  putchar(c);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tputchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ bucket_sort(int *, int);
int /*<<< orphan*/ dump(int *, int);
int /*<<< orphan*/ printf(char *);
void bucket_sort_test() {
  int a[] = {78, 17, 39, 26, 72, 94, 21, 12, 23, 91};
  int size = sizeof(a) / sizeof(int);
  printf("\r\n bucket sort test ...");
  bucket_sort(a, size);
  dump(a, size);
}


x86 assembly (clang, -O0):
<bucket_sort_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <bucket_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <dump@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bucket_sort_test>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <bucket_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <dump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.bucket_sort_test.a = [10 x i32] [i32 78, i32 17, i32 39, i32 26, i32 72, i32 94, i32 21, i32 12, i32 23, i32 91]
@.str = [24 x i8] c"\0D\0A bucket sort test ...\00"
define void @bucket_sort_test() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
store i32 10, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @bucket_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @dump(i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@__const.bucket_sort_test.a = [10 x i32] [i32 78, i32 17, i32 39, i32 26, i32 72, i32 94, i32 21, i32 12, i32 23, i32 91]
@.str = [24 x i8] c"\0D\0A bucket sort test ...\00"
define void @bucket_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @bucket_sort(i32* %4, i32 10)
%6 = call i32 @dump(i32* %4, i32 10)
ret void
}