xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ add1(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ voided();
void stuff(void) {
  add1(2);
  printf("Your head a splode.\n");
  (void)voided();
}


x86 assembly (clang, -O0):
<stuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <add1@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <voided@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stuff>:
push   %rax
mov    $0x2,%edi
call   1040 <add1@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <voided@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Your head a splode.\0A\00"
define void @stuff() {
%1 = call i32 @add1(i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @voided()
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Your head a splode.\00"
define void @stuff() {
%1 = tail call i32 @add1(i32 2)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @voided()
ret void
}
int getIntValue(char charValue) { return (charValue - '0'); }


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

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

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

LLVM IR (-O2):
define i32 @getIntValue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
void B_init() {}


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

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

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

LLVM IR (-O2):
define void @B_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_xch_Rn(char *str, unsigned char n) {
  sprintf(str, "XCH   A, R%X                     ", n);
}


x86 assembly (clang, -O0):
<sprint_xch_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_xch_Rn>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"XCH A, R%X \00"
define void @sprint_xch_Rn(i8* %0, i8 zeroext %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 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"XCH A, R%X \00"
define void @sprint_xch_Rn(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x97() {
  Assert_real((isspace(151) == 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_isspace.c",
              760, ("isspace should be 0 for 0x97"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x97>:
push   %rax
mov    $0x97,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f8,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x97\00"
define void @t_isspace_0x97() {
%1 = call i64 @isspace(i32 151)
%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 760, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x97\00"
define void @t_isspace_0x97() {
%1 = tail call i64 @isspace(i32 151)
%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 760, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sudoku_slot_id_from_rowcol(int row, int col) { return row * 9 + col; }


x86 assembly (clang, -O0):
<sudoku_slot_id_from_rowcol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x9,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudoku_slot_id_from_rowcol>:
lea    (%rdi,%rdi,8),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @sudoku_slot_id_from_rowcol(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 = mul nsw i32 %5, 9
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @sudoku_slot_id_from_rowcol(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 9
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *strtok(char *restrict s1, const char *restrict s2) {
  (void)s1;
  (void)s2;
  puts("strtok: not implemented");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"strtok: not implemented\00"
define i8* @strtok(i8* noalias %0, i8* noalias %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 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [24 x i8] c"strtok: not implemented\00"
define noalias i8* @strtok(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int atoi(char const *);
int is_valid_port(const char *s) {
  int port = atoi(s);
  if (port < 1 || port > 0xffff)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     113f <is_valid_port+0x2f>
cmpl   $0xffff,-0x14(%rbp)
jle    114b <is_valid_port+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <is_valid_port+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_port>:
push   %rax
call   1030 <atoi@plt>
add    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0xffff,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_valid_port(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 65535
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 0, i32* %2
br label %14
13: ; preds = %9
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_valid_port(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 65535
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef size_t regoff_t;

/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *substring(const char *string, regoff_t start, regoff_t end) {
  char *new_string = malloc(end - start);
  memcpy(new_string, &string[start], end - start);
  return new_string;
}


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

x86 assembly (clang, -O2):
<substring>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
sub    %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
add    %r14,%r15
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @substring(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = sub i64 %8, %9
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = sub i64 %16, %17
%19 = call i32 @memcpy(i8* %12, i8* %15, i64 %18)
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
define i8* @substring(i8* %0, i64 %1, i64 %2) {
%4 = sub i64 %2, %1
%5 = tail call i8* @malloc(i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %1
%7 = tail call i32 @memcpy(i8* %5, i8* %6, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ standend();
void cleanup(void) {
  standend();
  refresh();
  curs_set(1);
  endwin();
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <standend@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x1,%edi
call   1060 <curs_set@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <standend@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
mov    $0x1,%edi
call   1060 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <endwin@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 (...) @standend()
%2 = call i32 (...) @refresh()
%3 = call i32 @curs_set(i32 1)
%4 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @standend()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 @curs_set(i32 1)
%4 = tail call i32 (...) @endwin()
ret void
}
int g_or(int a, int b) { return a || b; }


x86 assembly (clang, -O0):
<g_or>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <g_or+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_or>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @g_or(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_or(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void free_prog(char **prog) {
  unsigned int i;
  for (i = 0; prog[i] != ((void *)0); i++)
    av_free(prog[i]);
  av_free(prog);
}


x86 assembly (clang, -O0):
<free_prog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <free_prog+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <av_free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <free_prog+0x13>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <av_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_prog>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1145 <free_prog+0x35>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <av_free@plt>
mov    %ebp,%eax
mov    (%rbx,%rax,8),%rdi
add    $0x1,%ebp
test   %rdi,%rdi
jne    1130 <free_prog+0x20>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <av_free@plt>

LLVM IR (-O0):
define void @free_prog(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @av_free to i32 (i8*, ...)*)(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i8**, i8*** %2
%23 = call i32 (i8**, ...) bitcast (i32 (...)* @av_free to i32 (i8**, ...)*)(i8** %22)
ret void
}

LLVM IR (-O2):
define void @free_prog(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @av_free to i32 (i8*, ...)*)(i8* %5)
%8 = add i32 %6, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = tail call i32 (i8**, ...) bitcast (i32 (...)* @av_free to i32 (i8**, ...)*)(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Not expected - Caught signal\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Not expected - Caught signal\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Not expected - Caught signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int simin(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<simin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <simin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <simin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @simin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct gg_search_request {
  int dummy;
};

/* Variables and functions */
const struct gg_search_request *
gg_search_request_mode_2(char *phone, int active, int start) {
  return NULL;
}


x86 assembly (clang, -O0):
<gg_search_request_mode_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gg_search_request = type { i32 }
define %struct.gg_search_request* @gg_search_request_mode_2(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret %struct.gg_search_request* null
}

LLVM IR (-O2):
%struct.gg_search_request = type { i32 }
define noalias %struct.gg_search_request* @gg_search_request_mode_2(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret %struct.gg_search_request* null
}
int ap9540_c2c_deep_debug_init(struct ap9540_c2c *c2c_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ap9540_c2c = type opaque
define i32 @ap9540_c2c_deep_debug_init(%struct.ap9540_c2c* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_fail_add_test();
void test_fail_add_test_constructor(void) { test_fail_add_test(); }


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

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

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

LLVM IR (-O2):
define void @test_fail_add_test_constructor() {
%1 = tail call i32 (...) @test_fail_add_test()
ret void
}
int fun521() { return 521; }


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

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

LLVM IR (-O0):
define i32 @fun521() {
ret i32 521
}

LLVM IR (-O2):
define i32 @fun521() {
ret i32 521
}
/* Variables and functions */
int /*<<< orphan*/ value_to_integer(char *, char *, int);
void money_to_integer(char money[], char integer[]) {
  value_to_integer(money, integer, 8);
}


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

x86 assembly (clang, -O2):
<money_to_integer>:
mov    $0x8,%edx
jmp    1030 <value_to_integer@plt>

LLVM IR (-O0):
define void @money_to_integer(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 @value_to_integer(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @money_to_integer(i8* %0, i8* %1) {
%3 = tail call i32 @value_to_integer(i8* %0, i8* %1, i32 8)
ret void
}
void ptrace_sandbox_permit_fchown(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_fchown(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Type definitions */
struct memwb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ writeback(struct memwb *);
void *writebackvoid(void *memwb_void) {
  writeback((struct memwb *)memwb_void);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.memwb = type { i32 }
define i8* @writebackvoid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.memwb*
%5 = call i32 @writeback(%struct.memwb* %4)
ret i8* null
}

LLVM IR (-O2):
%struct.memwb = type { i32 }
define noalias i8* @writebackvoid(i8* %0) {
%2 = bitcast i8* %0 to %struct.memwb*
%3 = tail call i32 @writeback(%struct.memwb* %2)
ret i8* null
}
void out_of_memory(char *file_name, char *func_name, int line_no) {
  error("fatal error: out of memory in file %s(%d), function %s", file_name,
        line_no, func_name);
  error_done();
  exit(-1);
}


x86 assembly (clang, -O0):
<out_of_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <error_done@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<out_of_memory>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <error@plt>
xor    %eax,%eax
call   1030 <error_done@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"fatal error: out of memory in file %s(%d), function %s\00"
define void @out_of_memory(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @error_done()
unreachable
}

LLVM IR (-O2):
@.str = [55 x i8] c"fatal error: out of memory in file %s(%d), function %s\00"
define void @out_of_memory(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
%5 = tail call i32 (...) @error_done()
tail call void @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strichr(int /*<<< orphan*/, int /*<<< orphan*/);
int strlen(char const *);
void stristr(char *dst, const char *p) {
  int i;
  for (i = strlen(p); i > 0; i--)
    strichr(dst++, *p++);
}


x86 assembly (clang, -O0):
<stristr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    117c <stristr+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <strichr@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <stristr+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stristr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    115a <stristr+0x3a>
mov    %eax,%ebp
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%r14),%esi
add    $0x1,%r14
mov    %ebx,%edi
call   1030 <strichr@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebx
cmp    $0x1,%ebp
ja     1140 <stristr+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @stristr(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** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = ptrtoint i8* %12 to i32
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = call i32 @strichr(i32 %14, i32 %18)
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @stristr(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %2, %5
%6 = phi i32 [ %16, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = ptrtoint i8* %8 to i64
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = tail call i32 @strichr(i32 %11, i32 %14)
%16 = add nsw i32 %6, -1
%17 = icmp ugt i32 %6, 1
br i1 %17, label %5, label %18
18: ; preds = %5, %2
ret void
}
/* Type definitions */
struct hostent {
  scalar_t__ *h_addr_list;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ herror(char *);
unsigned long resolve(char *hostname) {
  struct hostent *hp;
  if ((hp = gethostbyname(hostname)) == NULL) {
    herror("gethostbyname failed:(");
    exit(-1);
  }
  return *(unsigned long *)hp->h_addr_list[0];
}


x86 assembly (clang, -O0):
<resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <resolve+0x39>
lea    0xea6(%rip),%rdi
call   1040 <herror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     1146 <resolve+0x16>
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
pop    %rcx
ret
lea    0xeb3(%rip),%rdi
call   1040 <herror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.hostent = type { i64* }
@.str = [23 x i8] c"gethostbyname failed:(\00"
define i64 @resolve(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.hostent* @gethostbyname(i8* %4)
store %struct.hostent* %5, %struct.hostent** %3
%6 = icmp eq %struct.hostent* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @herror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %3
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64*, i64** %12
%14 = getelementptr inbounds i64, i64* %13, i64 0
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to i64*
%17 = load i64, i64* %16
ret i64 %17
}

LLVM IR (-O2):
%struct.hostent = type { i64* }
@.str = [23 x i8] c"gethostbyname failed:(\00"
define i64 @resolve(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @herror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
%8 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%9 = load i64*, i64** %8
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i64*
%12 = load i64, i64* %11
ret i64 %12
}
/* Variables and functions */
scalar_t__ tan(double);
long double tanl(long double x) { return (long double)tan((double)x); }


x86 assembly (clang, -O0):
<tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <tan@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <tan@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @tan(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @tan(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int wr_test(char const *, int, int, int /*<<< orphan*/, int);
int test_wr_exist(const char *file) { return wr_test(file, 16, 26, 0, 0777); }


x86 assembly (clang, -O0):
<test_wr_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
mov    $0x1ff,%r8d
call   1030 <wr_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wr_exist>:
mov    $0x10,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
mov    $0x1ff,%r8d
jmp    1030 <wr_test@plt>

LLVM IR (-O0):
define i32 @test_wr_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @wr_test(i8* %3, i32 16, i32 26, i32 0, i32 511)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_wr_exist(i8* %0) {
%2 = tail call i32 @wr_test(i8* %0, i32 16, i32 26, i32 0, i32 511)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int nondet();
void main() {
  int i, p, q;
  int n;
  n = nondet();
  q = nondet();
  p = q;
  i = 0;
  for (; i < n; i++) {
    p++;
  }
  assert(p == q + i);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116c <main+0x4c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <main+0x29>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x4(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @nondet()
store i32 %5, i32* %4
%6 = call i32 (...) @nondet()
store i32 %6, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %2
store i32 0, i32* %1
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %1
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %15
15: ; preds = %12
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %8
18: ; preds = %8
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = load i32, i32* %1
%22 = add nsw i32 %20, %21
%23 = icmp eq i32 %19, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @nondet()
%2 = tail call i32 (...) @nondet()
%3 = icmp sgt i32 %1, 0
%4 = select i1 %3, i32 %1, i32 0
%5 = select i1 %3, i32 %1, i32 0
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
__attribute__((__weak__, __always___)) int
softboundcets_rename(const char *old_path, const char *new_path) {
  return rename(old_path, new_path);
}


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

x86 assembly (clang, -O2):
<softboundcets_rename>:
jmp    1030 <rename@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_rename(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 @rename(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundcets_rename(i8* %0, i8* %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct pico_mqtt_packet {
  int dummy;
};
struct pico_mqtt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_packet(struct pico_mqtt_packet *);
int handle_pingresp(struct pico_mqtt *mqtt, struct pico_mqtt_packet *packet) {
  do {
  } while (0);
  do {
  } while (0);
  destroy_packet(packet);
  return 0;
}


x86 assembly (clang, -O0):
<handle_pingresp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1125 <handle_pingresp+0x15>
jmp    112a <handle_pingresp+0x1a>
jmp    112f <handle_pingresp+0x1f>
mov    -0x10(%rbp),%rdi
call   1030 <destroy_packet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_pingresp>:
push   %rax
mov    %rsi,%rdi
call   1030 <destroy_packet@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_pingresp(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1) {
%3 = alloca %struct.pico_mqtt*
%4 = alloca %struct.pico_mqtt_packet*
store %struct.pico_mqtt* %0, %struct.pico_mqtt** %3
store %struct.pico_mqtt_packet* %1, %struct.pico_mqtt_packet** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = load %struct.pico_mqtt_packet*, %struct.pico_mqtt_packet** %4
%10 = call i32 @destroy_packet(%struct.pico_mqtt_packet* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_pingresp(%struct.pico_mqtt* nocapture readnone %0, %struct.pico_mqtt_packet* %1) {
%3 = tail call i32 @destroy_packet(%struct.pico_mqtt_packet* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ugl_AddBytecode(int);
void ugl_bytecode_remove_arg_stack(int arg_cnt) {
  while (arg_cnt > 16) {
    ugl_AddBytecode((0x04) | 0x0f0);
    arg_cnt -= 16;
  }
  if (arg_cnt > 0) {
    arg_cnt--;
    ugl_AddBytecode((0x04) | (arg_cnt << 4));
  }
}


x86 assembly (clang, -O0):
<ugl_bytecode_remove_arg_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jle    113d <ugl_bytecode_remove_arg_stack+0x2d>
mov    $0xf4,%edi
call   1030 <ugl_AddBytecode@plt>
mov    -0x4(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <ugl_bytecode_remove_arg_stack+0xb>
cmpl   $0x0,-0x4(%rbp)
jle    115e <ugl_bytecode_remove_arg_stack+0x4e>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
or     $0x4,%edi
call   1030 <ugl_AddBytecode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugl_bytecode_remove_arg_stack>:
push   %rbx
cmp    $0x11,%edi
jl     1136 <ugl_bytecode_remove_arg_stack+0x26>
mov    %edi,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xf4,%edi
call   1030 <ugl_AddBytecode@plt>
lea    -0x10(%rbx),%edi
cmp    $0x20,%ebx
mov    %edi,%ebx
ja     1120 <ugl_bytecode_remove_arg_stack+0x10>
jmp    113a <ugl_bytecode_remove_arg_stack+0x2a>
test   %edi,%edi
jle    1146 <ugl_bytecode_remove_arg_stack+0x36>
shl    $0x4,%edi
add    $0xfffffff4,%edi
pop    %rbx
jmp    1030 <ugl_AddBytecode@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ugl_bytecode_remove_arg_stack(i32 %0) {
%2 = icmp sgt i32 %0, 16
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @ugl_AddBytecode(i32 244)
%6 = add nsw i32 %4, -16
%7 = icmp ugt i32 %4, 32
br i1 %7, label %3, label %10
8: ; preds = %1
%9 = icmp sgt i32 %0, 0
br i1 %9, label %10, label %15
10: ; preds = %3, %8
%11 = phi i32 [ %0, %8 ], [ %6, %3 ]
%12 = shl nuw nsw i32 %11, 4
%13 = add nsw i32 %12, -12
%14 = tail call i32 @ugl_AddBytecode(i32 %13)
br label %15
15: ; preds = %10, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sleep(int);
int main() {
  sleep(5);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call i32 @exit(i32 1)
unreachable
}
void CRYPTO_set_dynlock_destroy_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_set_dynlock_destroy_callback() {
ret void
}
int time_diff(int jul1, int secs1, int jul2, int secs2) {
  return 86400 * (jul1 - jul2) + (secs1 - secs2);
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   $0x15180,%eax,%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
sub    %edx,%edi
imul   $0x15180,%edi,%eax
sub    %ecx,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @time_diff(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = mul nsw i32 86400, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @time_diff(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, 86400
%7 = sub i32 %1, %3
%8 = add nsw i32 %7, %6
ret i32 %8
}
double floating_point_message2_signal1_decode(float value) {
  return ((double)value);
}


x86 assembly (clang, -O0):
<floating_point_message2_signal1_decode>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating_point_message2_signal1_decode>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floating_point_message2_signal1_decode(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @floating_point_message2_signal1_decode(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int main() {
  adainit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <adainit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
ret i32 0
}
int indep1(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @indep1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void swap2(int *a, int *b) { *a = *a + *b - (*b = *a); }


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

x86 assembly (clang, -O2):
<swap2>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %eax,(%rsi)
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @swap2(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = sub nsw i32 %9, %11
%14 = load i32*, i32** %3
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @swap2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %3, i32* %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PAPI_shutdown();
void PAPIF_SHUTDOWN(void) { PAPI_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @PAPIF_SHUTDOWN() {
%1 = tail call i32 (...) @PAPI_shutdown()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ testmain();
int main() {
  testmain();
  printf(isatty(fileno(stdout)) ? "\e[32mOK\e[0m\n" : "OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <testmain@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1060 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
mov    %rax,%rcx
lea    0xe98(%rip),%rdi
lea    0xe84(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testmain@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1060 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
lea    0xea6(%rip),%rax
lea    0xe92(%rip),%rdi
cmove  %rax,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"\1B[32mOK\1B[0m\0A\00"
@.str.1 = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testmain()
%3 = load i32, i32* @stdout
%4 = call i32 @fileno(i32 %3)
%5 = call i64 @isatty(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"\1B[32mOK\1B[0m\0A\00"
@.str.1 = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @testmain()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fileno(i32 %2)
%4 = tail call i64 @isatty(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
void sgi_set_xcyl(void) {}


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

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

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

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