xunge/DecIR huggingface dataset:
/* Variables and functions */
int command(int, int, unsigned int);
int gpio_toggle(unsigned int pin) { return command(1, 4, pin); }


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

x86 assembly (clang, -O2):
<gpio_toggle>:
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x4,%esi
jmp    1030 <command@plt>

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

LLVM IR (-O2):
define i32 @gpio_toggle(i32 %0) {
%2 = tail call i32 @command(i32 1, i32 4, i32 %0)
ret i32 %2
}
int lstrcatA(LPSTR, LPCSTR) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lstrcatA(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct fs_file {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int fs_http_ftruncate(struct fs_file *f, off_t length) { return -1; }


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

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

LLVM IR (-O0):
%struct.fs_file = type { i32 }
define i32 @fs_http_ftruncate(%struct.fs_file* %0, i32 %1) {
%3 = alloca %struct.fs_file*
%4 = alloca i32
store %struct.fs_file* %0, %struct.fs_file** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.fs_file = type { i32 }
define i32 @fs_http_ftruncate(%struct.fs_file* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int strend(char *, char *);
int main(void) {
  char *s = "testtwo";
  char *s2 = "testtwotest";
  char *t = "two";
  printf("%d, %d\n", strend(s, t), strend(s2, t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0xed3(%rip),%rbx
mov    %rbx,%rsi
call   1040 <strend@plt>
mov    %eax,%ebp
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
lea    0xec3(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"testtwo\00"
@.str.1 = [12 x i8] c"testtwotest\00"
@.str.2 = [4 x i8] c"two\00"
@.str.3 = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @strend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @strend(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
void setmode(f, n) int f, n;
{
  adjustmode(1, 0);
  return;
  f = f;
  n = n;
}


x86 assembly (clang, -O0):
<setmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <adjustmode@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @setmode(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @adjustmode to i32 (i32, i32, ...)*)(i32 1, i32 0)
ret void
}
int f() { return 100; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 100
}

LLVM IR (-O2):
define i32 @f() {
ret i32 100
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int __lock;
};
struct TYPE_5__ {
  TYPE_1__ __data;
};
typedef TYPE_2__ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ __ESBMC_atomic_begin();
int /*<<< orphan*/ __ESBMC_atomic_end();
int pthread_mutex_lock_noassert(pthread_mutex_t *mutex) {
__ESBMC_HIDE:
  __ESBMC_atomic_begin();
  __ESBMC_assume(!((*mutex).__data.__lock));
  ((*mutex).__data.__lock) = 1;
  __ESBMC_atomic_end();
  return 0;
}


x86 assembly (clang, -O0):
<pthread_mutex_lock_noassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__ESBMC_atomic_begin@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1030 <__ESBMC_atomic_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_lock_noassert>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <__ESBMC_atomic_begin@plt>
xor    %edi,%edi
cmpl   $0x0,(%rbx)
sete   %dil
call   1040 <__ESBMC_assume@plt>
movl   $0x1,(%rbx)
xor    %eax,%eax
call   1030 <__ESBMC_atomic_end@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock_noassert(%struct.TYPE_5__* %0) {
%2 = alloca %struct.TYPE_5__*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %2
br label %3
3: ; preds = %1
%4 = call i32 (...) @__ESBMC_atomic_begin()
%5 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%6 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @__ESBMC_assume(i32 %11)
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %13, i32 0, i32 0
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 0
store i32 1, i32* %15
%16 = call i32 (...) @__ESBMC_atomic_end()
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock_noassert(%struct.TYPE_5__* nocapture %0) {
%2 = tail call i32 (...) @__ESBMC_atomic_begin()
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0, i32 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @__ESBMC_assume(i32 %6)
store i32 1, i32* %3
%8 = tail call i32 (...) @__ESBMC_atomic_end()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ unlink(char *);
int CheckFile(char *Filename, char *mode) {
  FILE *fp;
  fp = fopen(Filename, mode);
  if (fp == NULL)
    return (0);
  else {
    fclose(fp);
    if (mode[0] == 'w')
      unlink(Filename);
    return (1);
  }
}


x86 assembly (clang, -O0):
<CheckFile>:
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 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1168 <CheckFile+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1191 <CheckFile+0x61>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x77,%eax
jne    118a <CheckFile+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckFile>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <fopen@plt>
test   %rax,%rax
je     1160 <CheckFile+0x30>
mov    %rax,%rdi
call   1040 <fclose@plt>
mov    $0x1,%ebp
cmpb   $0x77,(%rbx)
jne    1162 <CheckFile+0x32>
mov    %r14,%rdi
call   1030 <unlink@plt>
jmp    1162 <CheckFile+0x32>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @CheckFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i32 @fclose(i32* %3)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 119
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @unlink(i8* %0)
br label %11
11: ; preds = %5, %9, %2
%12 = phi i32 [ 0, %2 ], [ 1, %9 ], [ 1, %5 ]
ret i32 %12
}
int clamp255(int i) {
  if (i < 0)
    return (0);
  if (i > 255)
    return (255);
  return (i);
}


x86 assembly (clang, -O0):
<clamp255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <clamp255+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <clamp255+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <clamp255+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <clamp255+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp255>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp255(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
int test_imm_28int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x28 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_28int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2621440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_doc() { write("msproject.xml", "</Project>\n", NULL); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [12 x i8] c"</Project>\0A\00"
define void @end_doc() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [12 x i8] c"</Project>\0A\00"
define void @end_doc() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int f(p)
int *p;
{ return *p; }


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

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ panic(char *);
void plonk(int tok) {
  panic((tok == EOF) ? "incomplete time" : "garbled time");
}


x86 assembly (clang, -O0):
<plonk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
lea    0xee2(%rip),%rdi
lea    0xecb(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rdi
call   1030 <panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plonk>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
lea    0xee0(%rip),%rax
lea    0xee9(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <panic@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [16 x i8] c"incomplete time\00"
@.str.1 = [13 x i8] c"garbled time\00"
define void @plonk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @panic(i8* %7)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [16 x i8] c"incomplete time\00"
@.str.1 = [13 x i8] c"garbled time\00"
define void @plonk(i32 %0) {
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, %0
%4 = select i1 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @panic(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ putstr(unsigned char *);
void puts(unsigned char *s) {
  putstr(s);
  putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <putstr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <putstr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @putstr(i8* %3)
%5 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @putstr(i8* %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinWeekday() { wDateTimePush('w', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinWeekday>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x77,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinWeekday>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x77,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinWeekday() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 119, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinWeekday() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 119, i32 %1)
ret void
}
void gdk_wm_function_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_wm_function_get_type() {
ret void
}
void SteamAPI_ISteamHTMLSurface_MouseWheel(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_MouseWheel>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_MouseWheel = [38 x i8] c"SteamAPI_ISteamHTMLSurface_MouseWheel\00"
define void @SteamAPI_ISteamHTMLSurface_MouseWheel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_MouseWheel, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_MouseWheel = [38 x i8] c"SteamAPI_ISteamHTMLSurface_MouseWheel\00"
define void @SteamAPI_ISteamHTMLSurface_MouseWheel(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_MouseWheel, i64 0, i64 0), i8* %0)
ret void
}
ischar(s) char *s;
{ return ((long)s > 0 && (long)s < 128); }


x86 assembly (clang, -O0):
<ischar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jle    112b <ischar+0x2b>
mov    -0x8(%rbp),%rax
cmp    $0x80,%rax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ischar>:
test   %rdi,%rdi
setg   %al
cmp    $0x80,%rdi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ischar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = icmp slt i64 %8, 128
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ischar(i8* readnone %0) {
%2 = icmp sgt i8* %0, null
%3 = icmp slt i8* %0, inttoptr (i64 128 to i8*)
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void RTAvlrU64Insert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrU64Insert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int numlck_handler(char **save) {
  write_instr(0x00);
  write_imm(0x53);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<numlck_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x53,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numlck_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x53,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @numlck_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 83)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @numlck_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 83)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
int config_MODULE_CAMD35(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_CAMD35() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t mpack_load_u16(const char *p) {
  return (uint16_t)((((uint16_t)(uint8_t)p[0]) << 8) |
                    ((uint16_t)(uint8_t)p[1]));
}


x86 assembly (clang, -O0):
<mpack_load_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbq 0x1(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpack_load_u16>:
movsbl (%rdi),%ecx
shl    $0x8,%ecx
movsbl 0x1(%rdi),%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mpack_load_u16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
int f1(int a, int b) {
  unsigned long long c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx
mov    %rax,%rcx
xor    %eax,%eax
and    $0x1,%dl
or     %dl,%al
mov    %rcx,-0x10(%rbp)
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx
mov    %rdx,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sext i32 %6 to i65
%9 = sext i32 %7 to i65
%10 = call { i65, i1 } @llvm.smul.with.overflow.i65(i65 %8, i65 %9)
%11 = extractvalue { i65, i1 } %10, 1
%12 = extractvalue { i65, i1 } %10, 0
%13 = trunc i65 %12 to i64
%14 = zext i64 %13 to i65
%15 = icmp ne i65 %12, %14
%16 = or i1 %11, %15
store i64 %13, i64* %5
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = sext i32 %0 to i65
%4 = sext i32 %1 to i65
%5 = mul nsw i65 %4, %3
%6 = lshr i65 %5, 64
%7 = trunc i65 %6 to i32
ret i32 %7
}
unsigned char getbyte(s, i)
unsigned *s;
int i;
{
  unsigned shift = ((i & 3) ^ 3) << 3;
  s += i >> 2;
  return *s >> shift;
}


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
xor    $0x3,%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x2,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%ecx
shr    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
lea    0x0(,%rsi,8),%ecx
sar    $0x2,%esi
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
not    %cl
and    $0x18,%cl
shr    %cl,%eax
ret

LLVM IR (-O0):
define zeroext i8 @getbyte(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 3
%8 = xor i32 %7, 3
%9 = shl i32 %8, 3
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = ashr i32 %10, 2
%12 = load i32*, i32** %3
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = load i32, i32* %5
%18 = lshr i32 %16, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @getbyte(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = and i32 %3, 24
%5 = xor i32 %4, 24
%6 = ashr i32 %1, 2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = lshr i32 %9, %5
%11 = trunc i32 %10 to i8
ret i8 %11
}
void rop3_252_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T | S;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_252_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_252_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_252_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = and i32 %26, %28
%30 = or i32 %23, %29
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = and i32 %33, %35
%37 = or i32 %30, %36
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_252_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int uncompress_uint(unsigned int *, unsigned char *);
int uncompress_int(int *i, unsigned char p[]) {
  int lc, negative;
  unsigned val;
  lc = uncompress_uint(&val, p);
  negative = val & 1;
  val = val >> 1;
  if (negative)
    *i = -val;
  else
    *i = val;
  return (lc);
}


x86 assembly (clang, -O0):
<uncompress_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <uncompress_uint@plt>
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     115c <uncompress_int+0x4c>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1165 <uncompress_int+0x55>
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompress_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <uncompress_uint@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,%edx
shr    %edx
mov    %edx,%esi
neg    %esi
test   $0x1,%cl
cmove  %edx,%esi
mov    %esi,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @uncompress_int(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @uncompress_uint(i32* %3, i8* %1)
%6 = load i32, i32* %3
%7 = and i32 %6, 1
%8 = lshr i32 %6, 1
%9 = icmp eq i32 %7, 0
%10 = sub nsw i32 0, %8
%11 = select i1 %9, i32 %8, i32 %10
store i32 %11, i32* %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sumOfSquares = 0, sumSquared = 0;
  for (i = 0; i < 101; i++) {
    sumSquared += i;
    sumOfSquares += i * i;
  }
  sumSquared *= sumSquared;
  printf("%d\n", sumSquared - sumOfSquares);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x65,-0x8(%rbp)
jge    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 101
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, %9
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %8
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
%22 = load i32, i32* %4
%23 = mul nsw i32 %22, %21
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int free_list_ele(void *data) {
  if (data == NULL) {
    return 0;
  }
  free(data);
  return 0;
}


x86 assembly (clang, -O0):
<free_list_ele>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <free_list_ele+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1143 <free_list_ele+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list_ele>:
test   %rdi,%rdi
je     111f <free_list_ele+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @free_list_ele(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
store i32 0, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @free_list_ele(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void genericSwap(void *a, void *b, size_t size) {
  void *temp = malloc(size);
  memcpy(temp, a, size);
  memcpy(a, b, size);
  memcpy(b, temp, size);
  free(temp);
}


x86 assembly (clang, -O0):
<genericSwap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genericSwap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @genericSwap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @genericSwap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i64 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
int is_letter(char c) {
  return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_letter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_letter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_letter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int init_pair(short, short, short);
int con_initPair(short n, short fg, short bg) { return init_pair(n, fg, bg); }


x86 assembly (clang, -O0):
<con_initPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movswl -0x6(%rbp),%edx
call   1030 <init_pair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_initPair>:
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
define i32 @con_initPair(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = call i32 @init_pair(i16 signext %7, i16 signext %8, i16 signext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @con_initPair(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call i32 @init_pair(i16 signext %0, i16 signext %1, i16 signext %2)
ret i32 %4
}
pldummy_win3() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_win3() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, int, int);
int mm_print_error(int /*<<< orphan*/ *, int);
int mm_write_mtx_array_size(FILE *fp, int row_dim, int col_dim) {
  if (fprintf(fp, "%d %d\n", row_dim, col_dim) != 2)
    return mm_print_error(NULL, 12);
  else
    return (0);
}


x86 assembly (clang, -O0):
<mm_write_mtx_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x2,%eax
je     1167 <mm_write_mtx_array_size+0x47>
xor    %eax,%eax
mov    %eax,%edi
mov    $0xc,%esi
call   1040 <mm_print_error@plt>
mov    %eax,-0x4(%rbp)
jmp    116e <mm_write_mtx_array_size+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_write_mtx_array_size>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x2,%eax
jne    113a <mm_write_mtx_array_size+0x1a>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
mov    $0xc,%esi
pop    %rax
jmp    1040 <mm_print_error@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @mm_write_mtx_array_size(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @mm_print_error(i32* null, i32 12)
store i32 %14, i32* %4
br label %16
15: ; preds = %3
store i32 0, i32* %4
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @mm_write_mtx_array_size(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%5 = icmp eq i32 %4, 2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @mm_print_error(i32* null, i32 12)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
char *strupper(char *s) {
  char *sptr = s;
  for (; *sptr; s++)
    if (*sptr >= 'a' && *sptr <= 'z')
      *sptr -= 'a' - 'A';
  return s;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <strupper+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1149 <strupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1149 <strupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
jmp    114e <strupper+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strupper+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <strupper+0x28>
mov    %rdi,%rax
jmp    1118 <strupper+0x18>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
test   %cl,%cl
je     1127 <strupper+0x27>
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     1110 <strupper+0x10>
add    $0xe0,%cl
mov    %cl,(%rdi)
jmp    1110 <strupper+0x10>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %12, %11 ], [ %2, %1 ]
%6 = phi i8* [ %13, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %0
br label %11
11: ; preds = %4, %9
%12 = phi i8 [ %5, %4 ], [ %10, %9 ]
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
%16 = phi i8* [ %0, %1 ], [ %13, %11 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ configurePatchGenfsk();
int /*<<< orphan*/ enterCpePatchGenfsk();
void refreshPatchGenfsk(void) {
  enterCpePatchGenfsk();
  configurePatchGenfsk();
}


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

x86 assembly (clang, -O2):
<refreshPatchGenfsk>:
push   %rax
xor    %eax,%eax
call   1030 <enterCpePatchGenfsk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <configurePatchGenfsk@plt>

LLVM IR (-O0):
define void @refreshPatchGenfsk() {
%1 = call i32 (...) @enterCpePatchGenfsk()
%2 = call i32 (...) @configurePatchGenfsk()
ret void
}

LLVM IR (-O2):
define void @refreshPatchGenfsk() {
%1 = tail call i32 (...) @enterCpePatchGenfsk()
%2 = tail call i32 (...) @configurePatchGenfsk()
ret void
}