xunge/DecIR huggingface dataset:
void jmdelay(int n) {
  int i, j, k;
  for (i = 0; i < n; i++)
    for (j = 0; j < 100; j++)
      for (k = 0; k < 100; k++)
        ;
}


x86 assembly (clang, -O0):
<jmdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <jmdelay+0x75>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1162 <jmdelay+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    114f <jmdelay+0x4f>
jmp    1141 <jmdelay+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <jmdelay+0x32>
jmp    1154 <jmdelay+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <jmdelay+0x21>
jmp    1167 <jmdelay+0x67>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <jmdelay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @jmdelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %6
6: ; preds = %27, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
store i32 0, i32* %4
br label %11
11: ; preds = %23, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %26
14: ; preds = %11
store i32 0, i32* %5
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %5
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %22
18: ; preds = %15
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %15
22: ; preds = %15
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %11
26: ; preds = %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %6
30: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @jmdelay(i32 %0) {
ret void
}
short int isUpperRegularLetter(char chrsource) {
  if ((chrsource >= 65) && (chrsource <= 90))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isUpperRegularLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x41,%eax
jl     112f <isUpperRegularLetter+0x2f>
movsbl -0x3(%rbp),%eax
cmp    $0x5a,%eax
jg     112f <isUpperRegularLetter+0x2f>
movw   $0x1,-0x2(%rbp)
jmp    1135 <isUpperRegularLetter+0x35>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @isUpperRegularLetter(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i16 1, i16* %2
br label %13
12: ; preds = %7, %1
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isUpperRegularLetter(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
char *strrchr(const char *s, int c) {
  const char *found = NULL;
  while (*s) {
    if (*s == (char)c)
      found = s;
    s++;
  }
  return (char *)found;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strrchr+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strrchr+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strrchr+0x26>
movsbl %sil,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ null, %5 ], [ %14, %8 ]
%11 = phi i8* [ %0, %5 ], [ %15, %8 ]
%12 = sext i8 %9 to i32
%13 = icmp eq i32 %7, %12
%14 = select i1 %13, i8* %11, i8* %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ null, %2 ], [ %14, %8 ]
ret i8* %19
}
int cmp_gt_ull(const void *p, const void *q) {
  const unsigned long long a = *(const unsigned long long *)p;
  const unsigned long long b = *(const unsigned long long *)q;
  do {
    if (a < b)
      return +1;
    if (b < a)
      return -1;
    return 0;
  } while (0);
}


x86 assembly (clang, -O0):
<cmp_gt_ull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <cmp_gt_ull+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_gt_ull+0x5d>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1156 <cmp_gt_ull+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_gt_ull+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_gt_ull>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rax,%rcx
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_gt_ull(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ult i64 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int baz(int);
int foo(int);
int bar(int a) { return baz(a) + foo(a); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <baz@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <baz@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <foo@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @baz(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @foo(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @baz(i32 %0)
%3 = tail call i32 @foo(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cstrcpy(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strerror(int);
char *cstrerror(int err, char *buf, int maxlen) {
  if (buf == NULL || maxlen < 0)
    return NULL;
  cstrcpy(buf, strerror(err), maxlen);
  return buf;
}


x86 assembly (clang, -O0):
<cstrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <cstrerror+0x27>
cmpl   $0x0,-0x1c(%rbp)
jge    1154 <cstrerror+0x34>
movq   $0x0,-0x8(%rbp)
jmp    117a <cstrerror+0x5a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
call   1030 <cstrcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrerror>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
test   %rsi,%rsi
je     1147 <cstrerror+0x27>
mov    %edx,%ebp
test   %edx,%edx
js     1147 <cstrerror+0x27>
mov    %rsi,%rbx
call   1040 <strerror@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1030 <cstrcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @cstrerror(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i8* null, i8** %4
br label %21
14: ; preds = %10
%15 = load i8*, i8** %6
%16 = load i32, i32* %5
%17 = call i32 @strerror(i32 %16)
%18 = load i32, i32* %7
%19 = call i32 @cstrcpy(i8* %15, i32 %17, i32 %18)
%20 = load i8*, i8** %6
store i8* %20, i8** %4
br label %21
21: ; preds = %14, %13
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @cstrerror(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
%5 = icmp slt i32 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strerror(i32 %0)
%9 = tail call i32 @cstrcpy(i8* %1, i32 %8, i32 %2)
br label %10
10: ; preds = %3, %7
%11 = phi i8* [ %1, %7 ], [ null, %3 ]
ret i8* %11
}
/* Type definitions */
struct statement {
  int dummy;
};
struct expression {
  int dummy;
};

/* Variables and functions */
struct statement *stmt_void();
struct statement *stmt_switch(const struct expression *test,
                              const struct statement *body) {
  return stmt_void();
}


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

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

LLVM IR (-O0):
%struct.expression = type { i32 }
%struct.statement = type { i32 }
define %struct.statement* @stmt_switch(%struct.expression* %0, %struct.statement* %1) {
%3 = alloca %struct.expression*
%4 = alloca %struct.statement*
store %struct.expression* %0, %struct.expression** %3
store %struct.statement* %1, %struct.statement** %4
%5 = call %struct.statement* (...) @stmt_void()
ret %struct.statement* %5
}

LLVM IR (-O2):
%struct.expression = type { i32 }
%struct.statement = type { i32 }
define %struct.statement* @stmt_switch(%struct.expression* nocapture readnone %0, %struct.statement* nocapture readnone %1) {
%3 = tail call %struct.statement* (...) @stmt_void()
ret %struct.statement* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int8_t stdlib_ndarray_get_ptr_int64(const uint8_t *idx, int64_t *out) {
  *out = *(int64_t *)idx;
  return 0;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_get_ptr_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_get_ptr_int64(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
ret i32 0
}
int is_odd(int a) { return a % 3; }


x86 assembly (clang, -O0):
<is_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_odd>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_odd(i32 %0) {
%2 = srem i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEifne(int, int /*<<< orphan*/ *);
void code_ifne(int label) { appendCODE(makeCODEifne(label, NULL)); }


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

x86 assembly (clang, -O2):
<code_ifne>:
push   %rax
xor    %esi,%esi
call   1030 <makeCODEifne@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <appendCODE@plt>

LLVM IR (-O0):
define void @code_ifne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEifne(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_ifne(i32 %0) {
%2 = tail call i32 @makeCODEifne(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
int checknum(char c) {
  switch (c) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  case 'D':
    return 500;
  case 'M':
    return 1000;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<checknum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <checknum+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <checknum+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknum>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <checknum+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @checknum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @checknum(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ 0, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
char *UTIL_mallocStr(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *UTIL_itoa(int num) {
  char *str = UTIL_mallocStr(33);
  sprintf(str, "%d", num);
  return str;
}


x86 assembly (clang, -O0):
<UTIL_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x21,%edi
call   1030 <UTIL_mallocStr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_itoa>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x21,%edi
call   1030 <UTIL_mallocStr@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @UTIL_itoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @UTIL_mallocStr(i32 33)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @UTIL_itoa(i32 %0) {
%2 = tail call i8* @UTIL_mallocStr(i32 33)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
void rop3_37_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S & T;
  stk3 = ~stk3;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_37_0_0>:
and    %edx,%esi
not    %sil
and    (%rdi),%sil
xor    %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_37_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, %2
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  uint64_t count = 1;
  for (int i = 0; i < 20; i++) {
    count *= (2 * 20) - i;
    count = count / (i + 1);
  }
  printf("%lld\n", count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    115c <main+0x4c>
mov    $0x28,%eax
sub    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x655c8aa,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 106285226)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_seaway1_1();
int /*<<< orphan*/ test_seaway1_2();
int /*<<< orphan*/ test_seaway1_3();
int /*<<< orphan*/ test_seaway2_1();
int /*<<< orphan*/ test_seaway2_2();
int /*<<< orphan*/ test_seaway32_1();
void test_seaway() {
  test_seaway1_1();
  test_seaway1_2();
  test_seaway1_3();
  test_seaway2_1();
  test_seaway2_2();
  test_seaway32_1();
}


x86 assembly (clang, -O0):
<test_seaway>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_seaway1_1@plt>
mov    $0x0,%al
call   1080 <test_seaway1_2@plt>
mov    $0x0,%al
call   1060 <test_seaway1_3@plt>
mov    $0x0,%al
call   1070 <test_seaway2_1@plt>
mov    $0x0,%al
call   1030 <test_seaway2_2@plt>
mov    $0x0,%al
call   1040 <test_seaway32_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_seaway>:
push   %rax
xor    %eax,%eax
call   1050 <test_seaway1_1@plt>
xor    %eax,%eax
call   1080 <test_seaway1_2@plt>
xor    %eax,%eax
call   1060 <test_seaway1_3@plt>
xor    %eax,%eax
call   1070 <test_seaway2_1@plt>
xor    %eax,%eax
call   1030 <test_seaway2_2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_seaway32_1@plt>

LLVM IR (-O0):
define void @test_seaway() {
%1 = call i32 (...) @test_seaway1_1()
%2 = call i32 (...) @test_seaway1_2()
%3 = call i32 (...) @test_seaway1_3()
%4 = call i32 (...) @test_seaway2_1()
%5 = call i32 (...) @test_seaway2_2()
%6 = call i32 (...) @test_seaway32_1()
ret void
}

LLVM IR (-O2):
define void @test_seaway() {
%1 = tail call i32 (...) @test_seaway1_1()
%2 = tail call i32 (...) @test_seaway1_2()
%3 = tail call i32 (...) @test_seaway1_3()
%4 = tail call i32 (...) @test_seaway2_1()
%5 = tail call i32 (...) @test_seaway2_2()
%6 = tail call i32 (...) @test_seaway32_1()
ret void
}
int v_damp(V, lambda)
float *V, lambda;
{ return 0; }


x86 assembly (clang, -O0):
<v_damp>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @v_damp(float* %0, double %1) {
%3 = alloca float*
%4 = alloca float
%5 = fptrunc double %1 to float
store float* %0, float** %3
store float %5, float* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @v_damp(float* nocapture readnone %0, double %1) {
ret i32 0
}
void I2CAutoIdleEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= (0x00000001u);
}


x86 assembly (clang, -O0):
<I2CAutoIdleEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CAutoIdleEnable>:
add    $0x10,%edi
orl    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @I2CAutoIdleEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CAutoIdleEnable(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void uint64_to_bytes(const uint64_t in, uint8_t out[8]) {
  unsigned int i;
  for (i = 0; i < 8; i++)
    out[i] = in >> ((7 - i) * 8);
}


x86 assembly (clang, -O0):
<uint64_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jae    1144 <uint64_to_bytes+0x44>
mov    -0x4(%rbp),%edx
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <uint64_to_bytes+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64_to_bytes>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %eax,0x10(%rsi)
mov    %edi,%eax
sar    $0x10,%eax
mov    %eax,0x14(%rsi)
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,0x18(%rsi)
mov    %edi,0x1c(%rsi)
ret

LLVM IR (-O0):
define void @uint64_to_bytes(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 8
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = sub i32 7, %11
%13 = mul i32 %12, 8
%14 = ashr i32 %10, %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @uint64_to_bytes(i32 %0, i32* nocapture writeonly %1) {
%3 = ashr i32 %0, 24
%4 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %3, i32* %4
%5 = ashr i32 %0, 16
%6 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %5, i32* %6
%7 = ashr i32 %0, 8
%8 = getelementptr inbounds i32, i32* %1, i64 6
store i32 %7, i32* %8
%9 = getelementptr inbounds i32, i32* %1, i64 7
store i32 %0, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", !0);
  printf("%d\n", !1);
  printf("%d\n", !100);
  printf("%d\n", !-1000);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
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 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int japi_hscrollbar(int);
int j_hscrollbar(int arg0) { return (japi_hscrollbar(arg0)); }


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

x86 assembly (clang, -O2):
<j_hscrollbar>:
jmp    1030 <japi_hscrollbar@plt>

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

LLVM IR (-O2):
define i32 @j_hscrollbar(i32 %0) {
%2 = tail call i32 @japi_hscrollbar(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  scanf("%c", &c);
  c = c - 97;
  printf("%c\n", 122 - c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0x7a,%esi
sub    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
add    $0x9f,%al
mov    %al,0x7(%rsp)
movsbl %al,%eax
mov    $0x7a,%esi
sub    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 122, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = add i8 %3, -97
store i8 %4, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 122, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ argw();
void rop_2ww() {
  argw();
  argw();
}


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

x86 assembly (clang, -O2):
<rop_2ww>:
push   %rax
xor    %eax,%eax
call   1030 <argw@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <argw@plt>

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

LLVM IR (-O2):
define void @rop_2ww() {
%1 = tail call i32 (...) @argw()
%2 = tail call i32 (...) @argw()
ret void
}
char checkbit(char byte, char bit) {
  if (byte & (1 << bit)) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<checkbit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1135 <checkbit+0x35>
movb   $0x1,-0x1(%rbp)
jmp    1139 <checkbit+0x39>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbit>:
bt     %esi,%edi
setb   %al
ret

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

LLVM IR (-O2):
define signext i8 @checkbit(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
ret i8 %8
}
void start_excalibur_read(void) {}


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

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

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

LLVM IR (-O2):
define void @start_excalibur_read() {
ret void
}
void glGetBufferParameteri64v(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetBufferParameteri64v() {
ret void
}
/* Variables and functions */
int gdb_init();
int init() {
  int rc = gdb_init();
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @init() {
%1 = tail call i32 (...) @gdb_init()
ret i32 %1
}
/* Variables and functions */
double fabs(float);
int isUndefined(float);
bool eq(float a, float b) {
  if (isUndefined(a)) {
    return isUndefined(b);
  }
  return fabs(a - b) < 0.0001;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <isUndefined@plt>
cmp    $0x0,%eax
je     1157 <eq+0x37>
movss  -0xc(%rbp),%xmm0
call   1040 <isUndefined@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <eq+0x60>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <isUndefined@plt>
test   %eax,%eax
je     1140 <eq+0x20>
movss  (%rsp),%xmm0
pop    %rax
jmp    1040 <isUndefined@plt>
movss  0x4(%rsp),%xmm0
subss  (%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0xea8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eq(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = call i32 @isUndefined(float %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load float, float* %5
%11 = call i32 @isUndefined(float %10)
store i32 %11, i32* %3
br label %19
12: ; preds = %2
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fsub float %13, %14
%16 = call double @fabs(float %15)
%17 = fcmp olt double %16, 1.000000e-04
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @eq(float %0, float %1) {
%3 = tail call i32 @isUndefined(float %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @isUndefined(float %1)
br label %12
7: ; preds = %2
%8 = fsub float %0, %1
%9 = tail call double @fabs(float %8)
%10 = fcmp olt double %9, 1.000000e-04
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_max() { assert(((1) >= (2) ? (1) : (2)) == 2); }


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

x86 assembly (clang, -O2):
<test_max>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_max() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_max() {
%1 = tail call i32 @assert(i32 1)
ret void
}
OP(op, ee) { XOR(ARG()); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ARG@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <XOR@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <XOR@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @XOR to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_dec_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "DEC   "
          "0x%02X"
          "                      ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_dec_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_dec_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"DEC 0x%02X \00"
define void @fprint_dec_direct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"DEC 0x%02X \00"
define void @fprint_dec_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int longitud_string(char *s) {
  int i;
  i = 0;
  while (*s != '\0') {
    s = s + 1;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<longitud_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <longitud_string+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <longitud_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_string>:
cmpb   $0x0,(%rdi)
je     111c <longitud_string+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <longitud_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @longitud_string(i8* nocapture %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 i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int f(int);
int main() {
  int a = 7;
  return f(a);
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x7,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 7)
ret i32 %1
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR81_get(void) { return U_WMRCORENONE_get("U_WMR81"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR81\00"
define i32 @U_WMR81_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void other_func2(int z, int my_func(int b, int c), int y) {}


x86 assembly (clang, -O0):
<other_func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @other_func2(i32 %0, i32 (i32, i32)* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32 (i32, i32)*
%6 = alloca i32
store i32 %0, i32* %4
store i32 (i32, i32)* %1, i32 (i32, i32)** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @other_func2(i32 %0, i32 (i32, i32)* nocapture %1, i32 %2) {
ret void
}
void c64_start_freq_cia_a_irq(void) {}


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

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

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

LLVM IR (-O2):
define void @c64_start_freq_cia_a_irq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int /*<<< orphan*/ g(int);
void r() {
  g(0);
  g(1);
  a(0);
  a(0);
  a(0);
  a(1);
}


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

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

LLVM IR (-O0):
define void @r() {
%1 = call i32 @g(i32 0)
%2 = call i32 @g(i32 1)
%3 = call i32 @a(i32 0)
%4 = call i32 @a(i32 0)
%5 = call i32 @a(i32 0)
%6 = call i32 @a(i32 1)
ret void
}

LLVM IR (-O2):
define void @r() {
%1 = tail call i32 @g(i32 0)
%2 = tail call i32 @g(i32 1)
%3 = tail call i32 @a(i32 0)
%4 = tail call i32 @a(i32 0)
%5 = tail call i32 @a(i32 0)
%6 = tail call i32 @a(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCDClear(int);
void Clear_2_3() {
  LCDClear(2);
  LCDClear(3);
}


x86 assembly (clang, -O0):
<Clear_2_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <LCDClear@plt>
mov    $0x3,%edi
call   1030 <LCDClear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clear_2_3>:
push   %rax
mov    $0x2,%edi
call   1030 <LCDClear@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <LCDClear@plt>

LLVM IR (-O0):
define void @Clear_2_3() {
%1 = call i32 @LCDClear(i32 2)
%2 = call i32 @LCDClear(i32 3)
ret void
}

LLVM IR (-O2):
define void @Clear_2_3() {
%1 = tail call i32 @LCDClear(i32 2)
%2 = tail call i32 @LCDClear(i32 3)
ret void
}
/* Variables and functions */
char *conf_alloc_string(char *, char *, char *);
char *pi_conf_alloc_string(char *section, char *key, char *dflt) {
  return conf_alloc_string(section, key, dflt);
}


x86 assembly (clang, -O0):
<pi_conf_alloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <conf_alloc_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_conf_alloc_string>:
jmp    1030 <conf_alloc_string@plt>

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

LLVM IR (-O2):
define i8* @pi_conf_alloc_string(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @conf_alloc_string(i8* %0, i8* %1, i8* %2)
ret i8* %4
}