xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t default_comparator(const void *a, const void *b) {
  if (a == b) {
    return 0;
  } else {
    return a > b ? 1 : -1;
  }
}


x86 assembly (clang, -O0):
<default_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <default_comparator+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1141 <default_comparator+0x41>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @default_comparator(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int tg_streq(char *s1, char *s2) { return (!strcmp(s1, s2) ? 1 : 0); }


x86 assembly (clang, -O0):
<tg_streq>:
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>
cmp    $0x0,%eax
setne  %dl
xor    $0xff,%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tg_streq(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)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @tg_streq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ log_init(char *, int);
int /*<<< orphan*/ testSplaytree();
int main(int argc, const char *argv[]) {
  log_init("debug.log", 0x01);
  testSplaytree();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x1,%esi
call   1030 <log_init@plt>
mov    $0x0,%al
call   1040 <testSplaytree@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <log_init@plt>
xor    %eax,%eax
call   1040 <testSplaytree@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"debug.log\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @log_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = call i32 (...) @testSplaytree()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"debug.log\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @log_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 (...) @testSplaytree()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int modc_load_plugin(char *path) { return path == NULL; }


x86 assembly (clang, -O0):
<modc_load_plugin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modc_load_plugin>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @modc_load_plugin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @modc_load_plugin(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void ExttTemplateSetAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttTemplateSetAuxTable() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int endian_fix32(int);
uint64_t endian_fix64(uint64_t x) {
  return endian_fix32(x >> 32) + ((uint64_t)endian_fix32(x) << 32);
}


x86 assembly (clang, -O0):
<endian_fix64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <endian_fix32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <endian_fix32@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_fix64>:
push   %rbx
mov    %edi,%ebx
call   1030 <endian_fix32@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <endian_fix32@plt>

LLVM IR (-O0):
define i32 @endian_fix64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = call i32 @endian_fix32(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @endian_fix32(i32 %6)
%8 = shl i32 %7, 32
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian_fix64(i32 %0) {
%2 = tail call i32 @endian_fix32(i32 poison)
%3 = tail call i32 @endian_fix32(i32 %0)
ret i32 poison
}
void stop_one() {}


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

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

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

LLVM IR (-O2):
define void @stop_one() {
ret void
}
int uvl_load_module_for_lib(char *lib_name) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store_u32(uint8_t *buf, uint32_t val) { memcpy(buf, &val, sizeof(val)); }


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

x86 assembly (clang, -O2):
<store_u32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store_u32(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store_u32(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
void null_endofword(char *word) {
  while (*word && *word != ' ' && *word != '\t')
    word++;
  *word = '\0';
}


x86 assembly (clang, -O0):
<null_endofword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <null_endofword+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <null_endofword+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <null_endofword+0x52>
jmp    1163 <null_endofword+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <null_endofword+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_endofword>:
movabs $0x100000201,%rax
jmp    1114 <null_endofword+0x14>
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1110 <null_endofword+0x10>
bt     %rcx,%rax
jae    1110 <null_endofword+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @null_endofword(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %20, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 9
br label %18
18: ; preds = %13, %8, %3
%19 = phi i1 [ false, %8 ], [ false, %3 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %3
23: ; preds = %18
%24 = load i8*, i8** %2
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
define void @null_endofword(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
store i8 0, i8* %3
ret void
}
char *unsafe_symbol(const char *text) { return (char *)text; }


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

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

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

LLVM IR (-O2):
define i8* @unsafe_symbol(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void drop(void *pointer) {
  free(pointer);
  pointer = NULL;
}


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

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

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

LLVM IR (-O2):
define void @drop(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ append(char *, char *);
int isSubstring(int /*<<< orphan*/, char *);
int isRotation(char str1[], char str2[]) {
  return isSubstring(append(str2, str2), str1);
}


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

x86 assembly (clang, -O2):
<isRotation>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <append@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <isSubstring@plt>

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

LLVM IR (-O2):
define i32 @isRotation(i8* %0, i8* %1) {
%3 = tail call i32 @append(i8* %1, i8* %1)
%4 = tail call i32 @isSubstring(i32 %3, i8* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void my_fb_unmap(void *shm_buf) { munmap(shm_buf, 320 * 200 * 3); }


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

x86 assembly (clang, -O2):
<my_fb_unmap>:
mov    $0x2ee00,%esi
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @my_fb_unmap(i8* %0) {
%2 = tail call i32 @munmap(i8* %0, i32 192000)
ret void
}
void g(int *x, int y) { *x = *x + y; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @g(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 = add nsw i32 %6, %7
%9 = load i32*, i32** %3
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @g(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void kotlinclib_print_string(char *message) { printf("%s", message); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @kotlinclib_print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
char *gettext(char *);
int /*<<< orphan*/ print_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(void) {
  const char *program = "ypwhich";
  print_usage(stderr);
  fprintf(stderr,
          gettext("Try `%s --help' or `%s --usage' for more information.\n"),
          program, program);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1050 <print_usage@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <gettext@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1050 <print_usage@plt>
mov    (%rbx),%ebx
lea    0xec0(%rip),%rdi
call   1030 <gettext@plt>
lea    0xeac(%rip),%rcx
mov    %ebx,%edi
mov    %rax,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ypwhich\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = alloca i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stderr
%3 = call i32 @print_usage(i32 %2)
%4 = load i32, i32* @stderr
%5 = call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32 %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ypwhich\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"Try `%s --help' or `%s --usage' for more information.\0A\00"
define void @print_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @print_usage(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i8* @gettext(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32 %3, i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void INT_Excep_POE_OEI3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_POE_OEI3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nested_vectors_with_constant_indices();
int /*<<< orphan*/ nested_vectors_with_int_expression_indices();
int /*<<< orphan*/ nested_vectors_with_int_variable_indices();
int /*<<< orphan*/ nested_vectors_with_pre_increment_indicies();
int /*<<< orphan*/ pointer_arithmetic();
int /*<<< orphan*/ strings_with_constant_indices();
int main() {
  nested_vectors_with_constant_indices();
  nested_vectors_with_int_variable_indices();
  nested_vectors_with_int_expression_indices();
  nested_vectors_with_pre_increment_indicies();
  strings_with_constant_indices();
  pointer_arithmetic();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <nested_vectors_with_constant_indices@plt>
mov    $0x0,%al
call   1050 <nested_vectors_with_int_variable_indices@plt>
mov    $0x0,%al
call   1080 <nested_vectors_with_int_expression_indices@plt>
mov    $0x0,%al
call   1040 <nested_vectors_with_pre_increment_indicies@plt>
mov    $0x0,%al
call   1030 <strings_with_constant_indices@plt>
mov    $0x0,%al
call   1060 <pointer_arithmetic@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <nested_vectors_with_constant_indices@plt>
xor    %eax,%eax
call   1050 <nested_vectors_with_int_variable_indices@plt>
xor    %eax,%eax
call   1080 <nested_vectors_with_int_expression_indices@plt>
xor    %eax,%eax
call   1040 <nested_vectors_with_pre_increment_indicies@plt>
xor    %eax,%eax
call   1030 <strings_with_constant_indices@plt>
xor    %eax,%eax
call   1060 <pointer_arithmetic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @nested_vectors_with_constant_indices()
%2 = call i32 (...) @nested_vectors_with_int_variable_indices()
%3 = call i32 (...) @nested_vectors_with_int_expression_indices()
%4 = call i32 (...) @nested_vectors_with_pre_increment_indicies()
%5 = call i32 (...) @strings_with_constant_indices()
%6 = call i32 (...) @pointer_arithmetic()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nested_vectors_with_constant_indices()
%2 = tail call i32 (...) @nested_vectors_with_int_variable_indices()
%3 = tail call i32 (...) @nested_vectors_with_int_expression_indices()
%4 = tail call i32 (...) @nested_vectors_with_pre_increment_indicies()
%5 = tail call i32 (...) @strings_with_constant_indices()
%6 = tail call i32 (...) @pointer_arithmetic()
ret i32 0
}
void XSyncValueAdd() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueAdd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: myat [-q] YYYY-MM-DD [HH:MM]\n");
  fprintf(stderr, "       myat [-q] HH:MM      (assumes today)\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: myat [-q] YYYY-MM-DD [HH:MM]\0A\00"
@.str.1 = [45 x i8] c" myat [-q] HH:MM (assumes today)\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EX_USAGE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: myat [-q] YYYY-MM-DD [HH:MM]\0A\00"
@.str.1 = [45 x i8] c" myat [-q] HH:MM (assumes today)\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EX_USAGE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ rt_exit();
void kill_handler(int signum) {
  rt_exit();
  exit(0);
}


x86 assembly (clang, -O0):
<kill_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rt_exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<kill_handler>:
push   %rax
xor    %eax,%eax
call   1030 <rt_exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @kill_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rt_exit()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @kill_handler(i32 %0) {
%2 = tail call i32 (...) @rt_exit()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EOF;
int getchar();
int lower(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    printf("%c", lower(c));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <main+0x43>
mov    -0x8(%rbp),%edi
call   1050 <lower@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     116d <main+0x3d>
lea    0xeb2(%rip),%rbx
xchg   %ax,%ax
mov    %eax,%edi
call   1050 <lower@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @lower(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @lower(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showHelp() { printf("Usage: dwn [-a download_addr] <-f filename>\n"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: dwn [-a download_addr] <-f filename>\0A\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"Usage: dwn [-a download_addr] <-f filename>\00"
define void @showHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(void *);
int /*<<< orphan*/ foo(void *);
void test(void *p) {
  if (!p)
    foo(p);
  else
    bar(p);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <test+0x25>
mov    -0x8(%rbp),%rdi
call   1040 <foo@plt>
jmp    114e <test+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %rdi,%rdi
je     112a <test+0xa>
jmp    1030 <bar@plt>
xor    %edi,%edi
jmp    1040 <foo@plt>

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

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @foo(i8* null)
br label %7
5: ; preds = %1
%6 = tail call i32 @bar(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPSPositionSensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GPSPositionSensorUpdated() { UAVObjUpdated(GPSPositionSensorHandle()); }


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

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

LLVM IR (-O0):
define void @GPSPositionSensorUpdated() {
%1 = call i32 (...) @GPSPositionSensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSPositionSensorUpdated() {
%1 = tail call i32 (...) @GPSPositionSensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int _uname(struct utsname *);
int uname(struct utsname *u) { return _uname(u); }


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

x86 assembly (clang, -O2):
<uname>:
jmp    1030 <_uname@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @uname(%struct.utsname* %0) {
%2 = alloca %struct.utsname*
store %struct.utsname* %0, %struct.utsname** %2
%3 = load %struct.utsname*, %struct.utsname** %2
%4 = call i32 @_uname(%struct.utsname* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @uname(%struct.utsname* %0) {
%2 = tail call i32 @_uname(%struct.utsname* %0)
ret i32 %2
}
/* Variables and functions */
char *quote_buffer(unsigned char const *, unsigned int, char const *);
unsigned int strlen(char const *);
char *quote_string(const char *str, const char *special) {
  unsigned int len;
  if (str == NULL)
    return NULL;
  len = strlen(str);
  return quote_buffer((const unsigned char *)str, len, special);
}


x86 assembly (clang, -O0):
<quote_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <quote_string+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1168 <quote_string+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <quote_buffer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quote_string>:
test   %rdi,%rdi
je     1148 <quote_string+0x28>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <quote_buffer@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @quote_string(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i8* @quote_buffer(i8* %0, i32 %5, i8* %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %8
}
FUNCTION_DEFINE(debug_set) {
  PG_RETURN_INT32(DebugSetLevel(PG_GETARG_INT32(0)));
}


x86 assembly (clang, -O0):
<FUNCTION_DEFINE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <PG_GETARG_INT32@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <DebugSetLevel@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <PG_RETURN_INT32@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUNCTION_DEFINE>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <PG_GETARG_INT32@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <DebugSetLevel@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1050 <PG_RETURN_INT32@plt>

LLVM IR (-O0):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @PG_GETARG_INT32 to i32 (i32, ...)*)(i32 0)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @DebugSetLevel to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @PG_GETARG_INT32 to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @DebugSetLevel to i32 (i32, ...)*)(i32 %2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ungetc(int, int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_ungetc(int c,
                                                                FILE *stream) {
  return ungetc(c, stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_ungetc>:
jmp    1030 <ungetc@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_ungetc(i32 %0, i32* %1) {
%3 = tail call i32 @ungetc(i32 %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ch;

/* Variables and functions */
void recvfd_payload(char const *, int, int *, char *, int);
void recvfd(const char *test, int sockfd, int *recvfd) {
  char ch;
  return (recvfd_payload(test, sockfd, recvfd, &ch, sizeof(ch)));
}


x86 assembly (clang, -O0):
<recvfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x19(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <recvfd_payload@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvfd>:
push   %rax
lea    0x7(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <recvfd_payload@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @recvfd(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8
ret void
}
/* Variables and functions */
int atan(int);
void sfcPI(double *cnst) { *cnst = 4 * atan(1); }


x86 assembly (clang, -O0):
<sfcPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfcPI>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sfcPI(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 @atan(i32 1)
%4 = mul nsw i32 4, %3
%5 = sitofp i32 %4 to double
%6 = load double*, double** %2
store double %5, double* %6
ret void
}

LLVM IR (-O2):
define void @sfcPI(double* nocapture writeonly %0) {
%2 = tail call i32 @atan(i32 1)
%3 = shl nsw i32 %2, 2
%4 = sitofp i32 %3 to double
store double %4, double* %0
ret void
}
/* Variables and functions */
scalar_t__ sscanf(char const *, char *, long long *);
long long strsuftoll(const char *name, const char *arg, int def,
                     unsigned int max) {
  long long result;
  if (sscanf(arg, "%lld", &result) == 0)
    result = def;
  return result;
}


x86 assembly (clang, -O0):
<strsuftoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecf(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x0,%rax
jne    114c <strsuftoll+0x3c>
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsuftoll>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%rdi
lea    0xedf(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1030 <sscanf@plt>
test   %rax,%rax
je     1137 <strsuftoll+0x27>
mov    0x8(%rsp),%rax
jmp    113a <strsuftoll+0x2a>
movslq %ebx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i64 @strsuftoll(i8* nocapture readnone %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = call i64 @sscanf(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %5)
%8 = icmp eq i64 %7, 0
%9 = load i64, i64* %5
%10 = sext i32 %2 to i64
%11 = select i1 %8, i64 %10, i64 %9
ret i64 %11
}
int f_i1(int i0) { return i0; }


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

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

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

LLVM IR (-O2):
define i32 @f_i1(i32 returned %0) {
ret i32 %0
}
void ASN1_TIME_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TIME_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int suspend(void *m) {
  char *msg = m;
  printf("Suspend: %s\n", msg);
  printf("Hang on while I tie my shoe laces...\n");
  sleep(3);
  printf("... OK, Done\n");
  return 1;
}


x86 assembly (clang, -O0):
<suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suspend>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Suspend: %s\0A\00"
@.str.1 = [38 x i8] c"Hang on while I tie my shoe laces...\0A\00"
@.str.2 = [14 x i8] c"... OK, Done\0A\00"
define i32 @suspend(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @sleep(i32 3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"Suspend: %s\0A\00"
@str = [37 x i8] c"Hang on while I tie my shoe laces...\00"
@str.3 = [13 x i8] c"... OK, Done\00"
define i32 @suspend(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.3, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t safe_strlen(char const *);
char *dupe_str_n(const char *source, size_t count) {
  size_t L = safe_strlen(source);
  if (L > count) {
    L = count;
  }
  char *ret = malloc(L + 1);
  memcpy(ret, source, L);
  ret[L] = 0;
  return ret;
}


x86 assembly (clang, -O0):
<dupe_str_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <safe_strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1163 <dupe_str_n+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupe_str_n>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1040 <safe_strlen@plt>
mov    %rax,%rbx
cmp    %r15,%rax
cmova  %r15,%rbx
lea    0x1(%rbx),%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dupe_str_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @safe_strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64, i64* %4
store i64 %13, i64* %5
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
%16 = add i64 %15, 1
%17 = call i8* @malloc(i64 %16)
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = load i8*, i8** %3
%20 = load i64, i64* %5
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %6
%23 = load i64, i64* %5
%24 = getelementptr inbounds i8, i8* %22, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @dupe_str_n(i8* %0, i64 %1) {
%3 = tail call i64 @safe_strlen(i8* %0)
%4 = icmp ugt i64 %3, %1
%5 = select i1 %4, i64 %1, i64 %3
%6 = add i64 %5, 1
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i64 %5)
%9 = getelementptr inbounds i8, i8* %7, i64 %5
store i8 0, i8* %9
ret i8* %7
}
/* Type definitions */
struct SSResult {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct SSResult *);
void ssresult_free(struct SSResult *r) { free(r); }


x86 assembly (clang, -O0):
<ssresult_free>:
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):
<ssresult_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.SSResult = type { i32 }
define void @ssresult_free(%struct.SSResult* %0) {
%2 = alloca %struct.SSResult*
store %struct.SSResult* %0, %struct.SSResult** %2
%3 = load %struct.SSResult*, %struct.SSResult** %2
%4 = call i32 @free(%struct.SSResult* %3)
ret void
}

LLVM IR (-O2):
%struct.SSResult = type { i32 }
define void @ssresult_free(%struct.SSResult* nocapture %0) {
%2 = tail call i32 @free(%struct.SSResult* %0)
ret void
}
/* Variables and functions */
int CHAR_BIT;
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  int v, m;
  unsigned int r;
  v = -10;
  m = v >> sizeof(int) * CHAR_BIT - 1;
  r = (v + m) ^ m;
  printf("%u", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff6,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eb0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    $0xfffffff6,%eax
sar    %cl,%eax
lea    -0xa(%rax),%esi
xor    %eax,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -10, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @CHAR_BIT
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = sub i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = ashr i32 %5, %10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = xor i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 2
%3 = add i32 %2, -1
%4 = ashr i32 -10, %3
%5 = add nsw i32 %4, -10
%6 = xor i32 %5, %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
int wait(int *status) {
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ palette_chunk(struct chunk *);
void palette_free(struct chunk *chunk) { free(palette_chunk(chunk)); }


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

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

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @palette_free(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = call i32 @palette_chunk(%struct.chunk* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @palette_free(%struct.chunk* %0) {
%2 = tail call i32 @palette_chunk(%struct.chunk* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}