xunge/DecIR huggingface dataset:
int is_little_endian(void) {
  static const int indian = 1;
  return (*(const char *)(const void *)&indian != 0);
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@is_little_endian.indian = internal constant i32 1
define i32 @is_little_endian() {
%1 = load i8, i8* bitcast (i32* @is_little_endian.indian to i8*)
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void stub1();
int main(void) {
  char *shellcode = "\x6a\x01\x58\x31\xdb\xcd\x80";
  printf("strlen(shellcode)=%d\n", strlen(shellcode));
  ((void (*)(void))shellcode)();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
call   2000 <_fini+0xebc>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"j\01X1\DB\CD\80\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to void ()*
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"j\01X1\DB\CD\80\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %1)
tail call void bitcast ([8 x i8]* @.str to void ()*)()
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn71() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn71");
  return result;
}


x86 assembly (clang, -O0):
<fn71>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn71>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn71\00"
define i8* @fn71() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn71\00"
define i8* @fn71() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int SyncLocalTime() {
  fprintf(stderr, "AUX mode of NexStar uses computer time only \n");
  return -1;
}


x86 assembly (clang, -O0):
<SyncLocalTime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SyncLocalTime>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"AUX mode of NexStar uses computer time only \0A\00"
define i32 @SyncLocalTime() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"AUX mode of NexStar uses computer time only \0A\00"
define i32 @SyncLocalTime() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int foo(int i, int *a) {
  int e;
  for (; i; i++)
    e = *a;
  return e;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <foo+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     1107 <foo+0x7>
mov    (%rsi),%eax
ret
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ undef, %2 ]
ret i32 %7
}
void outw(unsigned short port, unsigned short data) {
  asm volatile("out"
               "w"
               " %1,%0"
               :
               : "d"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $1,$0", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
int main(int argc, char *argv[]) {
  int a = 0;
  int b = 1;
  a = b / a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void gtk_file_chooser_set_preview_widget_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_preview_widget_active() {
ret void
}
int uintcmp(unsigned a, unsigned b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<uintcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1122 <uintcmp+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <uintcmp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113a <uintcmp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <uintcmp+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uintcmp>:
xor    %ecx,%ecx
cmp    %esi,%edi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uintcmp(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = icmp ugt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void room_print(char *info) {
  printf(" \033[0;33m "
         "%s"
         " \033[0m\n",
         info);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c" \1B[0;33m %s \1B[0m\0A\00"
define void @room_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned int explicit_conversion_interference1(unsigned int c) {
  signed int b;
  return (unsigned int)(b = c);
}


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

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

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

LLVM IR (-O2):
define i32 @explicit_conversion_interference1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printMessage(char *);
int /*<<< orphan*/ scanf(char *, int *);
int readNumber(char msg[]) {
  printMessage(msg);
  int *digit = NULL;
  digit = malloc(0);
  scanf("%d", digit);
  return *digit;
}


x86 assembly (clang, -O0):
<readNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printMessage@plt>
movq   $0x0,-0x10(%rbp)
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNumber>:
push   %rbx
call   1030 <printMessage@plt>
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @readNumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printMessage(i8* %4)
store i32* null, i32** %3
%6 = call i32* @malloc(i32 0)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readNumber(i8* %0) {
%2 = tail call i32 @printMessage(i8* %0)
%3 = tail call i32* @malloc(i32 0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
ret i32 %5
}
/* Type definitions */
typedef char *uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint32_t inport32(uint16_t port) {
  uint32_t v;
  asm volatile("inl %%dx,%%eax" : "=a"(v) : "d"(port));
  return v;
}


x86 assembly (clang, -O0):
<inport32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inport32>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i8* @inport32(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inport32(i32 %0) {
%2 = tail call i8* asm sideeffect "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ outbyte(char);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ stdout;
main() {
  char buf[20];
  outbyte('&');
  outbyte('@');
  outbyte('$');
  outbyte('%');
  print("FooBar\r\n");
  print("\r\nDone...\r\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x26,%edi
call   1050 <outbyte@plt>
mov    $0x40,%edi
call   1050 <outbyte@plt>
mov    $0x24,%edi
call   1050 <outbyte@plt>
mov    $0x25,%edi
call   1050 <outbyte@plt>
lea    0xe99(%rip),%rdi
call   1030 <print@plt>
lea    0xe96(%rip),%rdi
call   1030 <print@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x26,%edi
call   1050 <outbyte@plt>
mov    $0x40,%edi
call   1050 <outbyte@plt>
mov    $0x24,%edi
call   1050 <outbyte@plt>
mov    $0x25,%edi
call   1050 <outbyte@plt>
lea    0xea0(%rip),%rdi
call   1030 <print@plt>
lea    0xe9d(%rip),%rdi
call   1030 <print@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"FooBar\0D\0A\00"
@.str.1 = [12 x i8] c"\0D\0ADone...\0D\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = call i32 @outbyte(i8 signext 38)
%3 = call i32 @outbyte(i8 signext 64)
%4 = call i32 @outbyte(i8 signext 36)
%5 = call i32 @outbyte(i8 signext 37)
%6 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"FooBar\0D\0A\00"
@.str.1 = [12 x i8] c"\0D\0ADone...\0D\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @outbyte(i8 signext 38)
%2 = tail call i32 @outbyte(i8 signext 64)
%3 = tail call i32 @outbyte(i8 signext 36)
%4 = tail call i32 @outbyte(i8 signext 37)
%5 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x45() {
  Assert_real((isodigit(69) == 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",
              350, ("isodigit should be 0 for E"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x45>:
push   %rax
mov    $0x45,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x15e,%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 = [27 x i8] c"isodigit should be 0 for E\00"
define void @t_isodigit_0x45() {
%1 = call i64 @isodigit(i32 69)
%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 350, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isodigit should be 0 for E\00"
define void @t_isodigit_0x45() {
%1 = tail call i64 @isodigit(i32 69)
%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 350, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintRTF(char *, int, int);
int getDimension();
void CmdKern(int code) {
  int size = getDimension() * 2;
  fprintRTF("\\expnd%d\\expndtw%d ", size, size);
}


x86 assembly (clang, -O0):
<CmdKern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getDimension@plt>
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1040 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdKern>:
push   %rax
xor    %eax,%eax
call   1030 <getDimension@plt>
lea    (%rax,%rax,1),%edx
lea    0xece(%rip),%rdi
mov    %edx,%esi
pop    %rax
jmp    1040 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\\expnd%d\\expndtw%d \00"
define void @CmdKern(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @getDimension()
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @fprintRTF(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\\expnd%d\\expndtw%d \00"
define void @CmdKern(i32 %0) {
%2 = tail call i32 (...) @getDimension()
%3 = shl nsw i32 %2, 1
%4 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_si64(void *, int /*<<< orphan*/);
void test_mm_storeu_si64(void *A, __m128i B) { _mm_storeu_si64(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_storeu_si64>:
jmp    1030 <_mm_storeu_si64@plt>

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

LLVM IR (-O2):
define void @test_mm_storeu_si64(i8* %0, i32 %1) {
%3 = tail call i32 @_mm_storeu_si64(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vec4f_scalarMult_new(float *, float *, float const);
void vec4f_scalarMult(float v[4], const float scalar) {
  vec4f_scalarMult_new(v, v, scalar);
}


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

x86 assembly (clang, -O2):
<vec4f_scalarMult>:
mov    %rdi,%rsi
jmp    1030 <vec4f_scalarMult_new@plt>

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

LLVM IR (-O2):
define void @vec4f_scalarMult(float* %0, float %1) {
%3 = tail call i32 @vec4f_scalarMult_new(float* %0, float* %0, float %1)
ret void
}
int main(int arc, char **argv) {
  int *bad = 0;
  *bad = 17;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x11,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%7 = load i32*, i32** %6
store i32 17, i32* %7
ret i32 1
}

LLVM IR (-O2):
void prune_arrblk_eq_CAF(int *x) {
  int *y = x + 10;
  if (x == y) {
    x[5] = 1;
  }
}


x86 assembly (clang, -O0):
<prune_arrblk_eq_CAF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    112d <prune_arrblk_eq_CAF+0x2d>
mov    -0x8(%rbp),%rax
movl   $0x1,0x14(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_arrblk_eq_CAF(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 10
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = icmp eq i32* %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 5
store i32 1, i32* %11
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @prune_arrblk_eq_CAF(i32* nocapture %0) {
ret void
}
int test_imm_0Cint64_lowword_reg(long long val) {
  return ((val) & (0x0C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Cint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 12
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int sysCall(int, int, unsigned long, int);
int write(int file, char *buf, int nbytes) {
  return sysCall(4, file, (unsigned long)buf, nbytes);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x4,%edi
call   1030 <sysCall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <sysCall@plt>

LLVM IR (-O0):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i32, i32* %6
%11 = call i32 @sysCall(i32 4, i32 %7, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = tail call i32 @sysCall(i32 4, i32 %0, i64 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void p(int *nums, int numsSize) {
  for (int i = 0; i < numsSize; ++i) {
    printf("%d\t", nums[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<p>:
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    1159 <p+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <p+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <p+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <p+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @p(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
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 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @p(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *progname) {
  fprintf(
      stderr,
      "usage: %s inputfirmware.bin \"/Volumes/CRP DISABLD/firmware.bin\"\n\n"
      "Either or both input and output may be -, which indicates to work\n"
      "on stdin or stdout\n\n",
      progname);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [152 x i8] c"usage: %s inputfirmware.bin \22/Volumes/CRP DISABLD/firmware.bin\22\0A\0AEither or both input and output may be -, which indicates to work\0Aon stdin or stdout\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [152 x i8] c"usage: %s inputfirmware.bin \22/Volumes/CRP DISABLD/firmware.bin\22\0A\0AEither or both input and output may be -, which indicates to work\0Aon stdin or stdout\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void glutStrokeCharacter(void *font, int character) {}


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

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

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

LLVM IR (-O2):
define void @glutStrokeCharacter(i8* nocapture %0, i32 %1) {
ret void
}
int gn_test(int lala) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @gn_test(i32 %0) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argn, char *argv[]) {
  printf("openFPGArduino\n");
  printf("hello word\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    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"openFPGArduino\0A\00"
@.str.1 = [12 x i8] c"hello word\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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"openFPGArduino\00"
@str.2 = [11 x i8] c"hello word\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_end() { printf("  PASS\n------ test end ------\n\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c" PASS\0A------ test end ------\0A\0A\00"
define void @test_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c" PASS\0A------ test end ------\0A\00"
define void @test_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long long);
int /*<<< orphan*/ sscanf(char *, char *, double *);
double long2double(long long x) {
  char buff[32];
  double res;
  sprintf(buff, "%lld", x);
  sscanf(buff, "%lld", &res);
  return res;
}


x86 assembly (clang, -O0):
<long2double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
lea    0xeb5(%rip),%rsi
lea    -0x38(%rbp),%rdx
call   1030 <sscanf@plt>
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long2double>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rdx
lea    0xecf(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sprintf@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sscanf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define double @long2double(i64 %0) {
%2 = alloca i64
%3 = alloca [32 x i8]
%4 = alloca double
store i64 %0, i64* %2
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %4)
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define double @long2double(i64 %0) {
%2 = alloca [32 x i8]
%3 = alloca double
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = bitcast double* %3 to i8*
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %3)
%8 = load double, double* %3
ret double %8
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned char)234;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] = state[local1] + state[0UL];
      state[0UL] += state[0UL];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 724560680UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0xea,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x1,%rax
jae    1163 <RandomFunc+0x63>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
add    $0x2b2feb28,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
shl    $0x2,%al
xor    $0x80,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 234
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i64
%18 = icmp ult i64 %17, 1
br i1 %18, label %19, label %43
19: ; preds = %15
%20 = load i8, i8* %6
%21 = zext i8 %20 to i64
%22 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add nsw i32 %24, %27
%29 = trunc i32 %28 to i8
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %29, i8* %30
%31 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = add nsw i32 %36, %33
%38 = trunc i32 %37 to i8
store i8 %38, i8* %34
%39 = load i8, i8* %6
%40 = zext i8 %39 to i64
%41 = add i64 %40, 2
%42 = trunc i64 %41 to i8
store i8 %42, i8* %6
br label %15
43: ; preds = %15
%44 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%45 = load i8, i8* %44
%46 = zext i8 %45 to i64
%47 = add i64 %46, 724560680
%48 = trunc i64 %47 to i8
%49 = load i8*, i8** %4
%50 = getelementptr inbounds i8, i8* %49, i64 0
store i8 %48, i8* %50
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = shl i8 %3, 2
%5 = xor i8 %4, -128
store i8 %5, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_mychaser(void) {
  printf("get my chaser\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"get my chaser\0A\00"
define i32 @get_mychaser() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"get my chaser\00"
define i32 @get_mychaser() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int const calclen_l1a(unsigned int);
const int calclen_l1b(unsigned int i) {
  if (i <= 2)
    return 2;
  return calclen_l1a(i - 1);
}


x86 assembly (clang, -O0):
<calclen_l1b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
ja     1131 <calclen_l1b+0x21>
movl   $0x2,-0x4(%rbp)
jmp    113f <calclen_l1b+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <calclen_l1a@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calclen_l1b>:
cmp    $0x3,%edi
jae    111b <calclen_l1b+0xb>
mov    $0x2,%eax
ret
add    $0xffffffff,%edi
jmp    1030 <calclen_l1a@plt>

LLVM IR (-O0):
define i32 @calclen_l1b(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub i32 %8, 1
%10 = call i32 @calclen_l1a(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @calclen_l1b(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @calclen_l1a(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 2, %1 ]
ret i32 %7
}
void Default_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void resign(void) {
  printf("Hammurabi, I can not do what you wish."
         " Get yourself another steward!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<resign>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<resign>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"Hammurabi, I can not do what you wish. Get yourself another steward!\0A\00"
define void @resign() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [69 x i8] c"Hammurabi, I can not do what you wish. Get yourself another steward!\00"
define void @resign() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct map_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pc_checkitem(struct map_session_data *);
atcommand_itemcheck(const int fd, struct map_session_data *sd,
                    const char *command, const char *message) {
  pc_checkitem(sd);
  return 0;
}


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

x86 assembly (clang, -O2):
<atcommand_itemcheck>:
push   %rax
mov    %rsi,%rdi
call   1030 <pc_checkitem@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.map_session_data = type { i32 }
define i32 @atcommand_itemcheck(i32 %0, %struct.map_session_data* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.map_session_data*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store %struct.map_session_data* %1, %struct.map_session_data** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.map_session_data*, %struct.map_session_data** %6
%10 = call i32 @pc_checkitem(%struct.map_session_data* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
define i32 @atcommand_itemcheck(i32 %0, %struct.map_session_data* %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pc_checkitem(%struct.map_session_data* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int sqrt(int);
int main(void) {
  puts("!!!Hello Math");
  int square;
  square = sqrt(4);
  printf("Square root of your number is: %d\n", square);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1050 <sqrt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1050 <sqrt@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"!!!Hello Math\00"
@.str.1 = [35 x i8] c"Square root of your number is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sqrt(i32 4)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"!!!Hello Math\00"
@.str.1 = [35 x i8] c"Square root of your number is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sqrt(i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
unsigned istrlen(const char *str) {
  unsigned length = 0;
  while (str[length++] != '\0')
    ;
  return length - 1;
}


x86 assembly (clang, -O0):
<istrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <istrlen+0x32>
jmp    110f <istrlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @istrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add i32 %3, 1
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %3
}