xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  char c;
  while ((c = fgetc(stdin)) != EOF)
    fprintf(stdout, "%c\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e96(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1173 <main+0x53>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
movsbl -0x5(%rbp),%edx
call   1040 <fprintf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb9(%rip),%r14
mov    (%r14),%edi
call   1030 <fgetc@plt>
mov    0x2ea2(%rip),%r15
cmp    (%r15),%al
je     117c <main+0x5c>
mov    0x2e86(%rip),%r12
lea    0xeaf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
movsbl %al,%edx
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    (%r15),%al
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
@stdout = global i32 0
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %0, %5
%6 = phi i8 [ %10, %5 ], [ %2, %0 ]
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%9 = load i32, i32* @stdin
%10 = tail call signext i8 @fgetc(i32 %9)
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strdup(char *);
int strlen(char *);
char *get_input(int limit) {
  char input[limit];
  fgets(input, limit, stdin);
  input[strlen(input) - 1] = 0;
  return strdup(input);
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
sub    $0x1,%eax
cltq
movb   $0x0,(%rdi,%rax,1)
call   1050 <strdup@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%esi
mov    %edi,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1050 <strdup@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @get_input(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %8, i32 %9, i32 %10)
%12 = call i32 @strlen(i8* %8)
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %8, i64 %14
store i8 0, i8* %15
%16 = call i8* @strdup(i8* %8)
%17 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stdin = global i32 0
define noalias i8* @get_input(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 %0, i32 %4)
%6 = call i32 @strlen(i8* %3)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
store i8 0, i8* %9
%10 = call i8* @strdup(i8* %3)
ret i8* %10
}
signed long signedlong_ignoring_unsignedlonglong(signed long x,
                                                 unsigned long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlong_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
void coroutine_destroy(struct coroutine_context *context) {}


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

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

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

LLVM IR (-O2):
%struct.coroutine_context = type opaque
define void @coroutine_destroy(%struct.coroutine_context* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_BMPSTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_BMPSTRING_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_BMPSTRING_it);
}


x86 assembly (clang, -O0):
<i2d_ASN1_BMPSTRING>:
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    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ASN1_BMPSTRING>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@ASN1_BMPSTRING_it = global i32 0
define i32 @i2d_ASN1_BMPSTRING(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_BMPSTRING_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x7e() {
  Assert_real((ispunct(126)),
              "/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_ispunct.c",
              635, ("ispunct should be 1 for ~"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x7e>:
push   %rax
mov    $0x7e,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x27b,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ~\00"
define void @t_ispunct_0x7e() {
%1 = call i32 @ispunct(i32 126)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ~\00"
define void @t_ispunct_0x7e() {
%1 = tail call i32 @ispunct(i32 126)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void dbl_free(double *ptr) { free(ptr); }


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

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

LLVM IR (-O2):
define void @dbl_free(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
void pt_copy_key(char *restrict dst, const char *restrict src) {
  *(unsigned int *)dst = *(unsigned int *)src;
}


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

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

LLVM IR (-O0):
define void @pt_copy_key(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** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @pt_copy_key(i8* noalias nocapture writeonly %0, i8* noalias nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_list() {
  puts("list [hotels | services | guests]\n"
       "Lists hotels, services, or guests, as directed. Prompts for input if\n"
       "no parameter is provided.");
}


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

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

LLVM IR (-O0):
@.str = [129 x i8] c"list [hotels | services | guests]\0ALists hotels, services, or guests, as directed. Prompts for input if\0Ano parameter is provided.\00"
define void @help_list() {
%1 = call i32 @puts(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"list [hotels | services | guests]\0ALists hotels, services, or guests, as directed. Prompts for input if\0Ano parameter is provided.\00"
define void @help_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_send_initial_metadata() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_send_initial_metadata>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_send_initial_metadata>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_initial_metadata() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_initial_metadata() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char const **);
void FreeDope(int c, const char **v) {
  for (int j = 0; j < c; j++)
    free((void *)v[j]);
  free(v);
}


x86 assembly (clang, -O0):
<FreeDope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <FreeDope+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <FreeDope+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeDope>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <FreeDope+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeDope+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeDope(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @free(i8** %1)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = bitcast i8** %10 to i8***
%12 = load i8**, i8*** %11
%13 = tail call i32 @free(i8** %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_byte(int /*<<< orphan*/ *);
uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte((uint8_t *)4); }


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

x86 assembly (clang, -O2):
<eeconfig_read_keymap>:
mov    $0x4,%edi
jmp    1030 <eeprom_read_byte@plt>

LLVM IR (-O0):
define i32 @eeconfig_read_keymap() {
%1 = call i32 @eeprom_read_byte(i32* inttoptr (i64 4 to i32*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @eeconfig_read_keymap() {
%1 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 4 to i32*))
ret i32 %1
}
/* Variables and functions */
int syscall(int, char const *, unsigned int);
int fsopen(const char *fs_name, unsigned int flags) {
  return syscall(-1, fs_name, flags);
}


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

x86 assembly (clang, -O2):
<fsopen>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fsopen(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 -1, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double ln_get_lunar_earth_dist(double);
double ln_get_lunar_sdiam(double JD) {
  double So = 358473400;
  double dist;
  dist = ln_get_lunar_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_lunar_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_lunar_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_lunar_sdiam>:
push   %rax
call   1030 <ln_get_lunar_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_lunar_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x41B55DDEB8000000, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_lunar_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_lunar_sdiam(double %0) {
%2 = tail call double @ln_get_lunar_earth_dist(double %0)
%3 = fdiv double 0x41B55DDEB8000000, %2
ret double %3
}
/* Variables and functions */
int end(int, char *);
int rec(int param1, char *param2, int n) {
  return n == 0 ? end(param1, param2) : rec(param1, param2, n - 1);
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1150 <rec+0x30>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <end@plt>
mov    %eax,-0x18(%rbp)
jmp    1165 <rec+0x45>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <rec@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
jmp    1030 <end@plt>

LLVM IR (-O0):
define i32 @rec(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i32 @end(i32 %10, i8* %11)
br label %19
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = call i32 @rec(i32 %14, i8* %15, i32 %17)
br label %19
19: ; preds = %13, %9
%20 = phi i32 [ %12, %9 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @rec(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @end(i32 %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ e_ror();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zpx();
void e_ror_zpx() {
  e_zpx();
  e_ror();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_ror_zpx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_zpx@plt>
mov    $0x0,%al
call   1030 <e_ror@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_ror_zpx>:
push   %rax
xor    %eax,%eax
call   1050 <e_zpx@plt>
xor    %eax,%eax
call   1030 <e_ror@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_ror_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_ror()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_ror_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_ror()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xcf() {
  Assert_real((isodigit(207) == 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_isodigit.c",
              1040, ("isodigit should be 0 for 0xcf"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x410,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xcf\00"
define void @t_isodigit_0xcf() {
%1 = call i64 @isodigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xcf\00"
define void @t_isodigit_0xcf() {
%1 = tail call i64 @isodigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float lerp(float a, float b, float t) { return a + t * (b - a); }


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

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

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

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}
int test_imm_80int32_reg(int val) { return ((val) & (0x80 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_80int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80int32_reg>:
test   $0x80,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80int32_reg(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_quaddobl_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(182, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_quaddobl_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xb6,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_quaddobl_homotopy>:
mov    $0xb6,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @create_quaddobl_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 182, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ printf(char *, char *);
int cd(char *dir) {
  int ret;
  if (dir)
    ret = chdir(dir);
  else
    ret = chdir("/");
  if (ret < 0) {
    printf("cd: cannot change to %s\n", dir);
  }
  return ret;
}


x86 assembly (clang, -O0):
<cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <cd+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
jmp    1157 <cd+0x37>
lea    0xeb1(%rip),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1171 <cd+0x51>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     1130 <cd+0x10>
mov    %rbx,%rdi
jmp    1137 <cd+0x17>
lea    0xec9(%rip),%rdi
call   1030 <chdir@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1151 <cd+0x31>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@.str.1 = [25 x i8] c"cd: cannot change to %s\0A\00"
define i32 @cd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @chdir(i8* %7)
store i32 %8, i32* %3
br label %11
9: ; preds = %1
%10 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %3
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@.str.1 = [25 x i8] c"cd: cannot change to %s\0A\00"
define i32 @cd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @chdir(i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %7
ret i32 %8
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char *s = "abcdec";
  printf("s=%s, res=%d\n", s, lengthOfLongestSubstring(s));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"abcdec\00"
@.str.1 = [14 x i8] c"s=%s, res=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) { die("Usage: build bootloader setup system image\n"); }


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: build bootloader setup system image\0A\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: build bootloader setup system image\0A\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_range_unshare_capped(struct __test_metadata *);
void wrapper_close_range_unshare_capped(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  close_range_unshare_capped(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_close_range_unshare_capped>:
jmp    1030 <close_range_unshare_capped@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_unshare_capped(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @close_range_unshare_capped(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_unshare_capped(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @close_range_unshare_capped(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int boo(int, int);
int foo(int m, int n) { return boo(m, n); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <boo@plt>

LLVM IR (-O0):
define i32 @foo(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 @boo(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @boo(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glutSolidTeapot(int);
void drawSolidTeapot(void) { glutSolidTeapot(1); }


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

x86 assembly (clang, -O2):
<drawSolidTeapot>:
mov    $0x1,%edi
jmp    1030 <glutSolidTeapot@plt>

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

LLVM IR (-O2):
define void @drawSolidTeapot() {
%1 = tail call i32 @glutSolidTeapot(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, long);
void report(char const *s, char const *file, long line) {
  printf("Pubnub assert failed '%s', file '%s', line %ld\n", s, file, line);
}


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

x86 assembly (clang, -O2):
<report>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Pubnub assert failed '%s', file '%s', line %ld\0A\00"
define void @report(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Pubnub assert failed '%s', file '%s', line %ld\0A\00"
define void @report(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *);
void get_enter() {
  char key;
  printf("\nAppuyer sur <entré> pour continuer...");
  while ((key = getchar()) != '\n' && key != EOF)
    ;
  getchar();
}


x86 assembly (clang, -O0):
<get_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1165 <get_enter+0x45>
movsbl -0x1(%rbp),%eax
mov    0x2e8e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1175 <get_enter+0x55>
jmp    117a <get_enter+0x5a>
jmp    1134 <get_enter+0x14>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_enter>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     114f <get_enter+0x2f>
cmp    (%rbx),%al
jne    1140 <get_enter+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AAppuyer sur <entr\C3\A9> pour continuer...\00"
@EOF = global i8 0
define void @get_enter() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %15, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br label %13
13: ; preds = %7, %3
%14 = phi i1 [ false, %3 ], [ %12, %7 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %3
16: ; preds = %13
%17 = call signext i8 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0AAppuyer sur <entr\C3\A9> pour continuer...\00"
@EOF = global i8 0
define void @get_enter() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp ne i8 %3, 10
%5 = load i8, i8* @EOF
%6 = icmp ne i8 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = tail call signext i8 (...) @getchar()
ret void
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdtscp(int *chip, int *core) {
  unsigned cpu;
  union {
    uint64_t tsc_64;
    struct {
      uint32_t lo_32;
      uint32_t hi_32;
    } t32;
  } tsc;
  asm volatile("rdtscp" : "=a"(tsc.t32.lo_32), "=d"(tsc.t32.hi_32), "=c"(cpu));
  *chip = (cpu & 0xFFF000) >> 12;
  *core = (cpu & 0xFFF);
  return tsc.tsc_64;
}


x86 assembly (clang, -O0):
<rdtscp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
rdtscp
mov    %eax,-0x20(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
and    $0xfff000,%ecx
shr    $0xc,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
and    $0xfff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscp>:
rdtscp
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
mov    %ecx,%edx
shr    $0xc,%edx
and    $0xfff,%edx
mov    %edx,(%rdi)
and    $0xfff,%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
%union.anon = type { i8* }
%struct.anon = type { i32, i32 }
define i8* @rdtscp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %union.anon
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = bitcast %union.anon* %6 to %struct.anon*
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
%9 = bitcast %union.anon* %6 to %struct.anon*
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 1
%11 = call { i32, i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{dirflag},~{fpsr},~{flags}"()
%12 = extractvalue { i32, i32, i32 } %11, 0
%13 = extractvalue { i32, i32, i32 } %11, 1
%14 = extractvalue { i32, i32, i32 } %11, 2
store i32 %12, i32* %8
store i32 %13, i32* %10
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = and i32 %15, 16773120
%17 = lshr i32 %16, 12
%18 = load i32*, i32** %3
store i32 %17, i32* %18
%19 = load i32, i32* %5
%20 = and i32 %19, 4095
%21 = load i32*, i32** %4
store i32 %20, i32* %21
%22 = bitcast %union.anon* %6 to i8**
%23 = load i8*, i8** %22
ret i8* %23
}

LLVM IR (-O2):
define i8* @rdtscp(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call { i32, i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32, i32 } %3, 0
%5 = extractvalue { i32, i32, i32 } %3, 1
%6 = extractvalue { i32, i32, i32 } %3, 2
%7 = zext i32 %4 to i64
%8 = zext i32 %5 to i64
%9 = shl nuw i64 %8, 32
%10 = or i64 %9, %7
%11 = inttoptr i64 %10 to i8*
%12 = lshr i32 %6, 12
%13 = and i32 %12, 4095
store i32 %13, i32* %0
%14 = and i32 %6, 4095
store i32 %14, i32* %1
ret i8* %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ visual;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void *get_XWindowAttributes_visual(void *_p) {
  return (void *)((XWindowAttributes *)_p)->visual;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XWindowAttributes_visual(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int VecSquaredLength3iv(const int v[3]) {
  return (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


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

x86 assembly (clang, -O2):
<VecSquaredLength3iv>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
imul   %eax,%eax
imul   %ecx,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%eax
imul   %eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @VecSquaredLength3iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = mul nsw i32 %12, %15
%17 = add nsw i32 %9, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = mul nsw i32 %20, %23
%25 = add nsw i32 %17, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @VecSquaredLength3iv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, %5
%7 = add nuw nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %9
%11 = add nuw nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleTurnOff() { printf(" ----- <TurnOff> -----> "); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c" ----- <TurnOff> -----> \00"
define void @handleTurnOff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c" ----- <TurnOff> -----> \00"
define void @handleTurnOff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
void chatting(char *s, ...) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @chatting(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
void *malloc(int);
void *mallocz(size_t const size) {
  return malloc(((1) > (size) ? (1) : (size)));
}


x86 assembly (clang, -O0):
<mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%rax
jbe    1139 <mallocz+0x29>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    1141 <mallocz+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocz>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @mallocz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 1, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %8
8: ; preds = %6, %5
%9 = phi i64 [ 1, %5 ], [ %7, %6 ]
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @mallocz(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = trunc i64 %0 to i32
%4 = select i1 %2, i32 1, i32 %3
%5 = tail call i8* @malloc(i32 %4)
ret i8* %5
}
void ExttGatewayTypeAuxTable(void) {}


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

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

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

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