xunge/DecIR huggingface dataset:
int is_prime(int number) {
  int i;
  for (i = 2; i <= number / 2; ++i) {
    if (number % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115b <is_prime+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <is_prime+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_prime+0x62>
jmp    114d <is_prime+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <is_prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <is_prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <is_prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void child_exit(int ret) {
  fflush(stdout);
  fflush(stderr);
  _exit(ret);
}


x86 assembly (clang, -O0):
<child_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<child_exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @child_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @_exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @child_exit(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ htbl_create(unsigned int, int /*<<< orphan*/ *, int);
void *rtl_htblNew(unsigned int size) {
  return (void *)htbl_create(size, NULL, 1);
}


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

x86 assembly (clang, -O2):
<rtl_htblNew>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <htbl_create@plt>

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

LLVM IR (-O2):
define i8* @rtl_htblNew(i32 %0) {
%2 = tail call i64 @htbl_create(i32 %0, i32* null, i32 1)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
int /*<<< orphan*/ printf(char *);
void a() {
  printf("this is a\n");
  b(1);
  b(2);
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <b@plt>
mov    $0x2,%edi
call   1030 <b@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <b@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <b@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"this is a\0A\00"
define void @a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @b(i32 1)
%3 = call i32 @b(i32 2)
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"this is a\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @b(i32 1)
%3 = tail call i32 @b(i32 2)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void WatchdogReloadSet(uint32_t ui32LoadVal) {
  (*((volatile unsigned long *)(0x40080000 + 0x00000000))) = ui32LoadVal;
}


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

x86 assembly (clang, -O2):
<WatchdogReloadSet>:
mov    %rdi,0x40080000
40
ret

LLVM IR (-O0):
define void @WatchdogReloadSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074266112 to i64*)
ret void
}

LLVM IR (-O2):
define void @WatchdogReloadSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074266112 to i64*)
ret void
}
int xmlUCSIsArabic(int code) {
  return (((code >= 0x0600) && (code <= 0x06FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsArabic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x600,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsArabic+0x26>
cmpl   $0x6ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsArabic>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x600,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsArabic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1536
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1791
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsArabic(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 1536
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct arg_date {
  int dummy;
};

/* Variables and functions */
struct arg_date *arg_daten(char const *, char const *, char const *,
                           char const *, int /*<<< orphan*/, int, char const *);
struct arg_date *arg_date0(const char *shortopts, const char *longopts,
                           const char *format, const char *datatype,
                           const char *glossary) {
  return arg_daten(shortopts, longopts, format, datatype, 0, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_date0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
xor    %r8d,%r8d
mov    $0x1,%r9d
mov    %rax,(%rsp)
call   1030 <arg_daten@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_date0>:
push   %rax
mov    %r8,(%rsp)
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <arg_daten@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.arg_date = type { i32 }
define %struct.arg_date* @arg_date0(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call %struct.arg_date* @arg_daten(i8* %11, i8* %12, i8* %13, i8* %14, i32 0, i32 1, i8* %15)
ret %struct.arg_date* %16
}

LLVM IR (-O2):
%struct.arg_date = type { i32 }
define %struct.arg_date* @arg_date0(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call %struct.arg_date* @arg_daten(i8* %0, i8* %1, i8* %2, i8* %3, i32 0, i32 1, i8* %4)
ret %struct.arg_date* %6
}
/* Variables and functions */
int declare_fun_1(int, int);
int declare_use_1(int x, int y) {
  int a = 1;
  int b = 2;
  int c = 0;
  c = declare_fun_1(a, b);
  return c;
}


x86 assembly (clang, -O0):
<declare_use_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <declare_fun_1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_use_1>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <declare_fun_1@plt>

LLVM IR (-O0):
define i32 @declare_use_1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
store i32 2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @declare_fun_1(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
define i32 @declare_use_1(i32 %0, i32 %1) {
%3 = tail call i32 @declare_fun_1(i32 1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  goto ERROR;
  if (0) {
  ERROR:
    assert(0);
  }
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %4
2: ; No predecessors!
br i1 false, label %3, label %6
3: ; preds = %2
br label %4
4: ; preds = %3, %0
%5 = call i32 @assert(i32 0)
br label %6
6: ; preds = %4, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
int main() {
  f(7.6);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(double 7.600000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double 7.600000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ replaceBlank(char *, int);
void interView02Test(void) {
  char str[100] = "we are happy";
  replaceBlank(str, 100);
  puts(str);
}


x86 assembly (clang, -O0):
<interView02Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1030 <replaceBlank@plt>
lea    -0x70(%rbp),%rdi
call   1040 <puts@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interView02Test>:
push   %rbx
sub    $0x70,%rsp
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <replaceBlank@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.interView02Test.str = [100 x i8] c"we are happy\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @interView02Test() {
%1 = alloca [100 x i8]
%2 = bitcast [100 x i8]* %1 to i8*
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @replaceBlank(i8* %3, i32 100)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
ret void
}

LLVM IR (-O2):
@__const.interView02Test.str = [100 x i8] c"we are happy\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @interView02Test() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @replaceBlank(i8* %2, i32 100)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
char toupper(char);
char *str_toupper(char *str) {
  while (*str != '\0') {
    *str = toupper(*str);
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<str_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <str_toupper+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_toupper+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_toupper>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <str_toupper+0x26>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_toupper+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @str_toupper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %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 %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @str_toupper(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
ret i8* %12
}
/* Variables and functions */
void *malloc(int bytes) {
  static void *position = 0x1000000;
  void *aux = position;
  position += bytes;
  return aux;
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f12(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2f04(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ef7(%rip)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
mov    0x2f19(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f0c(%rip)
ret

LLVM IR (-O0):
@malloc.position = internal global i8* inttoptr (i64 16777216 to i8*)
define i8* @malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i8*, i8** @malloc.position
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** @malloc.position
%7 = sext i32 %5 to i64
%8 = getelementptr i8, i8* %6, i64 %7
store i8* %8, i8** @malloc.position
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@malloc.position = internal unnamed_addr global i8* inttoptr (i64 16777216 to i8*)
define i8* @malloc(i32 %0) {
%2 = load i8*, i8** @malloc.position
%3 = sext i32 %0 to i64
%4 = getelementptr i8, i8* %2, i64 %3
store i8* %4, i8** @malloc.position
ret i8* %2
}
int is_vector_start(int c, int ahead) { return c == '#' && ahead == '('; }


x86 assembly (clang, -O0):
<is_vector_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x23,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <is_vector_start+0x23>
cmpl   $0x28,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vector_start>:
xor    $0x23,%edi
xor    $0x28,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_vector_start(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 = icmp eq i32 %5, 35
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 40
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_vector_start(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 35
%4 = icmp eq i32 %1, 40
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int cmpDouble(const void *va, const void *vb) {
  const double *a = va;
  const double *b = vb;
  double diff = *a - *b;
  if (diff < 0)
    return -1;
  else if (diff > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmpDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    114b <cmpDouble+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <cmpDouble+0x70>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1169 <cmpDouble+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1170 <cmpDouble+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpDouble>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpDouble(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
store double* %12, double** %7
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = load double*, double** %7
%16 = load double, double* %15
%17 = fsub double %14, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %2
store i32 -1, i32* %3
br label %26
21: ; preds = %2
%22 = load double, double* %8
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %3
br label %26
25: ; preds = %21
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmpDouble(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlVoltageEventStatus(void) {
  return ((*((volatile unsigned long *)(0x400FE060))));
}


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

x86 assembly (clang, -O2):
<SysCtlVoltageEventStatus>:
mov    0x400fe060,%rax
40
ret

LLVM IR (-O0):
define i64 @SysCtlVoltageEventStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysCtlVoltageEventStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ xxx();
int f() {
  int x;
  xxx();
}


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @xxx()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @xxx()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ safe_exit(int);
int /*<<< orphan*/ stderr;
void *safe_release_realloc(void *ptr, size_t size) {
  void *new_ptr = realloc(ptr, size);
  if (!new_ptr) {
    fprintf(stderr, "Could not realloc memory! Out of memory?");
    safe_exit(2);
    return NULL;
  }
  return new_ptr;
}


x86 assembly (clang, -O0):
<safe_release_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1188 <safe_release_realloc+0x58>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <safe_exit@plt>
movq   $0x0,-0x8(%rbp)
jmp    1190 <safe_release_realloc+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_release_realloc>:
push   %rbx
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <safe_release_realloc+0x2d>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <safe_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Could not realloc memory! Out of memory?\00"
define i8* @safe_release_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @safe_exit(i32 2)
store i8* null, i8** %3
br label %18
16: ; preds = %2
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %16, %12
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Could not realloc memory! Out of memory?\00"
define noalias i8* @safe_release_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @safe_exit(i32 2)
br label %9
9: ; preds = %2, %5
ret i8* %3
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int getpeername(int, struct sockaddr *, int *);
int /*<<< orphan*/ read(int, char *, int);
int socket_connected(int s) {
  struct sockaddr_in sa;
  socklen_t dummy;
  char ch;
  dummy = sizeof sa;
  if (getpeername(s, (struct sockaddr *)&sa, &dummy) == -1) {
    read(s, &ch, 1);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<socket_connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <getpeername@plt>
cmp    $0xffffffff,%eax
jne    1168 <socket_connected+0x48>
mov    -0x8(%rbp),%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <socket_connected+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_connected>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <getpeername@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
jne    115d <socket_connected+0x3d>
lea    0x3(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connected(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %3
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i32 @getpeername(i32 %7, %struct.sockaddr* %8, i32* %5)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @read(i32 %12, i8* %6, i32 1)
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_connected(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca i8
%5 = bitcast %struct.sockaddr_in* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%7 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%8 = call i32 @getpeername(i32 %0, %struct.sockaddr* %7, i32* %3)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @read(i32 %0, i8* %4, i32 1)
br label %12
12: ; preds = %1, %10
%13 = phi i32 [ 0, %10 ], [ 1, %1 ]
ret i32 %13
}
void mega_foo5(void (*a)()) {}


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

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

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

LLVM IR (-O2):
define void @mega_foo5(void (...)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char *);
char *strcat(char *buf, const char *extra) {
  char *p = buf;
  p += strlen(p);
  strcpy(p, extra);
  return buf;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %5
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
int isLogEnabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isLogEnabled() {
ret i32 0
}
/* Variables and functions */
void *func(void *v) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @func(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ program();
int yyselect();
YYSTART() {
  switch (yyselect()) {
  case 109: {
    program();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<YYSTART>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0x6d,%eax
jne    115b <YYSTART+0x2b>
jmp    114d <YYSTART+0x1d>
mov    $0x0,%al
call   1050 <program@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YYSTART>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x6d,%eax
jne    114b <YYSTART+0x1b>
xor    %eax,%eax
call   1050 <program@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @YYSTART() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %6 [
i32 109, label %3
]
3: ; preds = %0
%4 = call i32 (...) @program()
%5 = call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @YYSTART() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 109
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @program()
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
ret i32 undef
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The value of INT_MAX is %i \n", INT_MAX);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"The value of INT_MAX is %i \0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MAX
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"The value of INT_MAX is %i \0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *concat(char *s1, char *s2) {
  char *result = malloc(strlen(s1) + strlen(s2) + 1);
  strcpy(result, s1);
  strcat(result, s2);
  return result;
}


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

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
size_t HashShrinkSize(size_t original_capacity) {
  return (size_t)((original_capacity << 1) / 3);
}


x86 assembly (clang, -O0):
<HashShrinkSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashShrinkSize>:
lea    (%rdi,%rdi,1),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @HashShrinkSize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 1
%5 = udiv i64 %4, 3
ret i64 %5
}

LLVM IR (-O2):
define i64 @HashShrinkSize(i64 %0) {
%2 = shl i64 %0, 1
%3 = udiv i64 %2, 3
ret i64 %3
}
char *scpy(char *s1, const char *s2) {
  char *s = s1;
  while ((*s++ = *s2++) != '\0')
    ;
  *s = '\0';
  return (s1);
}


x86 assembly (clang, -O0):
<scpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <scpy+0x47>
jmp    1114 <scpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <scpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @scpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
store i8 0, i8* %8
ret i8* %0
}
void g_type_remove_interface_check() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void nr_additional_dump(struct CalculationInfo *info, char **dump) {
  sprintf(*dump, "");
}


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

x86 assembly (clang, -O2):
<nr_additional_dump>:
mov    (%rsi),%rax
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
%struct.CalculationInfo = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @nr_additional_dump(%struct.CalculationInfo* %0, i8** %1) {
%3 = alloca %struct.CalculationInfo*
%4 = alloca i8**
store %struct.CalculationInfo* %0, %struct.CalculationInfo** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.CalculationInfo = type { i32 }
define void @nr_additional_dump(%struct.CalculationInfo* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
store i8 0, i8* %3
ret void
}
int test_imm_CBint64_lowword_mem(long long *val) {
  return ((*val) & (0xCB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CBint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 203
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gpio_setscl_val(int);
int /*<<< orphan*/ gpio_setsda_val(int);
void iic_start(void) {
  gpio_setsda_val(1);
  gpio_setscl_val(1);
  gpio_setsda_val(0);
}


x86 assembly (clang, -O0):
<iic_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <gpio_setsda_val@plt>
mov    $0x1,%edi
call   1040 <gpio_setscl_val@plt>
xor    %edi,%edi
call   1030 <gpio_setsda_val@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iic_start>:
push   %rax
mov    $0x1,%edi
call   1030 <gpio_setsda_val@plt>
mov    $0x1,%edi
call   1040 <gpio_setscl_val@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <gpio_setsda_val@plt>

LLVM IR (-O0):
define void @iic_start() {
%1 = call i32 @gpio_setsda_val(i32 1)
%2 = call i32 @gpio_setscl_val(i32 1)
%3 = call i32 @gpio_setsda_val(i32 0)
ret void
}

LLVM IR (-O2):
define void @iic_start() {
%1 = tail call i32 @gpio_setsda_val(i32 1)
%2 = tail call i32 @gpio_setscl_val(i32 1)
%3 = tail call i32 @gpio_setsda_val(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb8() {
  Assert_real((isbdigit(184) == 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_isbdigit.c",
              925, ("isbdigit should be 0 for 0xb8"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x39d,%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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb8\00"
define void @t_isbdigit_0xb8() {
%1 = call i64 @isbdigit(i32 184)
%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 925, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb8\00"
define void @t_isbdigit_0xb8() {
%1 = tail call i64 @isbdigit(i32 184)
%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 925, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activate_help(char *);
int /*<<< orphan*/ select_medium();
void medium_handler(int x, int y, int button) {
  if (button == 3) {
    activate_help("medium.hlp");
  } else {
    select_medium();
  }
}


x86 assembly (clang, -O0):
<medium_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    114c <medium_handler+0x2c>
lea    0xebe(%rip),%rdi
call   1030 <activate_help@plt>
jmp    1153 <medium_handler+0x33>
mov    $0x0,%al
call   1040 <select_medium@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medium_handler>:
cmp    $0x3,%edx
jne    1131 <medium_handler+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <activate_help@plt>
xor    %eax,%eax
jmp    1040 <select_medium@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"medium.hlp\00"
define void @medium_handler(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @activate_help(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = call i32 (...) @select_medium()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"medium.hlp\00"
define void @medium_handler(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 3
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @activate_help(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @select_medium()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int OSDSoftInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OSDSoftInit() {
ret i32 0
}
void esd_def_metrics() {}


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

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

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

LLVM IR (-O2):
define void @esd_def_metrics() {
ret void
}
char **strTime(char *timeStr) {}


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

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

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

LLVM IR (-O2):
define noalias i8** @strTime(i8* nocapture readnone %0) {
ret i8** undef
}
/* Variables and functions */
long long expo(int, int);
long long int largestNum(int units) { return expo(10, units) - 1; }


x86 assembly (clang, -O0):
<largestNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
call   1030 <expo@plt>
sub    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largestNum>:
push   %rax
mov    %edi,%esi
mov    $0xa,%edi
call   1030 <expo@plt>
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @largestNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @expo(i32 10, i32 %3)
%5 = sub nsw i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @largestNum(i32 %0) {
%2 = tail call i64 @expo(i32 10, i32 %0)
%3 = add nsw i64 %2, -1
ret i64 %3
}
int main() {
  long double x;
  x = 0x1.0p-500L;
  x *= 0x1.0p-522L;
  if (x != 0x1.0p-1022L)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
fldl   0xecb(%rip)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldl   0xec7(%rip)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldl   0xec1(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1166 <main+0x46>
jp     1166 <main+0x46>
jmp    116b <main+0x4b>
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK3E0B8000000000000000, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 %3, 0xK3DF58000000000000000
store x86_fp80 %4, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = fcmp une x86_fp80 %5, 0xK3C018000000000000000
br i1 %6, label %7, label %8
7: ; preds = %0
unreachable
8: ; preds = %0
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void @exit(i32 0)
unreachable
}