xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ displayMessageAndWaitForKey(char *);
void short_help(void) {
  displayMessageAndWaitForKey("Unknown command, press F1 for help");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Unknown command, press F1 for help\00"
define void @short_help() {
%1 = call i32 @displayMessageAndWaitForKey(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Unknown command, press F1 for help\00"
define void @short_help() {
%1 = tail call i32 @displayMessageAndWaitForKey(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_main_context_set_poll_func() {}


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

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

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

LLVM IR (-O2):
define void @g_main_context_set_poll_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pointer_arith3(char *, int);
void call_pointer_arith3_Bad() {
  char p[5];
  pointer_arith3(p, 100);
}


x86 assembly (clang, -O0):
<call_pointer_arith3_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
mov    $0x64,%esi
call   1030 <pointer_arith3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_pointer_arith3_Bad>:
push   %rax
lea    0x3(%rsp),%rdi
mov    $0x64,%esi
call   1030 <pointer_arith3@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_pointer_arith3_Bad() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @pointer_arith3(i8* %2, i32 100)
ret void
}

LLVM IR (-O2):
define void @call_pointer_arith3_Bad() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @pointer_arith3(i8* %2, i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void err(const char *msg) {
  fprintf(stderr, "lbzmerge: ");
  if (msg)
    perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1165 <err+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1156 <err+0x26>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"lbzmerge: \00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"lbzmerge: \00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Variables and functions */
unsigned int row_with_max_negs(int *, unsigned int, unsigned int);
unsigned int row_with_min_negs(int *, unsigned int, unsigned int);
int /*<<< orphan*/ swap_rows(int *, unsigned int, unsigned int, unsigned int,
                             unsigned int);
void swap_ext_rows(int *arr, unsigned int rows, unsigned int columns) {
  unsigned int min_r = row_with_min_negs(arr, rows, columns);
  unsigned int max_r = row_with_max_negs(arr, rows, columns);
  swap_rows(arr, min_r, max_r, rows, columns);
}


x86 assembly (clang, -O0):
<swap_ext_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <row_with_min_negs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <row_with_max_negs@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
call   1050 <swap_rows@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_ext_rows>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <row_with_min_negs@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <row_with_max_negs@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %eax,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <swap_rows@plt>

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

LLVM IR (-O2):
define void @swap_ext_rows(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @row_with_min_negs(i32* %0, i32 %1, i32 %2)
%5 = tail call i32 @row_with_max_negs(i32* %0, i32 %1, i32 %2)
%6 = tail call i32 @swap_rows(i32* %0, i32 %4, i32 %5, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printobj(void *obj, void *data) { printf("%s\n", (char *)obj); }


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

x86 assembly (clang, -O2):
<printobj>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @printobj(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 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printobj(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void tests_config_clean(void) {}


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

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

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

LLVM IR (-O2):
define void @tests_config_clean() {
ret void
}
unsigned long long func7(unsigned long a, unsigned long b) {
  return (unsigned long long)a * (unsigned long long)b;
}


x86 assembly (clang, -O0):
<func7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func7>:
mov    %rdi,%rax
imul   %rsi,%rax
ret

LLVM IR (-O0):
define i64 @func7(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 = mul i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @func7(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
ret i64 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ oom_error(char *, size_t);
__attribute__((unused)) void *xcalloc(size_t n, size_t s) {
  void *p;
  p = calloc(n, s);
  if (p == NULL)
    oom_error("calloc", n * s);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <xcalloc+0x41>
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <oom_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <xcalloc+0x2b>
imul   %r15,%r14
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
call   1040 <oom_error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"calloc\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = mul i64 %12, %13
%15 = call i32 @oom_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i32 @oom_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
int get_hardware(char *hardware_string) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @get_hardware(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x05() {
  Assert_real((isascii(5)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              30, ("isascii should be 1 for 0x05"));
}


x86 assembly (clang, -O0):
<t_isascii_0x05>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x05>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x1e,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x05\00"
define void @t_isascii_0x05() {
%1 = call i32 @isascii(i32 5)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x05\00"
define void @t_isascii_0x05() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int unique_integers(int);
int main(void) {
  printf("Unique integers: %u\n", unique_integers(1000000));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Unique integers: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @unique_integers(i32 1000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char *);
void get_int_data(const char *file, const char *name, int *data) {
  int ncid, varid, status;
  char msg[512];
  error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define void @get_int_data(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%11 = call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define void @get_int_data(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
char lower(char c) {
  if ((c >= 'A') && (c <= 'Z'))
    c += ('a' - 'A');
  return c;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112e <lower+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     112e <lower+0x2e>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void __attribute__((weak)) dma1_channel1_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<dma1_channel1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_channel1_isr = [18 x i8] c"dma1_channel1_isr\00"
define weak void @dma1_channel1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_channel1_isr = [18 x i8] c"dma1_channel1_isr\00"
define weak void @dma1_channel1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel1_isr, i64 0, i64 0))
ret void
}
void initTwoPass() {}


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

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

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

LLVM IR (-O2):
define void @initTwoPass() {
ret void
}
int can_print_it(char ch) { return 1; }


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

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

LLVM IR (-O0):
define i32 @can_print_it(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @can_print_it(i8 signext %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void condition() { emitln("Condition"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Condition\00"
define void @condition() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n"
         "\t[OPTIONS] SOURCE... DEST\n"
         "\tCopy SOURCE(s) to DEST.\n"
         "\nOptions:\n"
         "\t-R,-r   Recursively copy\n");
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c"Usage:\0A\09[OPTIONS] SOURCE... DEST\0A\09Copy SOURCE(s) to DEST.\0A\0AOptions:\0A\09-R,-r Recursively copy\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [94 x i8] c"Usage:\0A\09[OPTIONS] SOURCE... DEST\0A\09Copy SOURCE(s) to DEST.\0A\0AOptions:\0A\09-R,-r Recursively copy\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str, i64 0, i64 0))
ret void
}
void getNumBitsInIp6Prefx() {}


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

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

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

LLVM IR (-O2):
define void @getNumBitsInIp6Prefx() {
ret void
}
void gtk_tree_view_insert_column_with_data_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_insert_column_with_data_func() {
ret void
}
int test_imm_46uint16_mem(unsigned short *val) {
  return ((*val) & (0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46uint16_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, 70
%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_46uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 70
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_34uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x34 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_34uint64_midword_reg>:
test   $0x340000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3407872
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void *identity(const char *key, void *data, void *arg) {
  (void)key;
  (void)data;
  return arg;
}


x86 assembly (clang, -O0):
<identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<identity>:
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @identity(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* readnone returned %2) {
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i = 10;
  i = i + 1;
  assert(i == 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 11
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
double fabs(double);
double sign(double a, double b) { return (b < 0.0) ? -fabs(a) : fabs(a); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114d <sign+0x4d>
movsd  -0x8(%rbp),%xmm0
movaps 0xed8(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1162 <sign+0x62>
movsd  -0x8(%rbp),%xmm0
movaps 0xea7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
movapd 0xef8(%rip),%xmm2
andpd  %xmm0,%xmm2
orpd   0xefc(%rip),%xmm0
xorpd  %xmm3,%xmm3
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load double, double* %3
%9 = call double @llvm.fabs.f64(double %8)
%10 = fneg double %9
br label %14
11: ; preds = %2
%12 = load double, double* %3
%13 = call double @llvm.fabs.f64(double %12)
br label %14
14: ; preds = %11, %7
%15 = phi double [ %10, %7 ], [ %13, %11 ]
ret double %15
}

LLVM IR (-O2):
define double @sign(double %0, double %1) {
%3 = fcmp olt double %1, 0.000000e+00
%4 = tail call double @llvm.fabs.f64(double %0)
%5 = fneg double %4
%6 = select i1 %3, double %5, double %4
ret double %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ subwindow;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xkey_subwindow(void *_p) {
  return (unsigned long)((XEvent *)_p)->xkey.subwindow;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xkey_subwindow>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xkey_subwindow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xkey_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_cvector(char *v, long nl) { free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_cvector>:
add    %rsi,%rdi
add    $0xffffffffffffffff,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_cvector(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @free_cvector(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
void *a7(int);
void *a6(int x) { return (((x >> 6) & 1) ? a7(x) : a7(x)); }


x86 assembly (clang, -O0):
<a6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a6+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a7@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a6+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a7@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a6>:
jmp    1030 <a7@plt>

LLVM IR (-O0):
define i8* @a6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a7(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a7(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a6(i32 %0) {
%2 = tail call i8* @a7(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *reallocf(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if ((p == NULL) && (ptr != NULL)) {
    free(ptr);
  }
  return p;
}


x86 assembly (clang, -O0):
<reallocf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <reallocf+0x40>
cmpq   $0x0,-0x8(%rbp)
je     1160 <reallocf+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1141 <reallocf+0x21>
test   %r14,%r14
jne    1141 <reallocf+0x21>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @reallocf(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %14, %11, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @reallocf(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i8* %0, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
void __attribute__((__unused__))
_hash_pthread_mtx_dtor_hnode_hh(void *m,
                                void *_HU_d __attribute__((__unused__))) {
  pthread_mutex_t *mtx = (pthread_mutex_t *)m;
  pthread_mutex_destroy(mtx);
  free(mtx);
}


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

x86 assembly (clang, -O2):
<_hash_pthread_mtx_dtor_hnode_hh>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_mutex_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @_hash_pthread_mtx_dtor_hnode_hh(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @pthread_mutex_destroy(i32* %8)
%10 = load i32*, i32** %5
%11 = call i32 @free(i32* %10)
ret void
}

LLVM IR (-O2):
define void @_hash_pthread_mtx_dtor_hnode_hh(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_mutex_destroy(i32* %3)
%5 = tail call i32 @free(i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getresuid(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(void) {
  gid_t ruid, euid, suid;
  return getresuid(&ruid, &euid, &suid);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <getresuid@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @getresuid(i32* %1, i32* %2, i32* %3)
ret i32 %7
}
int getlength(char *string) {
  int size = 0;
  while (string[++size] != '\x0')
    ;
  return size;
}


x86 assembly (clang, -O0):
<getlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <getlength+0x31>
jmp    110f <getlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlength>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <getlength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
int f(int a) {
  int *b[10];
  return a + b[10];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32*]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [10 x i32*], [10 x i32*]* %3, i64 0, i64 10
%6 = load i32*, i32** %5
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = ptrtoint i32* %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int booster_fstat64(int, void *);
int fstat64(int fd, void *buf) { return booster_fstat64(fd, buf); }


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

x86 assembly (clang, -O2):
<fstat64>:
jmp    1030 <booster_fstat64@plt>

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

LLVM IR (-O2):
define i32 @fstat64(i32 %0, i8* %1) {
%3 = tail call i32 @booster_fstat64(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetCreateGC() {
  printf("XESetCreateGC called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"XESetCreateGC called\00"
define i32 @XESetCreateGC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ riscv_fpu_init();
int /*<<< orphan*/ riscv_irq_init();
void riscv_init(void) {
  riscv_fpu_init();
  riscv_irq_init();
}


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

x86 assembly (clang, -O2):
<riscv_init>:
push   %rax
xor    %eax,%eax
call   1030 <riscv_fpu_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <riscv_irq_init@plt>

LLVM IR (-O0):
define void @riscv_init() {
%1 = call i32 (...) @riscv_fpu_init()
%2 = call i32 (...) @riscv_irq_init()
ret void
}

LLVM IR (-O2):
define void @riscv_init() {
%1 = tail call i32 (...) @riscv_fpu_init()
%2 = tail call i32 (...) @riscv_irq_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M109_f(char *s) {
  debug("M109_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M109_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M109_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M109_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M109_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M109_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M109_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
int /*<<< orphan*/ tfree(void *);
void *tmalloc(size_t);
void *trealloc(void *ptr, size_t size) {
  if (!ptr)
    return tmalloc(size);
  void *mem = tmalloc(size);
  memcpy(mem, ptr, size);
  tfree(ptr);
  return mem;
}


x86 assembly (clang, -O0):
<trealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <trealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1050 <tmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    118c <trealloc+0x5c>
mov    -0x18(%rbp),%rdi
call   1050 <tmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <tfree@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <tmalloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1161 <trealloc+0x31>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <tfree@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @trealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = tail call i8* @tmalloc(i64 %1)
br i1 %3, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%7 = tail call i32 @tfree(i8* %0)
br label %8
8: ; preds = %2, %5
ret i8* %4
}
unsigned int unsignedint_ignoring_signedshortint(unsigned int x,
                                                 signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedint_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedint_ignoring_signedshortint>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_signedshortint(i32 returned %0, i16 signext %1) {
ret i32 %0
}
double MyMin(double x, double y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<MyMin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <MyMin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <MyMin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @MyMin(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 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @MyMin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C12(void) { printf("Test3\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Test3\00"
define void @C12() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_convert_primary_reg_value_to_bool(void) { gen_call("__bool"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"__bool\00"
define void @gen_convert_primary_reg_value_to_bool() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *KineticCalloc(size_t count, size_t size) { return calloc(count, size); }


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

x86 assembly (clang, -O2):
<KineticCalloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @KineticCalloc(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 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @KineticCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ setPort(short, int);
void xsvfTmsTransition(short sTms) {
  setPort((short)1, sTms);
  setPort((short)0, 0);
  setPort((short)0, 1);
}


x86 assembly (clang, -O0):
<xsvfTmsTransition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%esi
mov    $0x1,%edi
call   1030 <setPort@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <setPort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsvfTmsTransition>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <setPort@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <setPort@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <setPort@plt>

LLVM IR (-O0):
define void @xsvfTmsTransition(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = call i32 @setPort(i16 signext 1, i32 %4)
%6 = call i32 @setPort(i16 signext 0, i32 0)
%7 = call i32 @setPort(i16 signext 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @xsvfTmsTransition(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = tail call i32 @setPort(i16 signext 1, i32 %2)
%4 = tail call i32 @setPort(i16 signext 0, i32 0)
%5 = tail call i32 @setPort(i16 signext 0, i32 1)
ret void
}