xunge/DecIR huggingface dataset:
/* Variables and functions */
char *longestPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", longestPalindrome("abbadd"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1040 <longestPalindrome@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"abbadd\00"
define i32 @main() {
%1 = tail call i8* @longestPalindrome(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print(double d) { printf("%g\n", d); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define void @print(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
int brain_hoshi_stones(void) {
  int value = 0;
  return value;
}


x86 assembly (clang, -O0):
<brain_hoshi_stones>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @brain_hoshi_stones() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("0123456789012345678901234567890123456789");
  printf("\rTesting.\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>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"0123456789012345678901234567890123456789\00"
@.str.1 = [11 x i8] c"\0DTesting.\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 ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"0123456789012345678901234567890123456789\00"
@str = [10 x i8] c"\0DTesting.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ libbf_compiler_dynalloc_toggle_suspend_or_resume(void *);
int libbf_getchar_with_data(void *user_data) {
  int ret;
  if (user_data != NULL) {
    libbf_compiler_dynalloc_toggle_suspend_or_resume(user_data);
  }
  ret = getchar();
  if (user_data != NULL) {
    libbf_compiler_dynalloc_toggle_suspend_or_resume(user_data);
  }
  return ret;
}


x86 assembly (clang, -O0):
<libbf_getchar_with_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <libbf_getchar_with_data+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <libbf_compiler_dynalloc_toggle_suspend_or_resume@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <libbf_getchar_with_data+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <libbf_compiler_dynalloc_toggle_suspend_or_resume@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libbf_getchar_with_data>:
test   %rdi,%rdi
je     114a <libbf_getchar_with_data+0x2a>
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <libbf_compiler_dynalloc_toggle_suspend_or_resume@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <libbf_compiler_dynalloc_toggle_suspend_or_resume@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
define i32 @libbf_getchar_with_data(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @getchar()
br label %9
5: ; preds = %1
%6 = tail call i32 @libbf_compiler_dynalloc_toggle_suspend_or_resume(i8* %0)
%7 = tail call i32 (...) @getchar()
%8 = tail call i32 @libbf_compiler_dynalloc_toggle_suspend_or_resume(i8* %0)
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %4, %3 ], [ %7, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_atim(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0000 | 0x0090);
}


x86 assembly (clang, -O0):
<ieee80211_is_atim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x90,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_atim>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x90,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_atim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 144)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_atim(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 144)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *oalloc(unsigned int len) {
  void *tmp;
  if ((tmp = malloc(len)) == NULL) {
    fprintf(stderr, "Can't allocate memory");
    exit(-1);
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<oalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1170 <oalloc+0x40>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <oalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Can't allocate memory\00"
define i8* @oalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Can't allocate memory\00"
define noalias i8* @oalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int CloseInput(int handle) {
  int irdevice = handle;
  close(irdevice);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @CloseInput(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 = call i32 @close(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @CloseInput(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
unsigned int get_u32_raw(void *addr) {
  unsigned char *b = addr;
  return (b[1] << 24) | (b[0] << 16) | (b[3] << 8) | (b[2]);
}


x86 assembly (clang, -O0):
<get_u32_raw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_u32_raw>:
movzbl 0x1(%rdi),%eax
shl    $0x18,%eax
movzbl (%rdi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movzbl 0x3(%rdi),%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl 0x2(%rdi),%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_u32_raw(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %5
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ addAddress(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Make IP List Utility (for the Lineo DHCP server)\n");
  addAddress("192.168.111.33");
  addAddress("192.168.111.34");
  addAddress("192.168.111.35");
  addAddress("192.168.111.36");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <addAddress@plt>
lea    0xecf(%rip),%rdi
call   1040 <addAddress@plt>
lea    0xed2(%rip),%rdi
call   1040 <addAddress@plt>
lea    0xed5(%rip),%rdi
call   1040 <addAddress@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Make IP List Utility (for the Lineo DHCP server)\0A\00"
@.str.1 = [15 x i8] c"192.168.111.33\00"
@.str.2 = [15 x i8] c"192.168.111.34\00"
@.str.3 = [15 x i8] c"192.168.111.35\00"
@.str.4 = [15 x i8] c"192.168.111.36\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"192.168.111.33\00"
@.str.2 = [15 x i8] c"192.168.111.34\00"
@.str.3 = [15 x i8] c"192.168.111.35\00"
@.str.4 = [15 x i8] c"192.168.111.36\00"
@str = [49 x i8] c"Make IP List Utility (for the Lineo DHCP server)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @addAddress(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
int test_imm_7Cint16_reg(short val) {
  return ((val) & (-0x7C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff84,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Cint16_reg>:
test   $0xff84,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -124
%6 = icmp ne i32 %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_7Cint16_reg(i16 signext %0) {
%2 = and i16 %0, -124
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dodir(char *, int);
int DOllist(void) {
  dodir(".", 1);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @DOllist() {
%1 = tail call i32 @dodir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int printw(char const *);
int n_printw(const char *fmt) { return (printw(fmt)); }


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

x86 assembly (clang, -O2):
<n_printw>:
jmp    1030 <printw@plt>

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

LLVM IR (-O2):
define i32 @n_printw(i8* %0) {
%2 = tail call i32 @printw(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_set_window_title() { exit(1); }


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

x86 assembly (clang, -O2):
<caml_gr_set_window_title>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @caml_gr_set_window_title() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ grid_user_update(int);
int world_update_proximity(int id) {
  grid_user_update(id);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @world_update_proximity(i32 %0) {
%2 = tail call i32 @grid_user_update(i32 %0)
ret i32 0
}
int sum(int n) {
  int s = 0;
  int i;
  for (i = 0; i <= n; i++) {
    s += i;
  }
  return s;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sum+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sum+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i33
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %8, %0
%10 = select i1 %2, i32 0, i32 %9
ret i32 %10
}
void foo218() {}


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

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

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

LLVM IR (-O2):
define void @foo218() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int *p;
  printf("p addr: %p\n", p);
  *p = 999;
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"p addr: %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* undef)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CTIMER3_DriverIRQHandler();
__attribute__((weak)) void CTIMER3_IRQHandler(void) {
  CTIMER3_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CTIMER3_IRQHandler() {
%1 = call i32 (...) @CTIMER3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CTIMER3_IRQHandler() {
%1 = tail call i32 (...) @CTIMER3_DriverIRQHandler()
ret void
}
unsigned long addis(unsigned char rd, unsigned char ra, unsigned short simm) {
  return (15 << 26) | (rd << 21) | (ra << 16) | (simm << 0);
}


x86 assembly (clang, -O0):
<addis>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x15,%eax
or     $0x3c000000,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<addis>:
mov    %edi,%eax
shl    $0x15,%rax
mov    %esi,%ecx
shl    $0x10,%rcx
or     %rax,%rcx
mov    %edx,%eax
or     %rcx,%rax
or     $0x3c000000,%rax
ret

LLVM IR (-O0):
define i64 @addis(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i16
store i8 %0, i8* %4
store i8 %1, i8* %5
store i16 %2, i16* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 21
%10 = or i32 1006632960, %9
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = shl i32 %16, 0
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @addis(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = zext i8 %0 to i64
%5 = shl nuw nsw i64 %4, 21
%6 = zext i8 %1 to i64
%7 = shl nuw nsw i64 %6, 16
%8 = zext i16 %2 to i64
%9 = or i64 %5, %7
%10 = or i64 %9, %8
%11 = or i64 %10, 1006632960
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
void hudMenuInit() { move(0, 0); }


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

x86 assembly (clang, -O2):
<hudMenuInit>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @hudMenuInit() {
%1 = call i32 @move(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @hudMenuInit() {
%1 = tail call i32 @move(i32 0, i32 0)
ret void
}
void VP8FiltersInitMIPSdspR2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8FiltersInitMIPSdspR2() {
ret void
}
void I2CMasterDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000001;
}


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

x86 assembly (clang, -O2):
<I2CMasterDisable>:
andq   $0xfffffffffffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -2
store volatile i64 %4, i64* %2
ret void
}
void FixContactName(char *contactName) {
  while (*contactName != 0) {
    if ((*contactName == '[') || (*contactName == ']'))
      *contactName = '~';
    contactName++;
  }
}


x86 assembly (clang, -O0):
<FixContactName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <FixContactName+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
je     1138 <FixContactName+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    113f <FixContactName+0x3f>
mov    -0x8(%rbp),%rax
movb   $0x7e,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <FixContactName+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixContactName>:
jmp    1117 <FixContactName+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x7e,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5b,%al
je     1110 <FixContactName+0x10>
cmp    $0x5d,%al
je     1110 <FixContactName+0x10>
test   %al,%al
jne    1113 <FixContactName+0x13>
ret

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

LLVM IR (-O2):
define void @FixContactName(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 91, label %5
i8 93, label %5
]
5: ; preds = %2, %2
store i8 126, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int __int32_t_encoded_array_size(const int32_t *p, int elements) {
  (void)p;
  return sizeof(int32_t) * elements;
}


x86 assembly (clang, -O0):
<__int32_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int32_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int32_t_encoded_array_size(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__int32_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bench(int);
int main() {
  bench((10 * 1000 * 1000));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x989680,%edi
call   1030 <bench@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bench(i32 10000000)
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int main() {
  if ((write(1, "here is some data\n", 40)) == -1)
    write(2, "some error occured", 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x28,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1154 <main+0x44>
mov    $0x2,%edi
lea    0xec9(%rip),%rsi
mov    $0x14,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x28,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1142 <main+0x32>
lea    0xee0(%rip),%rsi
mov    $0x2,%edi
mov    $0x14,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"here is some data\0A\00"
@.str.1 = [19 x i8] c"some error occured\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 40)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @write(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 20)
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"here is some data\0A\00"
@.str.1 = [19 x i8] c"some error occured\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 40)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 20)
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
float my_acos(float);
float my_asin(float x) { return (3.141592653589793 / 2) - my_acos(x); }


x86 assembly (clang, -O0):
<my_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <my_acos@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_asin>:
push   %rax
call   1030 <my_acos@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @my_acos(float %3)
%5 = fpext float %4 to double
%6 = fsub double 0x3FF921FB54442D18, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @my_asin(float %0) {
%2 = tail call float @my_acos(float %0)
%3 = fpext float %2 to double
%4 = fsub double 0x3FF921FB54442D18, %3
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *, char const *);
int /*<<< orphan*/ refresh();
void prompt(const char *mesg) {
  move(2, 20);
  printw("%s", mesg);
  move(2 + 1, 20);
  refresh();
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x14,%esi
call   1050 <move@plt>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printw@plt>
mov    $0x3,%edi
mov    $0x14,%esi
call   1050 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x14,%esi
call   1050 <move@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printw@plt>
mov    $0x3,%edi
mov    $0x14,%esi
call   1050 <move@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prompt(i8* %0) {
%2 = tail call i32 @move(i32 2, i32 20)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @move(i32 3, i32 20)
%5 = tail call i32 (...) @refresh()
ret void
}
float modf_c(float x, int *i) {
  int n;
  n = (int)x;
  *i = n;
  x = x - (float)n;
  return x;
}


x86 assembly (clang, -O0):
<modf_c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf_c>:
cvttss2si %xmm0,%eax
mov    %eax,(%rdi)
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @modf_c(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca i32
store float %0, float* %3
store i32* %1, i32** %4
%6 = load float, float* %3
%7 = fptosi float %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load float, float* %3
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
%13 = fsub float %10, %12
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @modf_c(float %0, i32* nocapture writeonly %1) {
%3 = fptosi float %0 to i32
store i32 %3, i32* %1
%4 = sitofp i32 %3 to float
%5 = fsub float %0, %4
ret float %5
}
void gdk_function_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_function_get_type() {
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int check_websocket_response(char *response) {
  char *pos = strstr(response, "Sec-WebSocket-Accept");
  if (pos) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_websocket_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <check_websocket_response+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114e <check_websocket_response+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_websocket_response>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Sec-WebSocket-Accept\00"
define i32 @check_websocket_response(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"Sec-WebSocket-Accept\00"
define i32 @check_websocket_response(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getopt_internal(int, char **, char const *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int getopt(int argc, char **argv, const char *optstring) {
  return getopt_internal(argc, argv, optstring, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <getopt_internal@plt>

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

LLVM IR (-O2):
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ rsp_log(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
void rsp_log_error(char *message) {
  char *error = strerror(errno);
  rsp_log("%s: %s", message, error);
}


x86 assembly (clang, -O0):
<rsp_log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <rsp_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsp_log_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <rsp_log@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [7 x i8] c"%s: %s\00"
define void @rsp_log_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @rsp_log(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [7 x i8] c"%s: %s\00"
define void @rsp_log_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @rsp_log(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int f1(int *);
int f2(int *p) { return f1(p); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define i32 @f2(i32* %0) {
%2 = tail call i32 @f1(i32* %0)
ret i32 %2
}
void sercomm_drv_unlock(unsigned long __attribute__((unused)) * flags) {}


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

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

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

LLVM IR (-O2):
define void @sercomm_drv_unlock(i64* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int samsung_get_base_gpio();
unsigned int s5p_gpio_base(int nr) { return samsung_get_base_gpio(); }


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

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

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

LLVM IR (-O2):
define i32 @s5p_gpio_base(i32 %0) {
%2 = tail call i32 (...) @samsung_get_base_gpio()
ret i32 %2
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int ioctl(int, int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ isatty(int);
int tcgetattr(int fd, struct termios *termios_p) {
  if (!isatty(fd))
    return -1;
  return ioctl(fd, TCGETS, termios_p);
}


x86 assembly (clang, -O0):
<tcgetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
jne    114c <tcgetattr+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <tcgetattr+0x44>
mov    -0x8(%rbp),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetattr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <isatty@plt>
test   %eax,%eax
je     114a <tcgetattr+0x2a>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.termios*
store i32 %0, i32* %4
store %struct.termios* %1, %struct.termios** %5
%6 = load i32, i32* %4
%7 = call i32 @isatty(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 -1, i32* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* @TCGETS
%13 = load %struct.termios*, %struct.termios** %5
%14 = call i32 @ioctl(i32 %11, i32 %12, %struct.termios* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = tail call i32 @isatty(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @TCGETS
%7 = tail call i32 @ioctl(i32 %0, i32 %6, %struct.termios* %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char god = 'g';
  char no = 'n';
  printf("god: %c\nno: %c\n", god, no);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x67,-0x5(%rbp)
movb   $0x6e,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xecf(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
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    $0x67,%esi
mov    $0x6e,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"god: %c\0Ano: %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext 103, i8 signext 110)
ret i32 0
}
/* Variables and functions */
int real_main(int, char **);
int main(int argc, char **argv) { return real_main(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <real_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <real_main@plt>

LLVM IR (-O0):
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 = load i8**, i8*** %5
%8 = call i32 @real_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @real_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x27() {
  Assert_real((isalnum(39) == 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_isalnum.c",
              200, ("isalnum should be 0 for '"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x27>:
push   %rax
mov    $0x27,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xc8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for '\00"
define void @t_isalnum_0x27() {
%1 = tail call i64 @isalnum(i32 39)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 200, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}