xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printFahrList(int /*<<< orphan*/, int, int, int);
int main() { printFahrList(0, 300, 20, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x12c,%esi
mov    $0x14,%edx
mov    $0x1,%ecx
call   1030 <printFahrList@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x12c,%esi
mov    $0x14,%edx
mov    $0x1,%ecx
call   1030 <printFahrList@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printFahrList(i32 0, i32 300, i32 20, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printFahrList(i32 0, i32 300, i32 20, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("hello world"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define void @func() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int do_test() {
  const char *my_string = NULL;
  {
    if (strcmp(my_string, my_string) != 0)
      return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1143 <do_test+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <do_test+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @do_test() {
%1 = tail call i64 @strcmp(i8* null, i8* null)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MdmPurge();
void k_purge() { MdmPurge(); }


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

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

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

LLVM IR (-O2):
define void @k_purge() {
%1 = tail call i32 (...) @MdmPurge()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HF_memmem(void const *, size_t, void const *, size_t,
                             uintptr_t);
void __sanitizer_weak_hook_memmem(uintptr_t pc, const void *haystack,
                                  size_t haystacklen, const void *needle,
                                  size_t needlelen,
                                  void *result __attribute__((unused))) {
  HF_memmem(haystack, haystacklen, needle, needlelen, pc);
}


x86 assembly (clang, -O0):
<__sanitizer_weak_hook_memmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%r8
call   1030 <HF_memmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sanitizer_weak_hook_memmem>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
jmp    1030 <HF_memmem@plt>

LLVM IR (-O0):
define void @__sanitizer_weak_hook_memmem(i64 %0, i8* %1, i64 %2, i8* %3, i64 %4, i8* %5) {
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
store i64 %0, i64* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i64 %4, i64* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = load i64, i64* %11
%17 = load i64, i64* %7
%18 = call i32 @HF_memmem(i8* %13, i64 %14, i8* %15, i64 %16, i64 %17)
ret void
}

LLVM IR (-O2):
define void @__sanitizer_weak_hook_memmem(i64 %0, i8* %1, i64 %2, i8* %3, i64 %4, i8* nocapture readnone %5) {
%7 = tail call i32 @HF_memmem(i8* %1, i64 %2, i8* %3, i64 %4, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_data(int, char *, int);
int /*<<< orphan*/ send_int(int, int);
int strlen(char *);
void send_str(int socket, char str[]) {
  int len;
  len = strlen(str);
  send_int(socket, len);
  send_data(socket, str, len);
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <send_int@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <send_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <send_int@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <send_data@plt>

LLVM IR (-O0):
define void @send_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = call i32 @send_int(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @send_data(i32 %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @send_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send_int(i32 %0, i32 %3)
%5 = tail call i32 @send_data(i32 %0, i8* %1, i32 %3)
ret void
}
int main(void) {
  int x = 0;
  int *p = &x;
  *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void XmbTextPerCharExtents() {}


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

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

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

LLVM IR (-O2):
define void @XmbTextPerCharExtents() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanStatusHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FlightPlanStatusLogging() { UAVObjLogging(FlightPlanStatusHandle()); }


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

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

LLVM IR (-O0):
define void @FlightPlanStatusLogging() {
%1 = call i32 (...) @FlightPlanStatusHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanStatusLogging() {
%1 = tail call i32 (...) @FlightPlanStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
int ld_le_rc1(long double a1) { return (((a1) <= (100))); }


x86 assembly (clang, -O0):
<ld_le_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_le_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @ld_le_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ole x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_le_rc1(x86_fp80 %0) {
%2 = fcmp ole x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3UnixThreadSpecificData(int);
void sqlite3ReleaseThreadData() { sqlite3UnixThreadSpecificData(-1); }


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

x86 assembly (clang, -O2):
<sqlite3ReleaseThreadData>:
mov    $0xffffffff,%edi
jmp    1030 <sqlite3UnixThreadSpecificData@plt>

LLVM IR (-O0):
define void @sqlite3ReleaseThreadData() {
%1 = call i32 @sqlite3UnixThreadSpecificData(i32 -1)
ret void
}

LLVM IR (-O2):
define void @sqlite3ReleaseThreadData() {
%1 = tail call i32 @sqlite3UnixThreadSpecificData(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("Help current not available.\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Help current not available.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Help current not available.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void neg_handler(void) {
  write_src("stack[stack_pointer - 1] = -stack[stack_pointer - 1];\n");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"stack[stack_pointer - 1] = -stack[stack_pointer - 1];\0A\00"
define void @neg_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"stack[stack_pointer - 1] = -stack[stack_pointer - 1];\0A\00"
define void @neg_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int i;
  int res = 0;
  goto L1;
  while (i < 10) {
  L2:
    res++;
    goto L3;
  L1:
    i = 0;
    goto L2;
  L3:
    i++;
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1134 <main+0x34>
cmpl   $0xa,-0x8(%rbp)
jge    114e <main+0x4e>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main+0x40>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
void __attribute__((
    __warning__("curl_easy_setopt expects a curl_progress_callback argument "
                "for this option"))) __attribute__((__unused__))
__attribute__((__no__)) _curl_easy_setopt_err_progress_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_progress_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ safepath;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char *);
int /*<<< orphan*/ url_encode(char const *, char *, int);
int64_t chirp_client_rmall(struct chirp_client *c, char const *path,
                           time_t stoptime) {
  char safepath[1024];
  url_encode(path, safepath, sizeof(safepath));
  return simple_command(c, stoptime, "rmall %s\n", safepath);
}


x86 assembly (clang, -O0):
<chirp_client_rmall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rcx
lea    0xea0(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_rmall>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
lea    0xeb6(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rcx
call   1030 <simple_command@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [10 x i8] c"rmall %s\0A\00"
define i32 @chirp_client_rmall(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = call i32 @url_encode(i8* %8, i8* %9, i32 1024)
%11 = load %struct.chirp_client*, %struct.chirp_client** %4
%12 = load i32, i32* %6
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i32 @simple_command(%struct.chirp_client* %11, i32 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [10 x i8] c"rmall %s\0A\00"
define i32 @chirp_client_rmall(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @url_encode(i8* %1, i8* %5, i32 1024)
%7 = call i32 @simple_command(%struct.chirp_client* %0, i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  int *temp;
  temp = (int *)threadid;
  printf("\n%d: Hello World!\n", *temp);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0A%d: Hello World!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0A%d: Hello World!\0A\00"
define noalias i8* @PrintHello(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void function1(short width, int data[][width][width]) {}


x86 assembly (clang, -O0):
<function1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @function1(i16 signext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i64
%7 = load i16, i16* %3
%8 = zext i16 %7 to i64
ret void
}

LLVM IR (-O2):
define void @function1(i16 signext %0, i32* nocapture %1) {
ret void
}
int egsy_pfmt_csr_debug_set(unsigned int dev_id,
                            union egsy_pfmt_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_pfmt_csr_debug_u = type opaque
define i32 @egsy_pfmt_csr_debug_set(i32 %0, %union.egsy_pfmt_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_pfmt_csr_debug_u*
store i32 %0, i32* %3
store %union.egsy_pfmt_csr_debug_u* %1, %union.egsy_pfmt_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_pfmt_csr_debug_u = type opaque
define i32 @egsy_pfmt_csr_debug_set(i32 %0, %union.egsy_pfmt_csr_debug_u* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;
typedef int /*<<< orphan*/ mpfr_exp_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_get_str(char *, int /*<<< orphan*/ *, int, int,
                                int /*<<< orphan*/, int);
void mpfrgetstr(mpfr_t r1, char *chr1, int *nc1, mpfr_exp_t *iexp,
                mpfr_rnd_t *irnd) {
  int n1;
  int n2;
  n1 = *nc1;
  n2 = *irnd;
  mpfr_get_str(chr1, iexp, 10, n1, r1, n2);
}


x86 assembly (clang, -O0):
<mpfrgetstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x2c(%rbp),%ecx
mov    -0x4(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    $0xa,%edx
call   1030 <mpfr_get_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrgetstr>:
mov    %edi,%r10d
mov    (%rdx),%eax
mov    (%r8),%r9d
mov    %rsi,%rdi
mov    %rcx,%rsi
mov    $0xa,%edx
mov    %eax,%ecx
mov    %r10d,%r8d
jmp    1030 <mpfr_get_str@plt>

LLVM IR (-O0):
define void @mpfrgetstr(i32 %0, i8* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
store i32 %14, i32* %11
%15 = load i32*, i32** %10
%16 = load i32, i32* %15
store i32 %16, i32* %12
%17 = load i8*, i8** %7
%18 = load i32*, i32** %9
%19 = load i32, i32* %11
%20 = load i32, i32* %6
%21 = load i32, i32* %12
%22 = call i32 @mpfr_get_str(i8* %17, i32* %18, i32 10, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @mpfrgetstr(i32 %0, i8* %1, i32* nocapture %2, i32* %3, i32* nocapture %4) {
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = tail call i32 @mpfr_get_str(i8* %1, i32* %3, i32 10, i32 %6, i32 %0, i32 %7)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t LO(uint16_t x) { return (x >> 0) & 0xFF; }


x86 assembly (clang, -O0):
<LO>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LO>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @LO(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
int isWin(int atePelet, int totalPelet) {
  if (atePelet == totalPelet)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isWin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <isWin+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <isWin+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWin>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isWin(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct input_event {
  int dummy;
};

/* Variables and functions */
short POLLIN;
int read(int, struct input_event *, int);
int ev_get_input(int fd, short revents, struct input_event *ev) {
  int r;
  if (revents & POLLIN) {
    r = read(fd, ev, sizeof(*ev));
    if (r == sizeof(*ev))
      return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ev_get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movswl -0xa(%rbp),%eax
mov    0x2eb7(%rip),%rcx
movswl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1172 <ev_get_input+0x62>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jne    116d <ev_get_input+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <ev_get_input+0x69>
jmp    1172 <ev_get_input+0x62>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_get_input>:
push   %rax
mov    0x2ed0(%rip),%rax
test   %si,(%rax)
je     1133 <ev_get_input+0x23>
mov    %rdx,%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
je     1138 <ev_get_input+0x28>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.input_event = type { i32 }
@POLLIN = global i16 0
define i32 @ev_get_input(i32 %0, i16 signext %1, %struct.input_event* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
%7 = alloca %struct.input_event*
%8 = alloca i32
store i32 %0, i32* %5
store i16 %1, i16* %6
store %struct.input_event* %2, %struct.input_event** %7
%9 = load i16, i16* %6
%10 = sext i16 %9 to i32
%11 = load i16, i16* @POLLIN
%12 = sext i16 %11 to i32
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load %struct.input_event*, %struct.input_event** %7
%18 = call i32 @read(i32 %16, %struct.input_event* %17, i32 4)
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = icmp eq i64 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 0, i32* %4
br label %25
23: ; preds = %15
br label %24
24: ; preds = %23, %3
store i32 -1, i32* %4
br label %25
25: ; preds = %24, %22
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
%struct.input_event = type { i32 }
@POLLIN = global i16 0
define i32 @ev_get_input(i32 %0, i16 signext %1, %struct.input_event* nocapture %2) {
%4 = load i16, i16* @POLLIN
%5 = and i16 %4, %1
%6 = icmp eq i16 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @read(i32 %0, %struct.input_event* %2, i32 4)
%9 = icmp eq i32 %8, 4
br i1 %9, label %11, label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ -1, %10 ], [ 0, %7 ]
ret i32 %12
}
int test_imm_33uint16_mem(unsigned short *val) {
  return ((*val) & (-0x33 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_33uint16_mem>:
movzwl (%rdi),%eax
test   $0xffcd,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -51
%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_33uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -51
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr(int, int);
int /*<<< orphan*/ GenPrintNewLine();
int /*<<< orphan*/ GenPrintOperand(int, long);
int /*<<< orphan*/ GenPrintOperandEnder();
int /*<<< orphan*/ GenPrintOperandStarter();
void GenPrintInstrOneOperand(int instr, int instrval, int operand,
                             long operandval) {
  GenPrintInstr(instr, instrval);
  GenPrintOperandStarter();
  GenPrintOperand(operand, operandval);
  GenPrintOperandEnder();
  GenPrintNewLine();
}


x86 assembly (clang, -O0):
<GenPrintInstrOneOperand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <GenPrintInstr@plt>
mov    $0x0,%al
call   1040 <GenPrintOperandStarter@plt>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1060 <GenPrintOperand@plt>
mov    $0x0,%al
call   1030 <GenPrintOperandEnder@plt>
mov    $0x0,%al
call   1070 <GenPrintNewLine@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenPrintInstrOneOperand>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
call   1050 <GenPrintInstr@plt>
xor    %eax,%eax
call   1040 <GenPrintOperandStarter@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <GenPrintOperand@plt>
xor    %eax,%eax
call   1030 <GenPrintOperandEnder@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <GenPrintNewLine@plt>

LLVM IR (-O0):
define void @GenPrintInstrOneOperand(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @GenPrintInstr(i32 %9, i32 %10)
%12 = call i32 (...) @GenPrintOperandStarter()
%13 = load i32, i32* %7
%14 = load i64, i64* %8
%15 = call i32 @GenPrintOperand(i32 %13, i64 %14)
%16 = call i32 (...) @GenPrintOperandEnder()
%17 = call i32 (...) @GenPrintNewLine()
ret void
}

LLVM IR (-O2):
define void @GenPrintInstrOneOperand(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @GenPrintInstr(i32 %0, i32 %1)
%6 = tail call i32 (...) @GenPrintOperandStarter()
%7 = tail call i32 @GenPrintOperand(i32 %2, i64 %3)
%8 = tail call i32 (...) @GenPrintOperandEnder()
%9 = tail call i32 (...) @GenPrintNewLine()
ret void
}
/* Variables and functions */
scalar_t__ chdir(char const *);
int iupUnixSetCurrentDirectory(const char *dir) {
  return chdir(dir) == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<iupUnixSetCurrentDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iupUnixSetCurrentDirectory(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void rand_init() {}


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

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

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

LLVM IR (-O2):
define void @rand_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ no_usable_data();
int main(int argc, const char *argv[]) {
  no_usable_data();
  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   1030 <no_usable_data@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @no_usable_data()
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int bcm2835_read(int);
int32_t mini_uart_getc(void) {
  while (bcm2835_read((0 + 0x201000 + 0x18)) & (1 << 4)) {
  }
  return bcm2835_read((0 + 0x201000 + 0x00));
}


x86 assembly (clang, -O0):
<mini_uart_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <mini_uart_getc+0x9>
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
and    $0x10,%eax
cmp    $0x0,%eax
je     1134 <mini_uart_getc+0x24>
jmp    1119 <mini_uart_getc+0x9>
mov    $0x201000,%edi
call   1030 <bcm2835_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini_uart_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
test   $0x10,%al
jne    1120 <mini_uart_getc+0x10>
mov    $0x201000,%edi
pop    %rax
jmp    1030 <bcm2835_read@plt>

LLVM IR (-O0):
define i32 @mini_uart_getc() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @bcm2835_read(i32 2101272)
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 @bcm2835_read(i32 2101248)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mini_uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @bcm2835_read(i32 2101272)
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 @bcm2835_read(i32 2101248)
ret i32 %6
}
int isalpha(int c) { return ((unsigned)c | 32) - 'a' < 26; }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
or     $0x20,%edi
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 32
%5 = sub i32 %4, 97
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = or i32 %0, 32
%3 = add i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void nmi_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<nmi_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nmi_handler+0x9>
jmp    1109 <nmi_handler+0x9>

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

LLVM IR (-O0):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int main() {
  int arg1 = 40;
  int arg2 = 2;
  int add = 0;
  __asm__("addl %%ebx, %%eax;" : "=a"(add) : "a"(arg1), "b"(arg2));
  return add;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x28,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
add    %ebx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%eax
mov    $0x2,%ebx
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "addl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "addl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 40, i32 2)
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t HibernateIsActive(void) {
  return ((*((volatile uint32_t *)(0x400FC010))) & 0x00000040 ? 1 : 0);
}


x86 assembly (clang, -O0):
<HibernateIsActive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%edx
and    $0x40,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIsActive>:
mov    0x400fc010,%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @HibernateIsActive() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, 64
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @HibernateIsActive() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = lshr i32 %1, 6
%3 = and i32 %2, 1
ret i32 %3
}
float ctss_maddf(const float a, const float b, const float c) {
  return a * b + c;
}


x86 assembly (clang, -O0):
<ctss_maddf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_maddf>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @ctss_maddf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @ctss_maddf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
void foo166(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo166(i32 %0) {
ret void
}
/* Variables and functions */
int pigpio_command(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int wave_tx_stop(int pi) { return pigpio_command(pi, 33, 0, 0, 1); }


x86 assembly (clang, -O0):
<wave_tx_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x21,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_tx_stop>:
mov    $0x21,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_tx_stop(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 33, i32 0, i32 0, i32 1)
ret i32 %2
}
void download(struct download_info const *const info) {}


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

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

LLVM IR (-O0):
%struct.download_info = type opaque
define void @download(%struct.download_info* %0) {
%2 = alloca %struct.download_info*
store %struct.download_info* %0, %struct.download_info** %2
ret void
}

LLVM IR (-O2):
%struct.download_info = type opaque
define void @download(%struct.download_info* nocapture %0) {
ret void
}
double fabs(double x) { return __builtin_fabs(x); }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
andps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ matrix_mul(unsigned char *, unsigned char *, unsigned char *,
                              int, int, int);
void decode_chunk(unsigned char *dataChunk, unsigned char *parityCoeff,
                  unsigned char *codeChunk, int nativeBlockNum,
                  int parityBlockNum, int chunkSize) {
  matrix_mul(parityCoeff, codeChunk, dataChunk, nativeBlockNum, nativeBlockNum,
             chunkSize);
}


x86 assembly (clang, -O0):
<decode_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <matrix_mul@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_chunk>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
mov    %ecx,%r8d
jmp    1030 <matrix_mul@plt>

LLVM IR (-O0):
define void @decode_chunk(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %7
%16 = load i32, i32* %10
%17 = load i32, i32* %10
%18 = load i32, i32* %12
%19 = call i32 @matrix_mul(i8* %13, i8* %14, i8* %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @decode_chunk(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @matrix_mul(i8* %1, i8* %2, i8* %0, i32 %3, i32 %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_FW8888_send_cmd(int);
void __attribute__((unused)) drv_FW8888_display_on_cursor_on(void) {
  drv_FW8888_send_cmd(0x0E);
}


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

x86 assembly (clang, -O2):
<drv_FW8888_display_on_cursor_on>:
mov    $0xe,%edi
jmp    1030 <drv_FW8888_send_cmd@plt>

LLVM IR (-O0):
define void @drv_FW8888_display_on_cursor_on() {
%1 = call i32 @drv_FW8888_send_cmd(i32 14)
ret void
}

LLVM IR (-O2):
define void @drv_FW8888_display_on_cursor_on() {
%1 = tail call i32 @drv_FW8888_send_cmd(i32 14)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
void spy_mach_write_to_1(unsigned char *b, uint8_t data) {
  assert(b);
  b[0] = (unsigned char)(data & 0xFFUL);
}


x86 assembly (clang, -O0):
<spy_mach_write_to_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movslq -0xc(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spy_mach_write_to_1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %bpl,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @spy_mach_write_to_1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = and i64 %8, 255
%10 = trunc i64 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
ret void
}

LLVM IR (-O2):
define void @spy_mach_write_to_1(i8* %0, i32 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = trunc i32 %1 to i8
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void sayNTimesCoucou(unsigned int n) {
  for (int i = 0; i < n; i++) {
    puts("Coucou");
  }
}


x86 assembly (clang, -O0):
<sayNTimesCoucou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <sayNTimesCoucou+0x38>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <sayNTimesCoucou+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayNTimesCoucou>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <sayNTimesCoucou+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <sayNTimesCoucou+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Coucou\00"
define void @sayNTimesCoucou(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Coucou\00"
define void @sayNTimesCoucou(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int ib_hash_compare_uint(const void *key1, const void *key2) {
  size_t x = (size_t)key1;
  size_t y = (size_t)key2;
  if (x == y)
    return 0;
  return (x < y) ? -1 : 1;
}


x86 assembly (clang, -O0):
<ib_hash_compare_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1136 <ib_hash_compare_uint+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1151 <ib_hash_compare_uint+0x51>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ib_hash_compare_uint>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ib_hash_compare_uint(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i64
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %22
16: ; preds = %2
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = icmp ult i64 %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 1
store i32 %21, i32* %3
br label %22
22: ; preds = %16, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ib_hash_compare_uint(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
void XtPopup() {}


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

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

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

LLVM IR (-O2):
define void @XtPopup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  int i = 3;
  system("echo i");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"echo i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"echo i\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}