xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ load_pml4();
int /*<<< orphan*/ store_pml4(int /*<<< orphan*/);
void flush_tlb(void) { store_pml4(load_pml4()); }


x86 assembly (clang, -O0):
<flush_tlb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <load_pml4@plt>
mov    %eax,%edi
call   1030 <store_pml4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_tlb>:
push   %rax
xor    %eax,%eax
call   1040 <load_pml4@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <store_pml4@plt>

LLVM IR (-O0):
define void @flush_tlb() {
%1 = call i32 (...) @load_pml4()
%2 = call i32 @store_pml4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @flush_tlb() {
%1 = tail call i32 (...) @load_pml4()
%2 = tail call i32 @store_pml4(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dvm_print_wcs(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int dvm_print_wcs_ln(FILE *fp, wchar_t *wcs) {
  int result = dvm_print_wcs(fp, wcs);
  fprintf(fp, "\n");
  return result;
}


x86 assembly (clang, -O0):
<dvm_print_wcs_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <dvm_print_wcs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvm_print_wcs_ln>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <dvm_print_wcs@plt>
mov    %eax,%ebp
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dvm_print_wcs_ln(i32* %0, i32* %1) {
%3 = tail call i32 @dvm_print_wcs(i32* %0, i32* %1)
%4 = tail call i32 @fputc(i32 10, i32* %0)
ret i32 %3
}
void panic_notify(unsigned long UNUSED_rc __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @panic_notify(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ peasoup(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int turn;
  turn = 13;
  peasoup(&turn);
  printf("Ohh no, its %d again", turn);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <peasoup@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xd,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <peasoup@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Ohh no, its %d again\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
%3 = call i32 @peasoup(i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Ohh no, its %d again\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 13, i32* %1
%3 = call i32 @peasoup(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void nocash() {
  lprcat("\nWhattaya trying to pull on me? You aint got the cash!");
  lflush();
  nap(1200);
}


x86 assembly (clang, -O0):
<nocash>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x4b0,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocash>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x4b0,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"\0AWhattaya trying to pull on me? You aint got the cash!\00"
define void @nocash() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 1200)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"\0AWhattaya trying to pull on me? You aint got the cash!\00"
define void @nocash() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 1200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gl2psPrintGzipFooter();
int /*<<< orphan*/ gl2psPrintf(char *);
void gl2psPrintPostScriptFooter(void) {
  gl2psPrintf("grestore\n"
              "showpage\n"
              "cleartomark\n"
              "%%%%PageTrailer\n"
              "%%%%Trailer\n"
              "end\n"
              "%%%%EOF\n");
  gl2psPrintGzipFooter();
}


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

x86 assembly (clang, -O2):
<gl2psPrintPostScriptFooter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <gl2psPrintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gl2psPrintGzipFooter@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"grestore\0Ashowpage\0Acleartomark\0A%%%%PageTrailer\0A%%%%Trailer\0Aend\0A%%%%EOF\0A\00"
define void @gl2psPrintPostScriptFooter() {
%1 = call i32 @gl2psPrintf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gl2psPrintGzipFooter()
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"grestore\0Ashowpage\0Acleartomark\0A%%%%PageTrailer\0A%%%%Trailer\0Aend\0A%%%%EOF\0A\00"
define void @gl2psPrintPostScriptFooter() {
%1 = tail call i32 @gl2psPrintf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @gl2psPrintGzipFooter()
ret void
}
void sel_ib_pkey_flush(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sel_ib_pkey_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void usage(void) { errx(-1, "usage: sigpipe tcpport"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0xffffffff,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: sigpipe tcpport\00"
define void @usage() {
%1 = call i32 @errx(i32 -1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: sigpipe tcpport\00"
define void @usage() {
%1 = tail call i32 @errx(i32 -1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_5Duint16_reg(unsigned short val) {
  return ((val) & (0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x5d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 93
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int open(char const *const, int const, int const);
int our_open(const char *const path, const int flags, const int mode) {
  do {
    const int fd = open(path, flags, mode);
    if (fd != -1) {
      return fd;
    }
  } while (errno == EINTR);
  return -1;
}


x86 assembly (clang, -O0):
<our_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
je     1149 <our_open+0x39>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <our_open+0x5f>
jmp    114e <our_open+0x3e>
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
mov    0x2e79(%rip),%rcx
cmp    (%rcx),%rax
je     1122 <our_open+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<our_open>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <open@plt>
cmp    $0xffffffff,%eax
jne    114b <our_open+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <our_open+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @our_open(i8* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
/* Variables and functions */
int M_PI;
double rpm_of_radps(double rps) { return (rps / (2 * M_PI) * 60); }


x86 assembly (clang, -O0):
<rpm_of_radps>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpm_of_radps>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @rpm_of_radps(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = mul nsw i32 2, %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %3, %6
%8 = fmul double %7, 6.000000e+01
ret double %8
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @rpm_of_radps(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double %0, %4
%6 = fmul double %5, 6.000000e+01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tflush aname\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: tflush aname\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: tflush aname\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char do_is_balanced(char const **);
bool is_balanced(const char *string) { return do_is_balanced(&string) == '\0'; }


x86 assembly (clang, -O0):
<is_balanced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <do_is_balanced@plt>
movsbl %al,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_balanced>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <do_is_balanced@plt>
xor    %ecx,%ecx
test   %al,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_balanced(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call signext i8 @do_is_balanced(i8** %2)
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_balanced(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call signext i8 @do_is_balanced(i8** %2)
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int set_standard_state_to_silent(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(39, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<set_standard_state_to_silent>:
mov    $0x27,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @set_standard_state_to_silent() {
%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_c2phc4c(i32 39, 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 @set_standard_state_to_silent() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 39, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct sched_param {
  scalar_t__ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}


x86 assembly (clang, -O0):
<set_default_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_priority>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @set_default_priority() {
%1 = alloca %struct.sched_param
%2 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @SCHED_OTHER
%5 = call i32 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @set_default_priority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%4 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i64 0, i64* %4
%5 = load i32, i32* @SCHED_OTHER
%6 = call i32 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %1)
ret void
}
int KeyToKeycode(int Key) {
  return (Key >= 0x80) ? (Key - 0x80) | (1 << 30) : Key;
}


x86 assembly (clang, -O0):
<KeyToKeycode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jl     1129 <KeyToKeycode+0x29>
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
or     $0x40000000,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <KeyToKeycode+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeyToKeycode>:
lea    -0x80(%rdi),%eax
or     $0x40000000,%eax
cmp    $0x7f,%edi
cmovle %edi,%eax
ret

LLVM IR (-O0):
define i32 @KeyToKeycode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 128
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 128
%8 = or i32 %7, 1073741824
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @KeyToKeycode(i32 %0) {
%2 = icmp sgt i32 %0, 127
%3 = add nsw i32 %0, -128
%4 = or i32 %3, 1073741824
%5 = select i1 %2, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
struct _stor_fmoveto_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fmoveto_rsp *);
void stor_fmoveto_rsp_free(struct _stor_fmoveto_rsp *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
%struct._stor_fmoveto_rsp = type { i32 }
define void @stor_fmoveto_rsp_free(%struct._stor_fmoveto_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fmoveto_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i_fib(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
long main() {
  printf("%ld", i_fib(260));
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x104,%edi
call   1040 <i_fib@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @main() {
%1 = tail call i32 @i_fib(i32 260)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int subtract(int, int);
int main() { printf("%d\n", subtract(14, 5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
mov    $0x5,%esi
call   1040 <subtract@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @subtract(i32 14, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main() {
  printf("No. of clock ticks per soc: %ld\n", sysconf(_SC_CLK_TCK));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"No. of clock ticks per soc: %ld\0A\00"
@_SC_CLK_TCK = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_CLK_TCK
%3 = call i32 @sysconf(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"No. of clock ticks per soc: %ld\0A\00"
@_SC_CLK_TCK = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int subStrleng(const char *s, const char c) {
  int i = 0;
  while (*(s + i) != c && *(s + i) != 0) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<subStrleng>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1147 <subStrleng+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <subStrleng+0x57>
jmp    1165 <subStrleng+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <subStrleng+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subStrleng>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
cmp    %sil,%cl
je     1123 <subStrleng+0x23>
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <subStrleng+0x10>
ret

LLVM IR (-O0):
define i32 @subStrleng(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %24
16: ; preds = %6
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br label %24
24: ; preds = %16, %6
%25 = phi i1 [ false, %6 ], [ %23, %16 ]
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %24
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @subStrleng(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
ret i32 %12
}
void sh_bios_vbr_reload(void) {}


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

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

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

LLVM IR (-O2):
define void @sh_bios_vbr_reload() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_double(double *, double *, char *);
void check_double__(double *x, double *y, char *ret) {
  check_double(x, y, ret);
}


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

x86 assembly (clang, -O2):
<check_double__>:
jmp    1030 <check_double@plt>

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

LLVM IR (-O2):
define void @check_double__(double* %0, double* %1, i8* %2) {
%4 = tail call i32 @check_double(double* %0, double* %1, i8* %2)
ret void
}
char *dlerror() { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @dlerror() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dlerror() {
ret i8* null
}
void foo407(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo407(i32 %0) {
ret void
}
create_bmp_file_if_needed(in_name, out_name, out_image) char in_name[],
    out_name[];
short **out_image;
{}


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

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

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

LLVM IR (-O2):
define i32 @create_bmp_file_if_needed(i8* nocapture readnone %0, i8* nocapture readnone %1, i16** nocapture readnone %2) {
ret i32 undef
}
void my_drv_cleanup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @my_drv_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("X = %d\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ NoPinC__0__GeneralIO__toggle();
void LedsP__Led1__toggle(void) { NoPinC__0__GeneralIO__toggle(); }


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

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

LLVM IR (-O0):
define void @LedsP__Led1__toggle() {
%1 = call i32 (...) @NoPinC__0__GeneralIO__toggle()
ret void
}

LLVM IR (-O2):
define void @LedsP__Led1__toggle() {
%1 = tail call i32 (...) @NoPinC__0__GeneralIO__toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int /*<<< orphan*/ shake256(unsigned char *, int, unsigned char *, int);
void com_1(unsigned char *c, const unsigned char *inn,
           const unsigned char *inm) {
  unsigned char buffer[((48 * 5) >> 3) + ((48 * 5) >> 3)];
  memcpy(buffer, inn, ((48 * 5) >> 3));
  memcpy(buffer + ((48 * 5) >> 3), inm, ((48 * 5) >> 3));
  shake256(c, 32, buffer, ((48 * 5) >> 3) + ((48 * 5) >> 3));
}


x86 assembly (clang, -O0):
<com_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1e,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rdi
add    $0x1e,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1e,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    $0x20,%esi
mov    $0x3c,%ecx
call   1040 <shake256@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_1>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1e,%edx
call   1030 <memcpy@plt>
lea    0x1e(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x1e,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %r15,%rdx
mov    $0x3c,%ecx
call   1040 <shake256@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @com_1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [60 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 30)
%11 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 30
%13 = load i8*, i8** %6
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 30)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%17 = call i32 @shake256(i8* %15, i32 32, i8* %16, i32 60)
ret void
}

LLVM IR (-O2):
define void @com_1(i8* %0, i8* %1, i8* %2) {
%4 = alloca [60 x i8]
%5 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %1, i32 30)
%7 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 30
%8 = call i32 @memcpy(i8* %7, i8* %2, i32 30)
%9 = call i32 @shake256(i8* %0, i32 32, i8* %5, i32 60)
ret void
}
int call_function(int f(int, long), int arg1, int arg2) {
  return f(arg1, arg2);
}


x86 assembly (clang, -O0):
<call_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
movslq -0x10(%rbp),%rsi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_function>:
mov    %esi,%ecx
mov    %rdi,%rax
movslq %edx,%rsi
mov    %ecx,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @call_function(i32 (i32, i64)* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i32 %0(i32 %1, i64 %4)
ret i32 %5
}
void foo_2_2_2_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_2_2_2_2() {
ret void
}
double min3(double a, double b, double c) {
  if (a > b) {
    if (b > c)
      return c;
    else
      return b;
  } else {
    if (a > c)
      return c;
    else
      return a;
  }
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1151 <min3+0x51>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1142 <min3+0x42>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <min3+0x7a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <min3+0x7a>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1170 <min3+0x70>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <min3+0x7a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
minsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %7
store double %16, double* %4
br label %27
17: ; preds = %11
%18 = load double, double* %6
store double %18, double* %4
br label %27
19: ; preds = %3
%20 = load double, double* %5
%21 = load double, double* %7
%22 = fcmp ogt double %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load double, double* %7
store double %24, double* %4
br label %27
25: ; preds = %19
%26 = load double, double* %5
store double %26, double* %4
br label %27
27: ; preds = %25, %23, %17, %15
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @min3(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = fcmp ogt double %1, %2
%6 = select i1 %5, double %2, double %1
%7 = fcmp ogt double %0, %2
%8 = select i1 %7, double %2, double %0
%9 = select i1 %4, double %6, double %8
ret double %9
}
void t6() {
  struct tag6 {
    int a;
  } x;
  struct tag6 *p = &x;
  (*p).a = 69;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          47, 69, x.a);
  ;
}


x86 assembly (clang, -O0):
<t6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x45,(%rax)
mov    -0x8(%rbp),%ecx
lea    0xecc(%rip),%rdi
mov    $0x2f,%esi
mov    $0x45,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t6>:
lea    0xee9(%rip),%rdi
mov    $0x2f,%esi
mov    $0x45,%edx
mov    $0x45,%ecx
xor    %eax,%eax
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.tag6 = type { i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t6() {
%1 = alloca %struct.tag6
%2 = alloca %struct.tag6*
store %struct.tag6* %1, %struct.tag6** %2
%3 = load %struct.tag6*, %struct.tag6** %2
%4 = getelementptr inbounds %struct.tag6, %struct.tag6* %3, i32 0, i32 0
store i32 69, i32* %4
%5 = getelementptr inbounds %struct.tag6, %struct.tag6* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 47, i32 69, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.tag6 = type { i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t6() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 47, i32 69, i32 69)
ret void
}
/* Variables and functions */
double cos(double);
double EDDcos(double x) { return (-cos(x)); }


x86 assembly (clang, -O0):
<EDDcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDDcos>:
push   %rax
call   1030 <cos@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @EDDcos(double %0) {
%2 = tail call double @cos(double %0)
%3 = fneg double %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double x = 0;
  printf("请输入一个实数：");
  scanf("%lf", &x);
  printf("你输入的是：%f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E5\AE\9E\E6\95\B0\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [22 x i8] c"\E4\BD\A0\E8\BE\93\E5\85\A5\E7\9A\84\E6\98\AF\EF\BC\9A%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E5\AE\9E\E6\95\B0\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [22 x i8] c"\E4\BD\A0\E8\BE\93\E5\85\A5\E7\9A\84\E6\98\AF\EF\BC\9A%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ minHeapFixdown(int *, int, int);
void makeMinHeap(int a[], int n) {
  for (int i = n / 2 - 1; i >= 0; i--) {
    minHeapFixdown(a, i, n);
  }
}


x86 assembly (clang, -O0):
<makeMinHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <makeMinHeap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <minHeapFixdown@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <makeMinHeap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeMinHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <makeMinHeap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <minHeapFixdown@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <makeMinHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @makeMinHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %9, %7 ], [ %5, %4 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @minHeapFixdown(i32* %0, i32 %9, i32 %1)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  char buf[512];
  if (argc > 1)
    strcpy(buf, argv[1]);
  printf("<%p>Len = %d\nbuf = %s\n", buf, strlen(buf), buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
lea    -0x210(%rbp),%rcx
lea    0xe68(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
cmp    $0x2,%edi
jl     1149 <main+0x19>
mov    0x8(%rsi),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %rbx,%rcx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"<%p>Len = %d\0Abuf = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcpy(i8* %4, i8* %8)
br label %10
10: ; preds = %6, %2
%11 = call i32 @strlen(i8* %4)
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %11, i8* %4)
ret i32 0
}