xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage: %s \t\tRemove byte order mark at the *BEGINNING* of the "
          "UTF-8 input.\n",
          prog);
  fprintf(stderr,
          "   or: %s -a\tRemove *ALL* byte order mark of the UTF-8 input.\n",
          prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xef2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf01(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"usage: %s \09\09Remove byte order mark at the *BEGINNING* of the UTF-8 input.\0A\00"
@.str.1 = [63 x i8] c" or: %s -a\09Remove *ALL* byte order mark of the UTF-8 input.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"usage: %s \09\09Remove byte order mark at the *BEGINNING* of the UTF-8 input.\0A\00"
@.str.1 = [63 x i8] c" or: %s -a\09Remove *ALL* byte order mark of the UTF-8 input.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void XtCvtIntToFloat() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToFloat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  fprintf(stderr, "EACCES: %s\n", strerror(EACCES));
  errno = ENOENT;
  perror(argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%ecx
mov    0x2e4e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    0x2e62(%rip),%rcx
mov    %eax,(%rcx)
mov    (%rbx),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"EACCES: %s\0A\00"
@EACCES = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
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* @stderr
%7 = load i32, i32* @EACCES
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @ENOENT
store i32 %10, i32* @errno
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @perror(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"EACCES: %s\0A\00"
@EACCES = global i32 0
@ENOENT = global i32 0
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @EACCES
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
%8 = load i8*, i8** %1
%9 = tail call i32 @perror(i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setperiod_systick(int);
void setperiod_systick_interrupt(void) { setperiod_systick(10000); }


x86 assembly (clang, -O0):
<setperiod_systick_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1030 <setperiod_systick@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setperiod_systick_interrupt>:
mov    $0x2710,%edi
jmp    1030 <setperiod_systick@plt>

LLVM IR (-O0):
define void @setperiod_systick_interrupt() {
%1 = call i32 @setperiod_systick(i32 10000)
ret void
}

LLVM IR (-O2):
define void @setperiod_systick_interrupt() {
%1 = tail call i32 @setperiod_systick(i32 10000)
ret void
}
int test_imm_6Cuint8_mem(unsigned char *val) {
  return ((*val) & (0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun553() { return 553; }


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

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

LLVM IR (-O0):
define i32 @fun553() {
ret i32 553
}

LLVM IR (-O2):
define i32 @fun553() {
ret i32 553
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int cDumpLine(FILE *fp) {
  register int c;
  while ((c = fgetc(fp)) != '\n')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<cDumpLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1136 <cDumpLine+0x26>
jmp    111c <cDumpLine+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cDumpLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
jne    1120 <cDumpLine+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cDumpLine(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %8, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @cDumpLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_46_im_0();
void z80_ed_66_im_0(void) { z80_ed_46_im_0(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_66_im_0() {
%1 = tail call i32 (...) @z80_ed_46_im_0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printfn(int, int, double, float, int, int, void *,
                           int /*<<< orphan*/, int, long long);
int main() {
  printfn(12, 2, 123.234, 1231.12312f, -12, 23, (void *)123456, 0, 1234567,
          123124124124LL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
mov    $0x2,%esi
movsd  0xecf(%rip),%xmm0
movss  0xecf(%rip),%xmm1
mov    $0xfffffff4,%edx
mov    $0x17,%ecx
mov    $0x1e240,%r8d
xor    %r9d,%r9d
movabs $0x1caac509dc,%rax
movl   $0x12d687,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <printfn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x1caac509dc,%rax
movsd  0xedd(%rip),%xmm0
movss  0xedd(%rip),%xmm1
mov    $0x1e240,%r8d
mov    $0xc,%edi
mov    $0x2,%esi
mov    $0xfffffff4,%edx
mov    $0x17,%ecx
xor    %r9d,%r9d
push   %rax
push   $0x12d687
call   1030 <printfn@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printfn(i32 12, i32 2, double 1.232340e+02, float 0x40933C7E20000000, i32 -12, i32 23, i8* inttoptr (i64 123456 to i8*), i32 0, i32 1234567, i64 123124124124)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printfn(i32 12, i32 2, double 1.232340e+02, float 0x40933C7E20000000, i32 -12, i32 23, i8* inttoptr (i64 123456 to i8*), i32 0, i32 1234567, i64 123124124124)
ret i32 0
}
hls_to_rgb(h, l, s, r, g, b) int h, l, s;
int *r, *g, *b;
{ float v; }


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

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

LLVM IR (-O0):
define i32 @hls_to_rgb(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca float
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @hls_to_rgb(i32 %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int realRemoteAdder(int a, int b) {
  sleep(10);
  return a + b;
}


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

x86 assembly (clang, -O2):
<realRemoteAdder>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xa,%edi
call   1030 <sleep@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @realRemoteAdder(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @sleep(i32 10)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @realRemoteAdder(i32 %0, i32 %1) {
%3 = tail call i32 @sleep(i32 10)
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int tst_log_close(FILE *f) {
  fprintf(f, "\n\t]\n}\n");
  return fclose(f);
}


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

x86 assembly (clang, -O2):
<tst_log_close>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A\09]\0A}\0A\00"
define i32 @tst_log_close(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %0)
%3 = tail call i32 @fclose(i32* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ task_assert_flag(int, int);
void task_assert_yield(int id) { task_assert_flag(id, (1 << 7)); }


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

x86 assembly (clang, -O2):
<task_assert_yield>:
mov    $0x80,%esi
jmp    1030 <task_assert_flag@plt>

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

LLVM IR (-O2):
define void @task_assert_yield(i32 %0) {
%2 = tail call i32 @task_assert_flag(i32 %0, i32 128)
ret void
}
void p_env_init(unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @p_env_init(i32 %0) {
ret void
}
int HelpItem109(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem109() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem109() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ m4x4_newIdentity(int /*<<< orphan*/);
int /*<<< orphan*/ matrixstack_head();
void matrixstack_origin(void) { m4x4_newIdentity(matrixstack_head()); }


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

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

LLVM IR (-O0):
define void @matrixstack_origin() {
%1 = call i32 (...) @matrixstack_head()
%2 = call i32 @m4x4_newIdentity(i32 %1)
ret void
}

LLVM IR (-O2):
define void @matrixstack_origin() {
%1 = tail call i32 (...) @matrixstack_head()
%2 = tail call i32 @m4x4_newIdentity(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_InsWrite(int, int const *, int);
void NRF24_Set_RX_Addr(const uint8_t *rx_addr, uint8_t pipe) {
  if (pipe > 5)
    return;
  if (pipe <= 1) {
    NRF24_InsWrite(0x20 | (0x0A + pipe), rx_addr, 5);
  } else {
    NRF24_InsWrite(0x20 | (0x0A + pipe), rx_addr, 1);
  }
}


x86 assembly (clang, -O0):
<NRF24_Set_RX_Addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    112e <NRF24_Set_RX_Addr+0x1e>
jmp    116b <NRF24_Set_RX_Addr+0x5b>
cmpl   $0x1,-0xc(%rbp)
jg     1154 <NRF24_Set_RX_Addr+0x44>
mov    -0xc(%rbp),%edi
add    $0xa,%edi
or     $0x20,%edi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1030 <NRF24_InsWrite@plt>
jmp    116b <NRF24_Set_RX_Addr+0x5b>
mov    -0xc(%rbp),%edi
add    $0xa,%edi
or     $0x20,%edi
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <NRF24_InsWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_Set_RX_Addr>:
cmp    $0x5,%esi
jle    1116 <NRF24_Set_RX_Addr+0x6>
ret
mov    %rdi,%rax
lea    0xa(%rsi),%edi
or     $0x20,%edi
xor    %ecx,%ecx
cmp    $0x2,%esi
setl   %cl
lea    0x1(,%rcx,4),%edx
mov    %rax,%rsi
jmp    1030 <NRF24_InsWrite@plt>

LLVM IR (-O0):
define void @NRF24_Set_RX_Addr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %2
br label %23
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 10, %12
%14 = or i32 32, %13
%15 = load i32*, i32** %3
%16 = call i32 @NRF24_InsWrite(i32 %14, i32* %15, i32 5)
br label %23
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 10, %18
%20 = or i32 32, %19
%21 = load i32*, i32** %3
%22 = call i32 @NRF24_InsWrite(i32 %20, i32* %21, i32 1)
br label %23
23: ; preds = %7, %17, %11
ret void
}

LLVM IR (-O2):
define void @NRF24_Set_RX_Addr(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 5
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add nsw i32 %1, 10
%6 = or i32 %5, 32
%7 = icmp sgt i32 %1, 1
%8 = select i1 %7, i32 1, i32 5
%9 = tail call i32 @NRF24_InsWrite(i32 %6, i32* %0, i32 %8)
br label %10
10: ; preds = %4, %2
ret void
}
int gcd(int a, int b) {
  int temp;
  int rem;
  if (a < b) {
    temp = a;
    a = b;
    b = temp;
  }
  while (a % b != 0) {
    rem = a % b;
    a = b;
    b = rem;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1158 <gcd+0x58>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %esi,%edi
mov    %esi,%edx
cmovl  %edi,%edx
cmovl  %esi,%edi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %9, %6 ]
%8 = phi i32 [ %5, %2 ], [ %7, %6 ]
%9 = srem i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %7
}
void X509_REQ_set_extension_nids(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_set_extension_nids() {
ret void
}
int equals(void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @equals(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
double ecliptic_true_obliquity(double delta_epsilon, double epsilon0) {
  return delta_epsilon + epsilon0 / 3600.0;
}


x86 assembly (clang, -O0):
<ecliptic_true_obliquity>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ecliptic_true_obliquity(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %6, 3.600000e+03
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @ecliptic_true_obliquity(double %0, double %1) {
%3 = fdiv double %1, 3.600000e+03
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printBinary(unsigned int k) {
  for (int i = 0; i < 32; i++) {
    if (k & 1) {
      printf("1");
    } else {
      printf("0");
    }
    k >>= 1;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    116f <printBinary+0x5f>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <printBinary+0x3c>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <printBinary+0x48>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printBinary+0x12>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinary>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x20,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
shr    %ebx
add    $0xffffffff,%ebp
jne    1120 <printBinary+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printBinary(i32 %0) {
br label %4
2: ; preds = %4
%3 = tail call i32 @putchar(i32 10)
ret void
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %11, %4 ]
%6 = phi i32 [ %0, %1 ], [ %10, %4 ]
%7 = and i32 %6, 1
%8 = or i32 %7, 48
%9 = tail call i32 @putchar(i32 %8)
%10 = lshr i32 %6, 1
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 32
br i1 %12, label %2, label %4
}
int toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (int)("ABCDEFGHIJKLMNOPQRSTUVWXYZ"[c - 'a']);
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1137 <toupper+0x37>
cmpl   $0x7a,-0x8(%rbp)
jg     1137 <toupper+0x37>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
movslq %eax,%rcx
lea    0xed5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <toupper+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     1117 <toupper+0x17>
mov    %ecx,%eax
lea    0xeed(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %2
br label %18
16: ; preds = %6, %1
%17 = load i32, i32* %3
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ %0, %1 ]
ret i32 %10
}
int value(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @value(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putByte(unsigned char);
void putBytes(unsigned char *data, int len) {
  int i;
  for (i = 0; i < len; i++)
    putByte(data[i]);
}


x86 assembly (clang, -O0):
<putBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <putBytes+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <putByte@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <putBytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putBytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <putBytes+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <putByte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <putBytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @putBytes(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putByte(i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msm_ois_i2c_read(unsigned short, unsigned int *, int);
void RamRead(unsigned char RamAddrH, unsigned char RamAddrL,
             unsigned short *ReadData) {
  unsigned short reg_addr;
  unsigned int reg_data;
  reg_addr = (RamAddrH << 8) | RamAddrL;
  msm_ois_i2c_read(reg_addr, &reg_data, 2);
  *ReadData = reg_data;
}


x86 assembly (clang, -O0):
<RamRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
movzwl -0x12(%rbp),%edi
call   1030 <msm_ois_i2c_read@plt>
mov    -0x18(%rbp),%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamRead>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
shl    $0x8,%edi
or     %esi,%edi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
call   1030 <msm_ois_i2c_read@plt>
movzwl 0xc(%rsp),%eax
mov    %ax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @RamRead(i8 zeroext %0, i8 zeroext %1, i16* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i16* %2, i16** %6
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i16
store i16 %15, i16* %7
%16 = load i16, i16* %7
%17 = call i32 @msm_ois_i2c_read(i16 zeroext %16, i32* %8, i32 2)
%18 = load i32, i32* %8
%19 = trunc i32 %18 to i16
%20 = load i16*, i16** %6
store i16 %19, i16* %20
ret void
}

LLVM IR (-O2):
define void @RamRead(i8 zeroext %0, i8 zeroext %1, i16* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = zext i8 %0 to i16
%7 = shl nuw i16 %6, 8
%8 = zext i8 %1 to i16
%9 = or i16 %7, %8
%10 = call i32 @msm_ois_i2c_read(i16 zeroext %9, i32* %4, i32 2)
%11 = load i32, i32* %4
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char unescape(char c) {
  puts("warning, unescaping not yet implemented");
  return c;
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"warning, unescaping not yet implemented\00"
define signext i8 @unescape(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
@.str = [40 x i8] c"warning, unescaping not yet implemented\00"
define signext i8 @unescape(i8 returned signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int isFemale = 0;
  printf("Is my gender female? %d\n", isFemale);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Is my gender female? %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Is my gender female? %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void html_toc_start(void) {}


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

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

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

LLVM IR (-O2):
define void @html_toc_start() {
ret void
}
/* Variables and functions */
size_t dcs_size_min(size_t a, size_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<dcs_size_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <dcs_size_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <dcs_size_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcs_size_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @dcs_size_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @dcs_size_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr, "usage: %s <path>\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <path>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <path>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main() {
  if (foo() != 2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x2,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x2,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void g_logv(const char *log_domain, int log_level, const char *format, ...) {}


x86 assembly (clang, -O0):
<g_logv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_logv(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_logv(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open_max();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  printf("Open max = %ld\n", open_max());
  return 0;
}


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    $0x0,%al
call   1040 <open_max@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
xor    %eax,%eax
call   1040 <open_max@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Open max = %ld\0A\00"
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 = call i32 (...) @open_max()
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Open max = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @open_max()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double time_diff(struct timeval *high, struct timeval *low) {
  return (high->tv_sec - low->tv_sec) +
         (high->tv_usec - low->tv_usec) / 1000000.0;
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
movsd  0xeca(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
movupd (%rdi),%xmm1
movupd (%rsi),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @time_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%14 = load double, double* %13
%15 = load %struct.timeval*, %struct.timeval** %4
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%17 = load double, double* %16
%18 = fsub double %14, %17
%19 = fdiv double %18, 1.000000e+06
%20 = fadd double %11, %19
ret double %20
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @time_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = bitcast %struct.timeval* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast %struct.timeval* %1 to <2 x double>*
%6 = load <2 x double>, <2 x double>* %5
%7 = fsub <2 x double> %4, %6
%8 = extractelement <2 x double> %7, i64 1
%9 = fdiv double %8, 1.000000e+06
%10 = extractelement <2 x double> %7, i64 0
%11 = fadd double %10, %9
ret double %11
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double distance(double x1, double x2, double y1, double y2) {
  double dist = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
  return dist;
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    -0x30(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,(%rsp)
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = call i64 @pow(double %12, i32 2)
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = call i64 @pow(double %16, i32 2)
%18 = add nsw i64 %13, %17
%19 = call double @sqrt(i64 %18)
store double %19, double* %9
%20 = load double, double* %9
ret double %20
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %1, %0
%6 = tail call i64 @pow(double %5, i32 2)
%7 = fsub double %3, %2
%8 = tail call i64 @pow(double %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
int /*<<< orphan*/ xxswap4(float *, int, int);
void print_float(char *buf, unsigned char *c, int bigendian) {
  float *f;
  f = (float *)c;
  if (bigendian)
    xxswap4(f, 1, 1);
  sprintf(buf, "%f", *f);
}


x86 assembly (clang, -O0):
<print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1155 <print_float+0x35>
mov    -0x20(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <xxswap4@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe98(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_float>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %edx,%edx
je     1140 <print_float+0x20>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <xxswap4@plt>
movss  (%rbx),%xmm0
lea    0xeb5(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print_float(i8* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = bitcast i8* %1 to float*
%5 = icmp eq i32 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @xxswap4(float* %4, i32 1, i32 1)
br label %8
8: ; preds = %6, %3
%9 = load float, float* %4
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
ret void
}
int test_imm_66uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x66 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_66uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 102
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int memcpy(int, int, int);
memmove(int x, int y, int z) { return memcpy(x, y, z); }


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

x86 assembly (clang, -O2):
<memmove>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i32 @memmove(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @memcpy(i32 %0, i32 %1, i32 %2)
ret i32 %4
}