xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x7f() {
  Assert_real((isalpha(127) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              640, ("isalpha should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x7f\00"
define void @t_isalpha_0x7f() {
%1 = call i64 @isalpha(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x7f\00"
define void @t_isalpha_0x7f() {
%1 = tail call i64 @isalpha(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tv;
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
int settimeofday(struct timeval *, int /*<<< orphan*/ *);
int main(void) {
  struct timeval tv;
  (void)memset(&tv, 0, sizeof(tv));
  return settimeofday(&tv, NULL);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <settimeofday@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @memset(%struct.timeval* %2, i32 0, i32 4)
%4 = call i32 @settimeofday(%struct.timeval* %2, i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @memset(%struct.timeval* %1, i32 0, i32 4)
%4 = call i32 @settimeofday(%struct.timeval* %1, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_memory(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @free_memory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pintoHookFree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @pintoHookFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mpga_get_padding(const uint8_t *p_mpga) { return !!(p_mpga[2] & 0x02); }


x86 assembly (clang, -O0):
<mpga_get_padding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_padding>:
mov    0x8(%rdi),%eax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_padding(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mpga_get_padding(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int _searchInsert(int *, int, int, int /*<<< orphan*/, int);
int searchInsert(int *nums, int numsSize, int target) {
  return _searchInsert(nums, numsSize, target, 0, numsSize - 1);
}


x86 assembly (clang, -O0):
<searchInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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
mov    -0xc(%rbp),%r8d
sub    $0x1,%r8d
xor    %ecx,%ecx
call   1030 <_searchInsert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchInsert>:
lea    -0x1(%rsi),%r8d
xor    %ecx,%ecx
jmp    1030 <_searchInsert@plt>

LLVM IR (-O0):
define i32 @searchInsert(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = call i32 @_searchInsert(i32* %7, i32 %8, i32 %9, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @searchInsert(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_searchInsert(i32* %0, i32 %1, i32 %2, i32 0, i32 %4)
ret i32 %5
}
void PDMQueueInsertEx(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMQueueInsertEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_flist_new_with_name() {
  printf("NOT IMPLEMENTED:"
         "pa_flist_new_with_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_flist_new_with_name\0A\00"
define i32 @pa_flist_new_with_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_flist_new_with_name\00"
define i32 @pa_flist_new_with_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void _start() {
  _init_vita_newlib();
  __libc_init_array();
  exit(main(1, (const char *[]){"", 0}));
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <_init_vita_newlib@plt>
mov    $0x0,%al
call   1030 <__libc_init_array@plt>
lea    0xea3(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <main@plt>
mov    %eax,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <_init_vita_newlib@plt>
xor    %eax,%eax
call   1030 <__libc_init_array@plt>
lea    0xea7(%rip),%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <main@plt>
mov    %eax,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @_start() {
%1 = alloca [2 x i8*]
%2 = call i32 (...) @_init_vita_newlib()
%3 = call i32 (...) @__libc_init_array()
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* null, i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 1, i8** %6)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @_start() {
%1 = alloca [2 x i8*]
%2 = tail call i32 (...) @_init_vita_newlib()
%3 = tail call i32 (...) @__libc_init_array()
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %5
%6 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 1, i8** %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void syntax() { printf("ynattach [-c PROG] [-s SPEED] DEVICE\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"ynattach [-c PROG] [-s SPEED] DEVICE\0A\00"
define void @syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"ynattach [-c PROG] [-s SPEED] DEVICE\00"
define void @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int pow(int, int);
time_t timeout(int n) { return 15 * pow(2, n); }


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0xf,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout>:
push   %rax
mov    %edi,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pow(i32 2, i32 %3)
%5 = mul nsw i32 15, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @timeout(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 %0)
%3 = mul nsw i32 %2, 15
ret i32 %3
}
/* Variables and functions */
int strtol(char const *, char **, int);
int atoi(const char *nptr) { return strtol(nptr, (char **)((void *)0L), 10); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtol(i8* %3, i8** null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i32 %2
}
long myrandom(limit)
long limit;
{
  if (limit < 1)
    return (0);
  if (limit < 2)
    return (0);
  return (rand() % limit);
}


x86 assembly (clang, -O0):
<myrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jge    1134 <myrandom+0x24>
movq   $0x0,-0x8(%rbp)
jmp    115f <myrandom+0x4f>
cmpq   $0x2,-0x10(%rbp)
jge    114c <myrandom+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    115f <myrandom+0x4f>
mov    $0x0,%al
call   1030 <rand@plt>
cltq
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrandom>:
push   %rbx
cmp    $0x2,%rdi
jge    111b <myrandom+0xb>
xor    %eax,%eax
pop    %rbx
ret
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
mov    %rcx,%rdx
or     %rbx,%rdx
shr    $0x20,%rdx
je     1141 <myrandom+0x31>
mov    %rcx,%rax
cqto
idiv   %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @myrandom(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %16
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 0, i64* %2
br label %16
11: ; preds = %7
%12 = call i32 (...) @rand()
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = srem i64 %13, %14
store i64 %15, i64* %2
br label %16
16: ; preds = %11, %10, %6
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @myrandom(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand()
%5 = sext i32 %4 to i64
%6 = srem i64 %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 0, %1 ]
ret i64 %8
}
int is_digit(char ch) {
  int x = ch - '0';
  int y = ch - '9';
  if ((x >= 0) && (x <= 9) && (y >= -9) && (y <= 0))
    return 1;
  if (ch == '.')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x39,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1152 <is_digit+0x52>
cmpl   $0x9,-0xc(%rbp)
jg     1152 <is_digit+0x52>
cmpl   $0xfffffff7,-0x10(%rbp)
jl     1152 <is_digit+0x52>
cmpl   $0x0,-0x10(%rbp)
jg     1152 <is_digit+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1172 <is_digit+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    116b <is_digit+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <is_digit+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x2e,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %4
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 57
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %1
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 9
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp sge i32 %18, -9
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %5
%22 = icmp sle i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %30
24: ; preds = %20, %17, %14, %1
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 46
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %2
br label %30
29: ; preds = %24
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28, %23
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int foo(int *);
int main(void) {
  auto int n = 42;
  return foo(&n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2a,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 42, i32* %1
%3 = call i32 @foo(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ C_rereclaim2(long, int);
void C_rereclaim(long size) { C_rereclaim2(size < 0 ? -size : size, size < 0); }


x86 assembly (clang, -O0):
<C_rereclaim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1136 <C_rereclaim+0x26>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113e <C_rereclaim+0x2e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
cmpq   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%esi
call   1030 <C_rereclaim2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_rereclaim>:
mov    %rdi,%rsi
neg    %rdi
cmovs  %rsi,%rdi
shr    $0x3f,%rsi
jmp    1030 <C_rereclaim2@plt>

LLVM IR (-O0):
define void @C_rereclaim(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
%12 = load i64, i64* %2
%13 = icmp slt i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @C_rereclaim2(i64 %11, i32 %14)
ret void
}

LLVM IR (-O2):
define void @C_rereclaim(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%3 = lshr i64 %0, 63
%4 = trunc i64 %3 to i32
%5 = tail call i32 @C_rereclaim2(i64 %2, i32 %4)
ret void
}
_Bool CompareAndSwapPointer(void **val, void *old, void *new) {
  return __sync_bool_compare_and_swap(val, old, new);
}


x86 assembly (clang, -O0):
<CompareAndSwapPointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareAndSwapPointer>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @CompareAndSwapPointer(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 = bitcast i8** %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 1
ret i1 %14
}

LLVM IR (-O2):
define zeroext i1 @CompareAndSwapPointer(i8** nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 1
ret i1 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage:\n"
         "   this program converts from one text file format to another\n"
         "   - unix files use only 0x0A for newline\n"
         "   - macintosh files use 0x0D for newline\n"
         "   - msdos files use 0x0D 0x0A for newline\n"
         "   - syntax: crnl <from_format> <to_format> file [file ...]\n"
         "   - where 'format' is one of: -dos -unix -mac\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [304 x i8] c"usage:\0A this program converts from one text file format to another\0A - unix files use only 0x0A for newline\0A - macintosh files use 0x0D for newline\0A - msdos files use 0x0D 0x0A for newline\0A - syntax: crnl <from_format> <to_format> file [file ...]\0A - where 'format' is one of: -dos -unix -mac\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([304 x i8], [304 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [303 x i8] c"usage:\0A this program converts from one text file format to another\0A - unix files use only 0x0A for newline\0A - macintosh files use 0x0D for newline\0A - msdos files use 0x0D 0x0A for newline\0A - syntax: crnl <from_format> <to_format> file [file ...]\0A - where 'format' is one of: -dos -unix -mac\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([303 x i8], [303 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
main() {
  printf("hi %d\n", 1, 2);
  printf("hi %d %s\n", 2, "hi", 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
lea    0xed2(%rip),%rdx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xeda(%rip),%rdx
mov    $0x2,%esi
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"hi %d\0A\00"
@.str.1 = [10 x i8] c"hi %d %s\0A\00"
@.str.2 = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
struct p_lastlog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getllnam(char *);
struct p_lastlog *ll2p(int /*<<< orphan*/);
extern struct p_lastlog *p_getllnam(char *logname) {
  return ll2p(getllnam(logname));
}


x86 assembly (clang, -O0):
<p_getllnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getllnam@plt>
mov    %eax,%edi
call   1030 <ll2p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_getllnam>:
push   %rax
call   1040 <getllnam@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ll2p@plt>

LLVM IR (-O0):
%struct.p_lastlog = type { i32 }
define %struct.p_lastlog* @p_getllnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getllnam(i8* %3)
%5 = call %struct.p_lastlog* @ll2p(i32 %4)
ret %struct.p_lastlog* %5
}

LLVM IR (-O2):
%struct.p_lastlog = type { i32 }
define %struct.p_lastlog* @p_getllnam(i8* %0) {
%2 = tail call i32 @getllnam(i8* %0)
%3 = tail call %struct.p_lastlog* @ll2p(i32 %2)
ret %struct.p_lastlog* %3
}
int tcflow(int fildes, int action) {
  anvil_syslog(0, "%s unimplemented fd=%d action=%d\n", __FUNCTION__, fildes,
               action);
  return 0;
}


x86 assembly (clang, -O0):
<tcflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
xor    %edi,%edi
lea    0xed2(%rip),%rsi
lea    0xeed(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflow>:
push   %rax
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xee3(%rip),%rsi
lea    0xefe(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"%s unimplemented fd=%d action=%d\0A\00"
@__FUNCTION__.tcflow = [7 x i8] c"tcflow\00"
define i32 @tcflow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, i32, i32, ...)*)(i32 0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.tcflow, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s unimplemented fd=%d action=%d\0A\00"
@__FUNCTION__.tcflow = [7 x i8] c"tcflow\00"
define i32 @tcflow(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, i32, i32, ...)*)(i32 0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.tcflow, i64 0, i64 0), i32 %0, i32 %1)
ret i32 0
}
int get_socket_error(char *msg) {
  int err = 0;
  return err;
}


x86 assembly (clang, -O0):
<get_socket_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_socket_error(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dumpAddr(int /*<<< orphan*/ *, char *, int *);
void fun2(FILE *p) {
  int f2;
  dumpAddr(p, "&f2", &f2);
}


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

x86 assembly (clang, -O2):
<fun2>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <dumpAddr@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"&f2\00"
define void @fun2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @dumpAddr(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"&f2\00"
define void @fun2(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @dumpAddr(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
float ct_norm_cos(const float x) {
  const float x2 = x * x;
  return 1.0f + x2 * (-4.0f + 2.0f * x2);
}


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

x86 assembly (clang, -O2):
<ct_norm_cos>:
mulss  %xmm0,%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  0xeed(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ct_norm_cos(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %8, float -4.000000e+00)
%10 = call float @llvm.fmuladd.f32(float %7, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @ct_norm_cos(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 2.000000e+00, float -4.000000e+00)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 1.000000e+00)
ret float %4
}
void differing_name(int n) { return; }


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

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

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

LLVM IR (-O2):
define void @differing_name(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print_arg(int /*<<< orphan*/ *, char *const);
void print_argv(FILE *fp, char *const argv[]) {
  for (; *argv; argv++)
    print_arg(fp, *argv);
}


x86 assembly (clang, -O0):
<print_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <print_argv+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <print_arg@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <print_argv+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_argv>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <print_argv+0x34>
mov    %rdi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <print_arg@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <print_argv+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @print_argv(i32* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i8** [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @print_arg(i32* %0, i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
char *abi();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", abi());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @abi()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t op_add(uint32_t a, uint32_t b) { return a + b; }


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

x86 assembly (clang, -O2):
<op_add>:
lea    (%rdi,%rsi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @op_add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
unsigned long po2(int i) {
  if (i <= 0)
    return 1;
  return 2 * po2(i - 1);
}


x86 assembly (clang, -O0):
<po2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1132 <po2+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1145 <po2+0x35>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <po2@plt>
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<po2>:
test   %edi,%edi
jle    1125 <po2+0x15>
push   %rax
add    $0xffffffff,%edi
call   1030 <po2@plt>
add    %rax,%rax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @po2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %8, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i64 @po2(i32 %6)
%8 = shl i64 %7, 1
br label %3
}
long long int longlongint_ignoring_signedlong(long long int x, signed long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_signedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int strcmp(char *, char *);
int stringComp(char *a1, char *a2) { return strcmp(a1, a2); }


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

x86 assembly (clang, -O2):
<stringComp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @stringComp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int **, int **, int, int);
void g(int *r, int a[16][16], int b[16][16], int i, int j) { f(r, a, b, i, j); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g(i32* %0, [16 x i32]* %1, [16 x i32]* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca [16 x i32]*
%8 = alloca [16 x i32]*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store [16 x i32]* %1, [16 x i32]** %7
store [16 x i32]* %2, [16 x i32]** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load [16 x i32]*, [16 x i32]** %7
%13 = bitcast [16 x i32]* %12 to i32**
%14 = load [16 x i32]*, [16 x i32]** %8
%15 = bitcast [16 x i32]* %14 to i32**
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i32 @f(i32* %11, i32** %13, i32** %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @g(i32* %0, [16 x i32]* %1, [16 x i32]* %2, i32 %3, i32 %4) {
%6 = bitcast [16 x i32]* %1 to i32**
%7 = bitcast [16 x i32]* %2 to i32**
%8 = tail call i32 @f(i32* %0, i32** %6, i32** %7, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_of_mem();
char *strdup(char const *);
char *xstrdup(char const *str) {
  char *ptr;
  if (str == NULL)
    str = "";
  ptr = strdup(str);
  if (ptr == NULL)
    out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <xstrdup+0x22>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <xstrdup+0x41>
mov    $0x0,%al
call   1040 <out_of_mem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
test   %rdi,%rdi
lea    0xed5(%rip),%rax
cmove  %rax,%rdi
call   1030 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xstrdup+0x23>
xor    %eax,%eax
call   1040 <out_of_mem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** %2
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (...) @out_of_mem()
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i8* @strdup(i8* %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @out_of_mem()
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void rtadv_init() { ; }


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

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

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

LLVM IR (-O2):
define void @rtadv_init() {
ret void
}
/* Variables and functions */
void *Athena_AssureCapacity(void *, unsigned int, unsigned int, unsigned int *);
void *Athena_AddOneCapacity(void *data, unsigned element_size, unsigned *size,
                            unsigned *capacity) {
  size[0]++;
  return Athena_AssureCapacity(data, element_size, *size, capacity);
}


x86 assembly (clang, -O0):
<Athena_AddOneCapacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
call   1030 <Athena_AssureCapacity@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Athena_AddOneCapacity>:
mov    (%rdx),%eax
add    $0x1,%eax
mov    %eax,(%rdx)
mov    %eax,%edx
jmp    1030 <Athena_AssureCapacity@plt>

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

LLVM IR (-O2):
define i8* @Athena_AddOneCapacity(i8* %0, i32 %1, i32* nocapture %2, i32* %3) {
%5 = load i32, i32* %2
%6 = add i32 %5, 1
store i32 %6, i32* %2
%7 = tail call i8* @Athena_AssureCapacity(i8* %0, i32 %1, i32 %6, i32* %3)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ GetTile(int, int, int *);
int get_map_tile(int x, int y) {
  int tileId;
  GetTile(x, y, &tileId);
  return tileId;
}


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

x86 assembly (clang, -O2):
<get_map_tile>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <GetTile@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_map_tile(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @GetTile(i32 %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
int add3(int a[][2]) { return a[0][0] + a[1][0]; }


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

x86 assembly (clang, -O2):
<add3>:
mov    0x8(%rdi),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @add3([2 x i32]* nocapture %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
ret i32 %6
}
void c2i_ASN1_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @c2i_ASN1_INTEGER() {
ret void
}
void umocktypes_free_int(int *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_int(i32* nocapture %0) {
ret void
}
float add_float(float x, float y) { return x + y; }


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

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

LLVM IR (-O0):
define float @add_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @add_float(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
scalar_t__ testa_primo(unsigned int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int gera_primo() {
  unsigned int num = 10;
  srand(time(NULL));
  while (testa_primo(num) != 0) {
    num = rand() % 4294967295;
  }
  return num;
}


x86 assembly (clang, -O0):
<gera_primo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    -0x4(%rbp),%edi
call   1050 <testa_primo@plt>
cmp    $0x0,%rax
je     118e <gera_primo+0x4e>
mov    $0x0,%al
call   1060 <rand@plt>
cltq
mov    $0xffffffff,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <gera_primo+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gera_primo>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0xa,%ebx
mov    $0xa,%edi
nopl   0x0(%rax)
call   1050 <testa_primo@plt>
test   %rax,%rax
je     1177 <gera_primo+0x37>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%ebx
mov    %eax,%edi
jmp    1160 <gera_primo+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gera_primo() {
%1 = alloca i32
store i32 10, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %1
%6 = call i64 @testa_primo(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @rand()
%10 = sext i32 %9 to i64
%11 = srem i64 %10, 4294967295
%12 = trunc i64 %11 to i32
store i32 %12, i32* %1
br label %4
13: ; preds = %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @gera_primo() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i64 @testa_primo(i32 10)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = tail call i32 (...) @rand()
%7 = tail call i64 @testa_primo(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %0
%10 = phi i32 [ 10, %0 ], [ %6, %5 ]
ret i32 %10
}