xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x89() {
  Assert_real((iscntrl(137) == 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_iscntrl.c",
              690, ("iscntrl should be 0 for 0x89"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x89\00"
define void @t_iscntrl_0x89() {
%1 = call i64 @iscntrl(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x89\00"
define void @t_iscntrl_0x89() {
%1 = tail call i64 @iscntrl(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
void print_numbers(void) {
  char i;
  i = '0';
  while (i <= '9') {
    _putchar(i);
    i++;
  }
  _putchar('\n');
}


x86 assembly (clang, -O0):
<print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     113f <print_numbers+0x2f>
movsbl -0x1(%rbp),%edi
call   1030 <_putchar@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <print_numbers+0xc>
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <_putchar@plt>
mov    $0x31,%edi
call   1030 <_putchar@plt>
mov    $0x32,%edi
call   1030 <_putchar@plt>
mov    $0x33,%edi
call   1030 <_putchar@plt>
mov    $0x34,%edi
call   1030 <_putchar@plt>
mov    $0x35,%edi
call   1030 <_putchar@plt>
mov    $0x36,%edi
call   1030 <_putchar@plt>
mov    $0x37,%edi
call   1030 <_putchar@plt>
mov    $0x38,%edi
call   1030 <_putchar@plt>
mov    $0x39,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <_putchar@plt>

LLVM IR (-O0):
define void @print_numbers() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i8, i8* %1
%8 = call i32 @_putchar(i8 signext %7)
%9 = load i8, i8* %1
%10 = add i8 %9, 1
store i8 %10, i8* %1
br label %2
11: ; preds = %2
%12 = call i32 @_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @print_numbers() {
%1 = tail call i32 @_putchar(i8 signext 48)
%2 = tail call i32 @_putchar(i8 signext 49)
%3 = tail call i32 @_putchar(i8 signext 50)
%4 = tail call i32 @_putchar(i8 signext 51)
%5 = tail call i32 @_putchar(i8 signext 52)
%6 = tail call i32 @_putchar(i8 signext 53)
%7 = tail call i32 @_putchar(i8 signext 54)
%8 = tail call i32 @_putchar(i8 signext 55)
%9 = tail call i32 @_putchar(i8 signext 56)
%10 = tail call i32 @_putchar(i8 signext 57)
%11 = tail call i32 @_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ moveForward(int /*<<< orphan*/);
void brake() { moveForward(0); }


x86 assembly (clang, -O0):
<brake>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <moveForward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<brake>:
xor    %edi,%edi
jmp    1030 <moveForward@plt>

LLVM IR (-O0):
define void @brake() {
%1 = call i32 @moveForward(i32 0)
ret void
}

LLVM IR (-O2):
define void @brake() {
%1 = tail call i32 @moveForward(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Label_Printf(char *, char *);
void Label(char *label) { Label_Printf("\n%s:", label); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s:\00"
define void @Label(i8* %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t endian_to_little16(uint16_t data) { return data; }


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

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

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

LLVM IR (-O2):
define i32 @endian_to_little16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int ungetc(int, void *);
int push_back_byte(void *id, int c) { return ungetc(c, id); }


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

x86 assembly (clang, -O2):
<push_back_byte>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <ungetc@plt>

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

LLVM IR (-O2):
define i32 @push_back_byte(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @ungetc(i32 %1, i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t Badui16(int a) { return 5; }


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

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

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

LLVM IR (-O2):
define i32 @Badui16(i32 %0) {
ret i32 5
}
/* Variables and functions */
scalar_t__ memcpy(void *, void *, size_t);
scalar_t__ ptr_to_vaddr(void *);
scalar_t__ vaddr_to_ptr(uintptr_t);
void *os_memcpy(void *dest, const void *src, size_t n) {
  return ((void *)(ptr_to_vaddr(
      (void *)(memcpy(((void *)(vaddr_to_ptr((uintptr_t)(dest)))),
                      ((void *)(vaddr_to_ptr((uintptr_t)(src)))), n)))));
}


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

x86 assembly (clang, -O2):
<os_memcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <vaddr_to_ptr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <vaddr_to_ptr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
mov    %rax,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <ptr_to_vaddr@plt>

LLVM IR (-O0):
define i8* @os_memcpy(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 = ptrtoint i8* %7 to i64
%9 = call i64 @vaddr_to_ptr(i64 %8)
%10 = inttoptr i64 %9 to i8*
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %11 to i64
%13 = call i64 @vaddr_to_ptr(i64 %12)
%14 = inttoptr i64 %13 to i8*
%15 = load i64, i64* %6
%16 = call i64 @memcpy(i8* %10, i8* %14, i64 %15)
%17 = inttoptr i64 %16 to i8*
%18 = call i64 @ptr_to_vaddr(i8* %17)
%19 = inttoptr i64 %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define i8* @os_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = tail call i64 @vaddr_to_ptr(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = ptrtoint i8* %1 to i64
%8 = tail call i64 @vaddr_to_ptr(i64 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i64 @memcpy(i8* %6, i8* %9, i64 %2)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i64 @ptr_to_vaddr(i8* %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}
/* Variables and functions */
scalar_t__ getpid();
unsigned int UnixVfs_ProcessId(void) { return (unsigned int)getpid(); }


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

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

LLVM IR (-O0):
define i32 @UnixVfs_ProcessId() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @UnixVfs_ProcessId() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int recive_command() {
  puts("recive_command ");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"recive_command \00"
define i32 @recive_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void clear_line(char line[], int size) {
  int i = 0;
  for (i = 0; line[i] != '\0'; i++) {
    line[i] = 0;
  };
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1148 <clear_line+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <clear_line+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
cmpb   $0x0,(%rdi)
je     111d <clear_line+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <clear_line+0x10>
ret

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

LLVM IR (-O2):
define void @clear_line(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 0, i8* %7
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
extern void TBUF_RECORD_EVENT(char *str, unsigned _p0) {
  unsigned addr;
  asm volatile("movl	%%fs:0, %%esi	        \n"
               "addl	$32, %%esi		\n"
               "movl   %%esi, %%edi            \n"
               "andl   $0x1fffff, %%esi	\n"
               "movl	%%esi, %%fs:0     	\n"
               "rdtsc				\n"
               "movl 	%%eax, %%fs:0(%%edi)    \n"
               : "=D"(addr)
               :
               : "eax", "ecx", "edx", "esi");
  ;
  asm volatile("movl   %0, %%fs:("
               "0"
               "*4+12)(%%edi)\n"
               :
               : "r"((unsigned)str), "D"(addr));
  ;
  asm volatile("movl   %0, %%fs:("
               "1"
               "*4+12)(%%edi)\n"
               :
               : "r"(_p0), "D"(addr));
  ;
}


x86 assembly (clang, -O0):
<TBUF_RECORD_EVENT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %fs:0x0,%esi
add    $0x20,%esi
mov    %esi,%edi
and    $0x1fffff,%esi
mov    %esi,%fs:0x0
rdtsc
mov    %eax,%fs:(%edi)
mov    %edi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edi
mov    %eax,%fs:0xc(%edi)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edi
mov    %eax,%fs:0x10(%edi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TBUF_RECORD_EVENT>:
mov    %esi,%r8d
mov    %rdi,%r9
mov    %fs:0x0,%esi
add    $0x20,%esi
mov    %esi,%edi
and    $0x1fffff,%esi
mov    %esi,%fs:0x0
rdtsc
mov    %eax,%fs:(%edi)
mov    %r9d,%fs:0xc(%edi)
mov    %r8d,%fs:0x10(%edi)
ret

LLVM IR (-O0):
define void @TBUF_RECORD_EVENT(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 asm sideeffect "movl\09%fs:0, %esi\09 \0Aaddl\09$$32, %esi\09\09\0Amovl %esi, %edi \0Aandl $$0x1fffff, %esi\09\0Amovl\09%esi, %fs:0 \09\0Ardtsc\09\09\09\09\0Amovl \09%eax, %fs:0(%edi) \0A", "={di},~{eax},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"()
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @TBUF_RECORD_EVENT(i8* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "movl\09%fs:0, %esi\09 \0Aaddl\09$$32, %esi\09\09\0Amovl %esi, %edi \0Aandl $$0x1fffff, %esi\09\0Amovl\09%esi, %fs:0 \09\0Ardtsc\09\09\09\09\0Amovl \09%eax, %fs:0(%edi) \0A", "={di},~{eax},~{ecx},~{edx},~{esi},~{dirflag},~{fpsr},~{flags}"()
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
tail call void asm sideeffect "movl $0, %fs:(0*4+12)(%edi)\0A", "r,{di},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %3)
tail call void asm sideeffect "movl $0, %fs:(1*4+12)(%edi)\0A", "r,{di},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
size_t myCntNumLines(FILE *fp) {
  int c;
  size_t ans = 1;
  while ((c = getc(fp)) != EOF) {
    if (c == '\n') {
      ans++;
    }
  }
  rewind(fp);
  return ans;
}


x86 assembly (clang, -O0):
<myCntNumLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     116a <myCntNumLines+0x4a>
cmpl   $0xa,-0xc(%rbp)
jne    1165 <myCntNumLines+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <myCntNumLines+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myCntNumLines>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <getc@plt>
mov    0x2eb4(%rip),%r15
mov    $0x1,%ebx
cmp    (%r15),%eax
je     1168 <myCntNumLines+0x48>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %rcx,%rbx
mov    %r14,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1150 <myCntNumLines+0x30>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define i64 @myCntNumLines(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i64
store i32* %0, i32** %2
store i64 1, i64* %4
br label %5
5: ; preds = %16, %1
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %4
%15 = add i64 %14, 1
store i64 %15, i64* %4
br label %16
16: ; preds = %13, %10
br label %5
17: ; preds = %5
%18 = load i32*, i32** %2
%19 = call i32 @rewind(i32* %18)
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define i64 @myCntNumLines(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %11, %5 ], [ %2, %1 ]
%7 = phi i64 [ %10, %5 ], [ 1, %1 ]
%8 = icmp eq i32 %6, 10
%9 = zext i1 %8 to i64
%10 = add i64 %7, %9
%11 = tail call i32 @getc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i64 [ 1, %1 ], [ %10, %5 ]
%16 = tail call i32 @rewind(i32* %0)
ret i64 %15
}
void I_NoAppServicesLobbyStartGame(void) {}


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

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

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

LLVM IR (-O2):
define void @I_NoAppServicesLobbyStartGame() {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR62_get(void) { return U_WMRCORENONE_get("U_WMR62"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR62\00"
define i32 @U_WMR62_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR62\00"
define i32 @U_WMR62_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getNumber(double *);
double log(double);
double logaritmo(double a) {
  getNumber(&a);
  return (log(a));
}


x86 assembly (clang, -O0):
<logaritmo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logaritmo>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1040 <log@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @logaritmo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @log(double %4)
ret double %5
}

LLVM IR (-O2):
define double @logaritmo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @log(double %4)
ret double %5
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 1
ret i32* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
ret i32* %14
}
void writeInt(int n) {
  int *IO = (int *)(0x3c000000 + 4 * 0x00000020);
  *IO = n;
}


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3c000080,%eax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
mov    %edi,0x3c000080
ret

LLVM IR (-O0):
define void @writeInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* inttoptr (i64 1006633088 to i32*), i32** %3
%4 = load i32, i32* %2
%5 = load i32*, i32** %3
store i32 %4, i32* %5
ret void
}

LLVM IR (-O2):
define void @writeInt(i32 %0) {
store i32 %0, i32* inttoptr (i64 1006633088 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M928_f(char *s) {
  debug("M928_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M928_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M928_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int _heapextend(char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_heapextend(char *base, int size) {
  int ret;
  monLock();
  ret = _heapextend(base, size);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_heapextend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <_heapextend@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_heapextend>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <_heapextend@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_heapextend(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @_heapextend(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_heapextend(i8* %0, i32 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_heapextend(i8* %0, i32 %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
int size_string(char *string) {
  int i;
  for (i = 0; string[i] != '\0'; ++i)
    ;
  return i;
}


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

x86 assembly (clang, -O2):
<size_string>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <size_string+0x10>
ret

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

LLVM IR (-O2):
define i32 @size_string(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ close(int);
int getdtablesize();
int closefrom(int fd) {
  int max = getdtablesize();
  int i;
  int r = 0;
  for (i = fd; i < max; i++)
    r += close(i);
  return r;
}


x86 assembly (clang, -O0):
<closefrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getdtablesize@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <closefrom+0x51>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <closefrom+0x22>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefrom>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getdtablesize@plt>
cmp    %ebx,%eax
jle    1151 <closefrom+0x31>
mov    %eax,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <close@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1140 <closefrom+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @closefrom(i32 %0) {
%2 = tail call i32 (...) @getdtablesize()
%3 = icmp sgt i32 %2, %0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %0, %1 ]
%7 = tail call i64 @close(i32 %6)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add i32 %6, 1
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
void quadrat(float *zahl) { *zahl = *zahl * (*zahl); }


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

x86 assembly (clang, -O2):
<quadrat>:
movss  (%rdi),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @quadrat(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = load float*, float** %2
%6 = load float, float* %5
%7 = fmul float %4, %6
%8 = load float*, float** %2
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @quadrat(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, %2
store float %3, float* %0
ret void
}
/* Variables and functions */
int compute_square(int);
int main(void) {
  int x;
  int tmp;
  int tmp___0;
  {
    {
      x = 2;
      tmp = compute_square(x);
      x = tmp + 2;
      tmp___0 = compute_square(x);
      x = tmp___0 + 2;
    }
    if (x != 12) {
      goto ERROR;
    } else {
    }
    return (0);
  ERROR:
    return (-1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <compute_square@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <compute_square@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
je     115d <main+0x4d>
jmp    116e <main+0x5e>
jmp    1162 <main+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1175 <main+0x65>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <compute_square@plt>
lea    0x2(%rax),%edi
call   1030 <compute_square@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @compute_square(i32 2)
%2 = add nsw i32 %1, 2
%3 = tail call i32 @compute_square(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = sext i1 %4 to i32
ret i32 %5
}
int BMA222Close() { return 0; }


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

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

LLVM IR (-O0):
define i32 @BMA222Close() {
ret i32 0
}

LLVM IR (-O2):
define i32 @BMA222Close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  float b;
  b = 3.645;
  a = b;
  __print_int(a);
  b = a;
  __print_float(b);
  a = 975;
  b = a;
  __print_float(b);
  a = b;
  __print_int(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__print_int@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
movl   $0x3cf,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <__print_int@plt>
movss  0xecd(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xec4(%rip),%xmm0
call   1030 <__print_float@plt>
mov    $0x3cf,%edi
call   1040 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0x400D28F5C0000000, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @__print_int(i32 %6)
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = call i32 @__print_float(float %10)
store i32 975, i32* %2
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to float
store float %13, float* %3
%14 = load float, float* %3
%15 = call i32 @__print_float(float %14)
%16 = load float, float* %3
%17 = fptosi float %16 to i32
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = call i32 @__print_int(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 3)
%2 = tail call i32 @__print_float(float 3.000000e+00)
%3 = tail call i32 @__print_float(float 9.750000e+02)
%4 = tail call i32 @__print_int(i32 975)
ret i32 0
}
/* Variables and functions */
double add(double, double);
int /*<<< orphan*/ printf(char *, double);
main() {
  double res = add(3.0, 5.0);
  printf("3.0 + 5.0 = %f\n", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed0(%rip),%xmm0
movsd  0xed0(%rip),%xmm1
call   1030 <add@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <add@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"3.0 + 5.0 = %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = call double @add(double 3.000000e+00, double 5.000000e+00)
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"3.0 + 5.0 = %f\0A\00"
define i32 @main() {
%1 = tail call double @add(double 3.000000e+00, double 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void crc32Init(unsigned long *pCrc32) { *pCrc32 = 0xFFFFFFFF; }


x86 assembly (clang, -O0):
<crc32Init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @crc32Init(i64* nocapture writeonly %0) {
store i64 4294967295, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void reset_tty(int a) {
  printf("\x1b[0m");
  a;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @reset_tty(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *protobuf_c_version(void) { return "1.2.1"; }


x86 assembly (clang, -O0):
<protobuf_c_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<protobuf_c_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
const char *stress_3_get_title(void) {
  return "Create a file with a large hole and fill it";
}


x86 assembly (clang, -O0):
<stress_3_get_title>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_3_get_title>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Create a file with a large hole and fill it\00"
define i8* @stress_3_get_title() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"Create a file with a large hole and fill it\00"
define i8* @stress_3_get_title() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ *initscr();
int /*<<< orphan*/ stderr;
void newBuffer() {
  if (initscr() == NULL) {
    fprintf(stderr, "initscr failure\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<newBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
cmp    $0x0,%rax
jne    1168 <newBuffer+0x38>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newBuffer>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
test   %rax,%rax
je     113f <newBuffer+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"initscr failure\0A\00"
@EXIT_FAILURE = global i32 0
define void @newBuffer() {
%1 = call i32* (...) @initscr()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"initscr failure\0A\00"
@EXIT_FAILURE = global i32 0
define void @newBuffer() {
%1 = tail call i32* (...) @initscr()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void zmaster_server_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<zmaster_server_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @zmaster_server_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @zmaster_server_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
void print(int m, long long n) {
  if (n < m) {
    printf("%d", n);
    return;
  } else {
    print(m, n / m);
    printf("%d", n % m);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    1155 <print+0x35>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1189 <print+0x69>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1040 <print@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,%rsi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rsi,%rbx
movslq %edi,%rcx
cmp    %rsi,%rcx
jg     1155 <print+0x35>
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1145 <print+0x25>
mov    %rbx,%rax
cqto
idiv   %rcx
mov    %rdx,%rbx
jmp    114d <print+0x2d>
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%ebx
mov    %rax,%rsi
call   1040 <print@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @print(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp slt i64 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %23
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i64, i64* %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = sdiv i64 %14, %16
%18 = load i64, i64* %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = srem i64 %18, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %21)
br label %23
23: ; preds = %9, %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print(i32 %0, i64 %1) {
%3 = sext i32 %0 to i64
%4 = icmp sgt i64 %3, %1
br i1 %4, label %5, label %8
5: ; preds = %2, %8
%6 = phi i64 [ %10, %8 ], [ %1, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
8: ; preds = %2
%9 = sdiv i64 %1, %3
tail call void @print(i32 %0, i64 %9)
%10 = srem i64 %1, %3
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void main(void) {
  print("hello world\r\n");
  print("how are you today\r\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"hello world\0D\0A\00"
@.str.1 = [20 x i8] c"how are you today\0D\0A\00"
define void @main() {
%1 = call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world\0D\0A\00"
@.str.1 = [20 x i8] c"how are you today\0D\0A\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) int test_and_change_bit(int nr,
                                                 volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("lock ; "
                       "btcl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit), "=m"((*(volatile long *)addr))
                       : "Ir"(nr)
                       : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btc %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_change_bit>:
lock btc %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "lock ; btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_change_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock ; btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
void avcodec_flush_buffers() {}


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

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

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

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