xunge/DecIR huggingface dataset:
signed int append_char(char *pStr, char c) {
  *pStr = c;
  return 1;
}


x86 assembly (clang, -O0):
<append_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
mov    %sil,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @append_char(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret i32 1
}
int MIN(int x, int y) { return (((x) < (y)) ? (x) : (y)); }


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

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

LLVM IR (-O0):
define i32 @MIN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void INT_Excep_PERIB_INTB177(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB177() {
ret void
}
/* Variables and functions */
scalar_t__ rom_present(char *);
int esdi_available() {
  return rom_present("90x8969.bin") && rom_present("90x8970.bin");
}


x86 assembly (clang, -O0):
<esdi_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     114c <esdi_available+0x3c>
lea    0xecf(%rip),%rdi
call   1030 <rom_present@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esdi_available>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <rom_present@plt>
test   %rax,%rax
je     113b <esdi_available+0x2b>
lea    0xee3(%rip),%rdi
call   1030 <rom_present@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"90x8969.bin\00"
@.str.1 = [12 x i8] c"90x8970.bin\00"
define i32 @esdi_available() {
%1 = call i64 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"90x8969.bin\00"
@.str.1 = [12 x i8] c"90x8970.bin\00"
define i32 @esdi_available() {
%1 = tail call i64 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @rom_present(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ append(char *, char const *, int /*<<< orphan*/);
void on_int32(void *ctx, const char *code, const char *name, int32_t value) {
  append("%s: %d", name, value);
}


x86 assembly (clang, -O0):
<on_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xecb(%rip),%rdi
call   1030 <append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_int32>:
lea    0xee9(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <append@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %d\00"
define void @on_int32(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = call i32 @append(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %d\00"
define void @on_int32(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2, i32 %3) {
%5 = tail call i32 @append(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;
struct _Locale_codecvt {
  int dummy;
};
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t _WLocale_wctomb(struct _Locale_codecvt *lcodecvt, char *to, size_t n,
                       const wchar_t c, mbstate_t *st) {
  *to = (char)c;
  return 1;
}


x86 assembly (clang, -O0):
<_WLocale_wctomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_WLocale_wctomb>:
mov    %cl,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_wctomb(%struct._Locale_codecvt* %0, i8* %1, i64 %2, i64 %3, i32* %4) {
%6 = alloca %struct._Locale_codecvt*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
store %struct._Locale_codecvt* %0, %struct._Locale_codecvt** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i64, i64* %9
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %7
store i8 %12, i8* %13
ret i64 1
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_wctomb(%struct._Locale_codecvt* nocapture readnone %0, i8* nocapture writeonly %1, i64 %2, i64 %3, i32* nocapture readnone %4) {
%6 = trunc i64 %3 to i8
store i8 %6, i8* %1
ret i64 1
}
void sh7372_init_pm_domains(void) {}


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

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

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

LLVM IR (-O2):
define void @sh7372_init_pm_domains() {
ret void
}
char *strcat(char *dest, const char *src) {
  char *p = dest;
  while (*p != '\0')
    p++;
  while ((*p++ = *src++) != '\0')
    continue;
  return p;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116d <strcat+0x6d>
jmp    113a <strcat+0x3a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <strcat+0x10>
mov    $0xffffffffffffffff,%rcx
movzbl 0x1(%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcat+0x20>
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %13
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ null_size();
int /*<<< orphan*/ out_of_mem();
void *xcalloc(size_t nitems, size_t elsize) {
  void *ptr;
  if (nitems == 0 || elsize == 0)
    null_size();
  ptr = calloc(nitems, elsize);
  if (ptr == NULL)
    out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <xcalloc+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    115d <xcalloc+0x2d>
mov    $0x0,%al
call   1040 <null_size@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1180 <xcalloc+0x50>
mov    $0x0,%al
call   1050 <out_of_mem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
je     1144 <xcalloc+0x14>
test   %r14,%r14
jne    114b <xcalloc+0x1b>
xor    %eax,%eax
call   1040 <null_size@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1165 <xcalloc+0x35>
xor    %eax,%eax
call   1050 <out_of_mem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 (...) @null_size()
br label %13
13: ; preds = %11, %8
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = call i8* @calloc(i64 %14, i64 %15)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @out_of_mem()
br label %21
21: ; preds = %19, %13
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @null_size()
br label %8
8: ; preds = %2, %6
%9 = tail call i8* @calloc(i64 %0, i64 %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @out_of_mem()
br label %13
13: ; preds = %11, %8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ r4030_delay();
unsigned short r4030_read_reg16(unsigned long addr) {
  unsigned short ret = *((volatile unsigned short *)addr);
  r4030_delay();
  return ret;
}


x86 assembly (clang, -O0):
<r4030_read_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
mov    $0x0,%al
call   1030 <r4030_delay@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4030_read_reg16>:
push   %rbx
movzwl (%rdi),%ebx
xor    %eax,%eax
call   1030 <r4030_delay@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @r4030_read_reg16(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
store i16 %6, i16* %3
%7 = call i32 (...) @r4030_delay()
%8 = load i16, i16* %3
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @r4030_read_reg16(i64 %0) {
%2 = inttoptr i64 %0 to i16*
%3 = load volatile i16, i16* %2
%4 = tail call i32 (...) @r4030_delay()
ret i16 %3
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_outrfc_news(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_outrfc_news>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_outrfc_news(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_outrfc_news(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("getchar() != EOF evaluates to %d\n", getchar() != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"getchar() != EOF evaluates to %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"getchar() != EOF evaluates to %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *alloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *sclone(char const *s) {
  char *new = alloc(strlen(s) + 1);
  return strcpy(new, s);
}


x86 assembly (clang, -O0):
<sclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclone>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <alloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @sclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @alloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @sclone(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @alloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_10() {
  Assert_real((isqrt(10) == 3),
              "/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/stdlib/isqrt.c",
              55, ("Integer square root of 10 should be 3"));
}


x86 assembly (clang, -O0):
<t_sqrt_10>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <isqrt@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x37,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_10>:
push   %rax
mov    $0xa,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x37,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 10 should be 3\00"
define void @t_sqrt_10() {
%1 = call i32 @isqrt(i32 10)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 10 should be 3\00"
define void @t_sqrt_10() {
%1 = tail call i32 @isqrt(i32 10)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int do_062() { return 62; }


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

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

LLVM IR (-O0):
define i32 @do_062() {
ret i32 62
}

LLVM IR (-O2):
define i32 @do_062() {
ret i32 62
}
void gtk_text_iter_ends_line() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_ends_line() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("喂！\n\n你好！\n再见。\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"\E5\96\82\EF\BC\81\0A\0A\E4\BD\A0\E5\A5\BD\EF\BC\81\0A\E5\86\8D\E8\A7\81\E3\80\82\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"\E5\96\82\EF\BC\81\0A\0A\E4\BD\A0\E5\A5\BD\EF\BC\81\0A\E5\86\8D\E8\A7\81\E3\80\82\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct BoolExpr {
  int dummy;
};

/* Variables and functions */
struct BoolExpr *BX_IncRef(struct BoolExpr *);
struct BoolExpr *_fixed_binify(struct BoolExpr *op) {
  return BX_IncRef(op);
}


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

x86 assembly (clang, -O2):
<_fixed_binify>:
jmp    1030 <BX_IncRef@plt>

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

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
define %struct.BoolExpr* @_fixed_binify(%struct.BoolExpr* %0) {
%2 = tail call %struct.BoolExpr* @BX_IncRef(%struct.BoolExpr* %0)
ret %struct.BoolExpr* %2
}
void audioWrite(int reg, int val) {}


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

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

LLVM IR (-O0):
define void @audioWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @audioWrite(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void yyerror(char *errmsg) {
  fprintf(stderr, "Error: %s\n", errmsg);
  exit((6));
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x6,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, PetaLinux World! This application doesn't do anything! Look "
         "at the mylcd app, instead!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c"Hello, PetaLinux World! This application doesn't do anything! Look at the mylcd app, instead!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [94 x i8] c"Hello, PetaLinux World! This application doesn't do anything! Look at the mylcd app, instead!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printEvaluation(char *position, int32_t score) {
  printf("{");
  printf("\"fenString\": \"%s\", ", position);
  printf("\"score\": %i", score);
  printf("}\n");
}


x86 assembly (clang, -O0):
<printEvaluation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printEvaluation>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x7b,%edi
call   1030 <putchar@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [20 x i8] c"\22fenString\22: \22%s\22, \00"
@.str.2 = [12 x i8] c"\22score\22: %i\00"
@.str.3 = [3 x i8] c"}\0A\00"
define void @printEvaluation(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"\22fenString\22: \22%s\22, \00"
@.str.2 = [12 x i8] c"\22score\22: %i\00"
@str = [2 x i8] c"}\00"
define void @printEvaluation(i8* %0, i32 %1) {
%3 = tail call i32 @putchar(i32 123)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_03int64_highword_reg(long long val) {
  return ((val >> 32) & (0x03 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_03int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_03int64_highword_reg>:
movabs $0x300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_03int64_highword_reg(i64 %0) {
%2 = and i64 %0, 12884901888
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char GetBeaconAmpLeft();
unsigned char GetBeaconAmpRight();
int GetSensorDiff(void) {
  unsigned char LeftVal = GetBeaconAmpLeft();
  unsigned char RightVal = GetBeaconAmpRight();
  int Difference = LeftVal - RightVal;
  return Difference;
}


x86 assembly (clang, -O0):
<GetSensorDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <GetBeaconAmpLeft@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <GetBeaconAmpRight@plt>
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSensorDiff>:
push   %rbx
xor    %eax,%eax
call   1030 <GetBeaconAmpLeft@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <GetBeaconAmpRight@plt>
movzbl %bl,%ecx
movzbl %al,%eax
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetSensorDiff() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = call zeroext i8 (...) @GetBeaconAmpLeft()
store i8 %4, i8* %1
%5 = call zeroext i8 (...) @GetBeaconAmpRight()
store i8 %5, i8* %2
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @GetSensorDiff() {
%1 = tail call zeroext i8 (...) @GetBeaconAmpLeft()
%2 = tail call zeroext i8 (...) @GetBeaconAmpRight()
%3 = zext i8 %1 to i32
%4 = zext i8 %2 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
float ANTweenTimingFunctionCubicOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionCubicOut(float time, float duration) {
  return ANTweenTimingFunctionCubicOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionCubicOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionCubicOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionCubicOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionCubicOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionCubicOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionCubicOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
scalar_t__ COND_HI();
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_shi_8_pd(void) {
  m68ki_write_8(EA_AY_PD_8(), COND_HI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_shi_8_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_HI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_shi_8_pd>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_HI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_shi_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i64 (...) @COND_HI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_shi_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i64 (...) @COND_HI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int *malloc(int);
void getheap1(int **p) { *p = malloc(sizeof(int) * 10); }


x86 assembly (clang, -O0):
<getheap1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getheap1>:
push   %rbx
mov    %rdi,%rbx
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getheap1(i32** nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 40)
store i32* %2, i32** %0
ret void
}
void av_bsf_free() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num1, num2;
  int soma;
  num1 = 9;
  num2 = 10;
  soma = num1 + num2;
  printf("\nSoma = %d", soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x13,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0ASoma = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0ASoma = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 19)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pacman_get_jail_opening(int *, int *);
int found_jail(int col, int row) {
  int cx, cy;
  pacman_get_jail_opening(&cx, &cy);
  cy += 1;
  if (row == cy && col == cx)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<found_jail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <pacman_get_jail_opening@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1158 <found_jail+0x48>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1158 <found_jail+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <found_jail+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<found_jail>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <pacman_get_jail_opening@plt>
mov    (%rsp),%ecx
add    $0x1,%ecx
xor    0x4(%rsp),%ebp
xor    %ebx,%ecx
xor    %eax,%eax
or     %ecx,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @found_jail(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @pacman_get_jail_opening(i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = icmp eq i32 %9, %1
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, %0
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void null_eject(uint8_t id) {}


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

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

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

LLVM IR (-O2):
define void @null_eject(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void ooc_vma_gpool_free(void) {
  int ret;
  ret = 0;
  assert(!ret);
}


x86 assembly (clang, -O0):
<ooc_vma_gpool_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ooc_vma_gpool_free() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @ooc_vma_gpool_free() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
void CG_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_Shutdown() {
ret void
}
/* Type definitions */
struct man {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct man *);
int /*<<< orphan*/ man_free1(struct man *);
void man_free(struct man *man) {
  man_free1(man);
  free(man);
}


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

x86 assembly (clang, -O2):
<man_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <man_free1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.man = type { i32 }
define void @man_free(%struct.man* %0) {
%2 = tail call i32 @man_free1(%struct.man* %0)
%3 = tail call i32 @free(%struct.man* %0)
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ poll(struct pollfd *, int /*<<< orphan*/, int);
void sleep_us(unsigned int nusecs) {
  struct pollfd dummy;
  int timeout;
  if ((timeout = nusecs / 1000) <= 0)
    timeout = 1;
  poll(&dummy, 0, timeout);
}


x86 assembly (clang, -O0):
<sleep_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jg     113a <sleep_us+0x2a>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_us>:
mov    $0x1,%edx
cmp    $0x3e8,%edi
jb     112a <sleep_us+0x1a>
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rdx
shr    $0x26,%rdx
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <poll@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
define void @sleep_us(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.pollfd
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
store i32 %6, i32* %4
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %4
%11 = call i32 @poll(%struct.pollfd* %3, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define void @sleep_us(i32 %0) {
%2 = alloca %struct.pollfd
%3 = bitcast %struct.pollfd* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = icmp ult i32 %0, 1000
%6 = select i1 %5, i32 1, i32 %4
%7 = call i32 @poll(%struct.pollfd* %2, i32 0, i32 %6)
ret void
}
/* Variables and functions */
size_t strlen(char *const);
size_t fts_maxarglen(char *const *argv) {
  size_t len, max;
  for (max = 0; *argv; ++argv)
    if ((len = strlen(*argv)) > max)
      max = len;
  return (max);
}


x86 assembly (clang, -O0):
<fts_maxarglen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <fts_maxarglen+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jbe    1154 <fts_maxarglen+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <fts_maxarglen+0x49>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <fts_maxarglen+0x14>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_maxarglen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114a <fts_maxarglen+0x3a>
add    $0x8,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <strlen@plt>
cmp    %rbx,%rax
cmova  %rax,%rbx
mov    (%r14),%rdi
add    $0x8,%r14
test   %rdi,%rdi
jne    1130 <fts_maxarglen+0x20>
jmp    114c <fts_maxarglen+0x3c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fts_maxarglen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8** [ %11, %4 ], [ %0, %1 ]
%8 = tail call i64 @strlen(i8* %5)
%9 = icmp ugt i64 %8, %6
%10 = select i1 %9, i64 %8, i64 %6
%11 = getelementptr inbounds i8*, i8** %7, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Type definitions */
struct udev_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ udev_queue_get_seqnum_sequence_is_finished(
    struct udev_queue *, unsigned long long, unsigned long long);
__attribute__((visibility("default"))) int
udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue,
                                  unsigned long long int seqnum) {
  if (!udev_queue_get_seqnum_sequence_is_finished(udev_queue, seqnum, seqnum))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<udev_queue_get_seqnum_is_finished>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <udev_queue_get_seqnum_sequence_is_finished@plt>
cmp    $0x0,%eax
jne    1146 <udev_queue_get_seqnum_is_finished+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114d <udev_queue_get_seqnum_is_finished+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_queue_get_seqnum_is_finished>:
push   %rax
mov    %rsi,%rdx
call   1030 <udev_queue_get_seqnum_sequence_is_finished@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.udev_queue = type { i32 }
define i32 @udev_queue_get_seqnum_is_finished(%struct.udev_queue* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.udev_queue*
%5 = alloca i64
store %struct.udev_queue* %0, %struct.udev_queue** %4
store i64 %1, i64* %5
%6 = load %struct.udev_queue*, %struct.udev_queue** %4
%7 = load i64, i64* %5
%8 = load i64, i64* %5
%9 = call i32 @udev_queue_get_seqnum_sequence_is_finished(%struct.udev_queue* %6, i64 %7, i64 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.udev_queue = type { i32 }
define i32 @udev_queue_get_seqnum_is_finished(%struct.udev_queue* %0, i64 %1) {
%3 = tail call i32 @udev_queue_get_seqnum_sequence_is_finished(%struct.udev_queue* %0, i64 %1, i64 %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int main() {
  test2();
  test3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test2()
%2 = tail call i32 (...) @test3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_cleanup(int signum) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<sig_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sig_cleanup>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @sig_cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @sig_cleanup(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}