xunge/DecIR huggingface dataset:
/* Variables and functions */
bool is_palindrome(int num) {
  int tmp = num;
  int revnum = 0;
  while (tmp) {
    revnum = revnum * 10 + tmp % 10;
    tmp /= 10;
  }
  if (revnum == num)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <is_palindrome+0x4b>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <is_palindrome+0x14>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1163 <is_palindrome+0x63>
movl   $0x1,-0x4(%rbp)
jmp    116a <is_palindrome+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome>:
xor    %edx,%edx
test   %edi,%edi
je     1141 <is_palindrome+0x41>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <is_palindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_palindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int EOF;
int MB_CUR_MAX;
int wctob(wint_t c) {
  if (MB_CUR_MAX == 1) {
    if (256 > (unsigned)c)
      return c;
  } else {
    if (128 > (unsigned)c)
      return c;
  }
  return EOF;
}


x86 assembly (clang, -O0):
<wctob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0x2eea(%rip),%rax
cmpl   $0x1,(%rax)
jne    1135 <wctob+0x35>
mov    $0x100,%eax
cmp    -0x8(%rbp),%eax
jbe    1130 <wctob+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <wctob+0x5f>
jmp    1153 <wctob+0x53>
mov    $0x80,%eax
cmp    -0x8(%rbp),%eax
jbe    114e <wctob+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <wctob+0x5f>
jmp    1153 <wctob+0x53>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctob>:
mov    %edi,%eax
mov    0x2eef(%rip),%rcx
cmpl   $0x1,(%rcx)
jne    1117 <wctob+0x17>
cmp    $0x100,%eax
jae    111e <wctob+0x1e>
jmp    1127 <wctob+0x27>
cmp    $0x80,%eax
jb     1127 <wctob+0x27>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@MB_CUR_MAX = global i32 0
@EOF = global i32 0
define i32 @wctob(i32 %0) {
%2 = load i32, i32* @MB_CUR_MAX
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = icmp ult i32 %0, 256
br i1 %5, label %10, label %8
6: ; preds = %1
%7 = icmp ult i32 %0, 128
br i1 %7, label %10, label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EOF
br label %10
10: ; preds = %6, %4, %8
%11 = phi i32 [ %9, %8 ], [ %0, %4 ], [ %0, %6 ]
ret i32 %11
}
unsigned virt_to_phys(unsigned addr) {
  if (addr >= 0x80000000 && addr < 0xA0000000)
    return addr - 0x80000000;
  if (addr >= 0xA0000000 && addr < 0xC0000000)
    return addr - 0xA0000000;
  return addr;
}


x86 assembly (clang, -O0):
<virt_to_phys>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jb     1131 <virt_to_phys+0x31>
cmpl   $0xa0000000,-0x8(%rbp)
jae    1131 <virt_to_phys+0x31>
mov    -0x8(%rbp),%eax
sub    $0x80000000,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <virt_to_phys+0x61>
cmpl   $0xa0000000,-0x8(%rbp)
jb     115b <virt_to_phys+0x5b>
cmpl   $0xc0000000,-0x8(%rbp)
jae    115b <virt_to_phys+0x5b>
mov    -0x8(%rbp),%eax
sub    $0xa0000000,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <virt_to_phys+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<virt_to_phys>:
mov    %edi,%eax
cmp    $0x9fffffff,%edi
jg     1110 <virt_to_phys+0x10>
xor    $0x80000000,%eax
ret
mov    %eax,%ecx
and    $0xe0000000,%ecx
lea    0x60000000(%rax),%edx
cmp    $0xa0000000,%ecx
cmovne %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @virt_to_phys(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp uge i32 %4, -2147483648
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, -1610612736
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub i32 %10, -2147483648
store i32 %11, i32* %2
br label %23
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp uge i32 %13, -1610612736
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp ult i32 %16, -1073741824
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub i32 %19, -1610612736
store i32 %20, i32* %2
br label %23
21: ; preds = %15, %12
%22 = load i32, i32* %3
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %18, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @virt_to_phys(i32 %0) {
%2 = icmp slt i32 %0, -1610612736
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = xor i32 %0, -2147483648
br label %10
5: ; preds = %1
%6 = and i32 %0, -536870912
%7 = icmp eq i32 %6, -1610612736
%8 = add i32 %0, 1610612736
%9 = select i1 %7, i32 %8, i32 %0
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ %4, %3 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ compare_header_text(unsigned char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int verify_string(unsigned char header[], char string[], int loc) {
  if (compare_header_text(header, string, loc) == 0) {
    printf("PASS: %s found\n", string);
    return 1;
  } else {
    printf("FAIL: %s missing\n", string);
    return 0;
  }
}


x86 assembly (clang, -O0):
<verify_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <compare_header_text@plt>
cmp    $0x0,%rax
jne    1169 <verify_string+0x49>
mov    -0x18(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <verify_string+0x60>
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <compare_header_text@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
lea    0xec5(%rip),%rax
lea    0xece(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"PASS: %s found\0A\00"
@.str.1 = [18 x i8] c"FAIL: %s missing\0A\00"
define i32 @verify_string(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = call i64 @compare_header_text(i8* %8, i8* %9, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 1, i32* %4
br label %19
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %17)
store i32 0, i32* %4
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"PASS: %s found\0A\00"
@.str.1 = [18 x i8] c"FAIL: %s missing\0A\00"
define i32 @verify_string(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @compare_header_text(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
%7 = zext i1 %5 to i32
%8 = tail call i32 @printf(i8* %6, i8* %1)
ret i32 %7
}
const char *ccnxNotifyAPIAbout_Name(void) { return "CCNx Notify API"; }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"CCNx Notify API\00"
define i8* @ccnxNotifyAPIAbout_Name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"CCNx Notify API\00"
define i8* @ccnxNotifyAPIAbout_Name() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ spxec_drft_clear(void *);
void spxec_fft_destroy(void *table) {
  spxec_drft_clear(table);
  free(table);
}


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

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

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

LLVM IR (-O2):
define void @spxec_fft_destroy(i8* %0) {
%2 = tail call i32 @spxec_drft_clear(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SV_SetConfigstring(int, char *);
int /*<<< orphan*/ Scr_Error(char *);
int Scr_GetInt(int /*<<< orphan*/);
int Scr_GetNumParam();
char *Scr_GetString(int);
void GScr_SetConfigstring() {
  if (Scr_GetNumParam() != 2) {
    Scr_Error("Usage: SetConfigstring(<int>, <string>)");
  }
  int id = Scr_GetInt(0);
  char *value = Scr_GetString(1);
  SV_SetConfigstring(id, value);
}


x86 assembly (clang, -O0):
<GScr_SetConfigstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Scr_GetNumParam@plt>
cmp    $0x2,%eax
je     1174 <GScr_SetConfigstring+0x24>
lea    0xe91(%rip),%rdi
call   1050 <Scr_Error@plt>
xor    %edi,%edi
call   1070 <Scr_GetInt@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <Scr_GetString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <SV_SetConfigstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GScr_SetConfigstring>:
push   %rbx
xor    %eax,%eax
call   1030 <Scr_GetNumParam@plt>
cmp    $0x2,%eax
je     1169 <GScr_SetConfigstring+0x19>
lea    0xe9c(%rip),%rdi
call   1050 <Scr_Error@plt>
xor    %edi,%edi
call   1070 <Scr_GetInt@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <Scr_GetString@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1060 <SV_SetConfigstring@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: SetConfigstring(<int>, <string>)\00"
define void @GScr_SetConfigstring() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @Scr_GetNumParam()
%4 = icmp ne i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @Scr_Error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @Scr_GetInt(i32 0)
store i32 %8, i32* %1
%9 = call i8* @Scr_GetString(i32 1)
store i8* %9, i8** %2
%10 = load i32, i32* %1
%11 = load i8*, i8** %2
%12 = call i32 @SV_SetConfigstring(i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Usage: SetConfigstring(<int>, <string>)\00"
define void @GScr_SetConfigstring() {
%1 = tail call i32 (...) @Scr_GetNumParam()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @Scr_Error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @Scr_GetInt(i32 0)
%7 = tail call i8* @Scr_GetString(i32 1)
%8 = tail call i32 @SV_SetConfigstring(i32 %6, i8* %7)
ret void
}
/* Variables and functions */
scalar_t__ getstatfspath();
int /*<<< orphan*/ printf(char *);
int main() {
  if (getstatfspath() != 0)
    printf("error..\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getstatfspath@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
lea    0xeb9(%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 <getstatfspath@plt>
test   %rax,%rax
je     1139 <main+0x19>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"error..\00"
define i32 @main() {
%1 = tail call i64 (...) @getstatfspath()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_memset(void *, int /*<<< orphan*/, size_t);
void ft_bzero(void *s, size_t n) { ft_memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<ft_bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <ft_memset@plt>

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

LLVM IR (-O2):
define void @ft_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @ft_memset(i8* %0, i32 0, i64 %1)
ret void
}
void lgtd_lifx_wire_null_packet_encoder_decoder(void *pkt) { (void)pkt; }


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

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

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

LLVM IR (-O2):
define void @lgtd_lifx_wire_null_packet_encoder_decoder(i8* nocapture %0) {
ret void
}
int test_imm_9Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x9B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Buint64_highword_mem>:
testb  $0x9b,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 665719930880
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo656() {}


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

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

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

LLVM IR (-O2):
define void @foo656() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int main(void) {
  int res;
  res = rand();
  printf("%d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <rand@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int do_smbus_read_byte(int, unsigned int, unsigned int);
int smbusx_read_byte(unsigned smb_index, unsigned device, unsigned address) {
  return do_smbus_read_byte(0x1000 + (smb_index << 8), device, address);
}


x86 assembly (clang, -O0):
<smbusx_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
add    $0x1000,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <do_smbus_read_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbusx_read_byte>:
shl    $0x8,%edi
add    $0x1000,%edi
jmp    1030 <do_smbus_read_byte@plt>

LLVM IR (-O0):
define i32 @smbusx_read_byte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 8
%9 = add i32 4096, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @do_smbus_read_byte(i32 %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @smbusx_read_byte(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = add i32 %4, 4096
%6 = tail call i32 @do_smbus_read_byte(i32 %5, i32 %1, i32 %2)
ret i32 %6
}
int cairo_code_draw_casValueLabel_get_height() { return 10; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casValueLabel_get_height() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casValueLabel_get_height() {
ret i32 10
}
int eval(int t) { return t; }


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

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

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

LLVM IR (-O2):
define i32 @eval(i32 returned %0) {
ret i32 %0
}
_rw_read_held() { printf("proc-stub:%s\n", __func__); }


x86 assembly (clang, -O0):
<_rw_read_held>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rw_read_held>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"proc-stub:%s\0A\00"
@__func__._rw_read_held = [14 x i8] c"_rw_read_held\00"
define i32 @_rw_read_held() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__._rw_read_held, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"proc-stub:%s\0A\00"
@__func__._rw_read_held = [14 x i8] c"_rw_read_held\00"
define i32 @_rw_read_held() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__._rw_read_held, i64 0, i64 0))
ret i32 undef
}
void ScaleRowDown34_1_Box_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_1_Box_Any_SSSE3() {
ret void
}
void dfn_ai(int i) {}


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

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

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

LLVM IR (-O2):
define void @dfn_ai(i32 %0) {
ret void
}
/* Variables and functions */
int f70(int *);
int f71(int *p) { return f70(p); }


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

x86 assembly (clang, -O2):
<f71>:
jmp    1030 <f70@plt>

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

LLVM IR (-O2):
define i32 @f71(i32* %0) {
%2 = tail call i32 @f70(i32* %0)
ret i32 %2
}
void osDbgPrintf(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @osDbgPrintf(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_weight_w16_mmxext(int /*<<< orphan*/ *, int,
                                                    int /*<<< orphan*/ *, int,
                                                    int, int);
void p264_pixel_avg_weight_16x8_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                                       int i_src, int i_weight_dst) {
  p264_pixel_avg_weight_w16_mmxext(dst, i_dst, src, i_src, i_weight_dst, 8);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_weight_16x8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x8,%r9d
call   1030 <p264_pixel_avg_weight_w16_mmxext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_weight_16x8_mmxext>:
mov    $0x8,%r9d
jmp    1030 <p264_pixel_avg_weight_w16_mmxext@plt>

LLVM IR (-O0):
define void @p264_pixel_avg_weight_16x8_mmxext(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @p264_pixel_avg_weight_w16_mmxext(i32* %11, i32 %12, i32* %13, i32 %14, i32 %15, i32 8)
ret void
}

LLVM IR (-O2):
define void @p264_pixel_avg_weight_16x8_mmxext(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @p264_pixel_avg_weight_w16_mmxext(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4, i32 8)
ret void
}
const char *cGUIDStr() {
  static const char *gGuidStr = "{87A94AB0-E370-4cde-98D3-ACC110C5967D}";
  return gGuidStr;
}


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

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

LLVM IR (-O0):
@cGUIDStr.gGuidStr = internal global i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i32 0, i32 0)
@.str = [39 x i8] c"{87A94AB0-E370-4cde-98D3-ACC110C5967D}\00"
define i8* @cGUIDStr() {
%1 = load i8*, i8** @cGUIDStr.gGuidStr
ret i8* %1
}

LLVM IR (-O2):
@.str = [39 x i8] c"{87A94AB0-E370-4cde-98D3-ACC110C5967D}\00"
define i8* @cGUIDStr() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
void vld_Abs2Conc(_rep, _Base_Abs2Conc) int *_rep, _Base_Abs2Conc;
{ Abs2Conc_XST_FNC_OBJ(_rep, _Base_Abs2Conc); }


x86 assembly (clang, -O0):
<vld_Abs2Conc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <Abs2Conc_XST_FNC_OBJ@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vld_Abs2Conc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @Abs2Conc_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @vld_Abs2Conc(i32* %0, i32 %1) {
%3 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @Abs2Conc_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %0, i32 %1)
ret void
}
void PWM1Generator3_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PWM1Generator3_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM1Generator3_Handler+0x9>
jmp    1109 <PWM1Generator3_Handler+0x9>

x86 assembly (clang, -O2):
<PWM1Generator3_Handler>:
jmp    1100 <PWM1Generator3_Handler>

LLVM IR (-O0):
define void @PWM1Generator3_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM1Generator3_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void leggiVettore(int *a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
}


x86 assembly (clang, -O0):
<leggiVettore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <leggiVettore+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <leggiVettore+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leggiVettore>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <leggiVettore+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <leggiVettore+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @leggiVettore(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("usage: %s <n>\n", argv[0]);
    exit(0);
  }
  foo(atoi(argv[1]));
  exit(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)
cmpl   $0x2,-0x8(%rbp)
jge    117a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <foo@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     115c <main+0x1c>
mov    (%rsi),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <foo@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"usage: %s <n>\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @foo(i32 %18)
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"usage: %s <n>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @foo(i32 %11)
%13 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa7() {
  Assert_real((isodigit(167) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              840, ("isodigit should be 0 for 0xa7"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa7\00"
define void @t_isodigit_0xa7() {
%1 = call i64 @isodigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa7\00"
define void @t_isodigit_0xa7() {
%1 = tail call i64 @isodigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_stack_main();
int main(int argc, char *argv[]) { test_stack_main(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @test_stack_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_stack_main()
ret i32 0
}
/* Type definitions */
struct student {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct student *);
void deallocate(struct student *stud) { free(stud); }


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

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

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

LLVM IR (-O2):
%struct.student = type { i32 }
define void @deallocate(%struct.student* nocapture %0) {
%2 = tail call i32 @free(%struct.student* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charattr(int);
int /*<<< orphan*/ printw(char *, int);
fgcolor(int a) {
  if (a < 16)
    charattr(a < 8 ? a + 30 : a + 82);
  else
    printw("\e[38;5;%dm", a);
}


x86 assembly (clang, -O0):
<fgcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1163 <fgcolor+0x43>
cmpl   $0x8,-0x8(%rbp)
jge    114d <fgcolor+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1e,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <fgcolor+0x36>
mov    -0x8(%rbp),%eax
add    $0x52,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <charattr@plt>
jmp    1172 <fgcolor+0x52>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printw@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgcolor>:
push   %rax
mov    %edi,%esi
cmp    $0xf,%edi
jg     113b <fgcolor+0x1b>
lea    0x52(%rsi),%eax
lea    0x1e(%rsi),%edi
cmp    $0x8,%esi
cmovge %eax,%edi
call   1040 <charattr@plt>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1030 <printw@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[38;5;%dm\00"
define i32 @fgcolor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 30
br label %15
12: ; preds = %6
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 82
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ %11, %9 ], [ %14, %12 ]
%17 = call i32 @charattr(i32 %16)
br label %21
18: ; preds = %1
%19 = load i32, i32* %3
%20 = call i32 @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[38;5;%dm\00"
define i32 @fgcolor(i32 %0) {
%2 = icmp slt i32 %0, 16
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = icmp slt i32 %0, 8
%5 = select i1 %4, i32 30, i32 82
%6 = add nsw i32 %5, %0
%7 = tail call i32 @charattr(i32 %6)
br label %10
8: ; preds = %1
%9 = tail call i32 @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %3
ret i32 undef
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stat(char *, struct stat *);
void main(int argc, char **argv) {
  struct stat s;
  stat(argv[1], &s);
  printf("%c%c", (int)s.st_size & 0xff, (int)(s.st_size >> 8) & 0xff);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x18(%rbp),%esi
and    $0xff,%esi
mov    -0x18(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%eax
movzbl %al,%esi
movzbl %ah,%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"%c%c\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.stat
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @stat(i8* %8, %struct.stat* %5)
%10 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%11 = load i32, i32* %10
%12 = and i32 %11, 255
%13 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%14 = load i32, i32* %13
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %16)
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"%c%c\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @stat(i8* %6, %struct.stat* %3)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = lshr i32 %9, 8
%12 = and i32 %11, 255
%13 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void write8le(uint8_t v, uint8_t *dest) { *dest = v; }


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

x86 assembly (clang, -O2):
<write8le>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @write8le(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
/* Variables and functions */
double floor(double);
double mjd_day(double mj) { return (floor(mj - 0.5) + 0.5); }


x86 assembly (clang, -O0):
<mjd_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd_day>:
push   %rax
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mjd_day(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
%6 = fadd double %5, 5.000000e-01
ret double %6
}

LLVM IR (-O2):
define double @mjd_day(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fadd double %3, 5.000000e-01
ret double %4
}
int rOne(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @rOne() {
ret i32 1
}

LLVM IR (-O2):
define i32 @rOne() {
ret i32 1
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double asinl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
#define EBADF 131
#define EEXIST 130
#define EINVAL 129
#define ENOENT 128
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
const char *custom_strerror(int errnum) {
  return "x";
  switch (errnum) {
  case 0:
    return "Success";
  case EINVAL:
    return "Invalid argument";
  case EBADF:
    return "Bad file descriptor";
  case ENOENT:
    return "No such file or directory";
  case EEXIST:
    return "File exists";
  default:
    printf("oops unknown errno %d\n", errnum);
    assert(0);
  }
  return "xxx";
}


x86 assembly (clang, -O0):
<custom_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
define i8* @custom_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
define i8* @custom_strerror(i32 %0) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t func16(uint16_t x) {
  uint16_t n = x;
  n = ((n & 0xff00) >> 8) | ((n & 0x00ff) << 8);
  n = ((n & 0xf0f0) >> 4) | ((n & 0x0f0f) << 4);
  n = ((n & 0xcccc) >> 2) | ((n & 0x3333) << 2);
  n = ((n & 0xaaaa) >> 1) | ((n & 0x5555) << 1);
  return n;
}


x86 assembly (clang, -O0):
<func16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0f0,%eax
sar    $0x4,%eax
mov    -0x8(%rbp),%ecx
and    $0xf0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xcccc,%eax
sar    $0x2,%eax
mov    -0x8(%rbp),%ecx
and    $0x3333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xaaaa,%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x5555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func16>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @func16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = and i32 %12, 61680
%14 = ashr i32 %13, 4
%15 = load i32, i32* %3
%16 = and i32 %15, 3855
%17 = shl i32 %16, 4
%18 = or i32 %14, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = and i32 %19, 52428
%21 = ashr i32 %20, 2
%22 = load i32, i32* %3
%23 = and i32 %22, 13107
%24 = shl i32 %23, 2
%25 = or i32 %21, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = and i32 %26, 43690
%28 = ashr i32 %27, 1
%29 = load i32, i32* %3
%30 = and i32 %29, 21845
%31 = shl i32 %30, 1
%32 = or i32 %28, %31
store i32 %32, i32* %3
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @func16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bitreverse.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}