xunge/DecIR huggingface dataset:
int pl_dectobin(int dec) {
  if (dec == 0) {
    return 0;
  }
  return (dec % 2 + 10 * pl_dectobin(dec / 2));
}


x86 assembly (clang, -O0):
<pl_dectobin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <pl_dectobin+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115c <pl_dectobin+0x4c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <pl_dectobin@plt>
mov    -0xc(%rbp),%edx
imul   $0xa,%eax,%eax
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_dectobin>:
test   %edi,%edi
je     1132 <pl_dectobin+0x22>
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%edi
add    %ebx,%edi
mov    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
sar    %edi
call   1030 <pl_dectobin@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pl_dectobin(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = srem i32 %0, 2
%7 = sdiv i32 %0, 2
%8 = tail call i32 @pl_dectobin(i32 %7)
%9 = mul nsw i32 %8, 10
%10 = add nsw i32 %9, %6
br label %3
}
int mx51_revision(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mx51_revision() {
ret i32 0
}
void sem_init() {}


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

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

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

LLVM IR (-O2):
define void @sem_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void remap_irqs() {
  outb(0x20, 0x11);
  outb(0xa0, 0x11);
  outb(0x21, 0x20);
  outb(0xa1, 0x28);
  outb(0x21, 0x04);
  outb(0xa1, 0x02);
  outb(0x21, 0x01);
  outb(0xa1, 0x01);
  outb(0x21, 0x00);
  outb(0xa1, 0x00);
}


x86 assembly (clang, -O0):
<remap_irqs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_irqs>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @remap_irqs() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 0)
%10 = call i32 @outb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @remap_irqs() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 0)
%10 = tail call i32 @outb(i32 161, i32 0)
ret void
}
/* Variables and functions */
int OK;
int PDC_set_font(int size) { return (OK); }


x86 assembly (clang, -O0):
<PDC_set_font>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_set_font>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_set_font(i32 %0) {
%2 = load i32, i32* @OK
ret i32 %2
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswlower(wint_t wc) {
  return (wc >= 0 && wc < 128 ? wc >= 'a' && wc <= 'z' : 0);
}


x86 assembly (clang, -O0):
<iswlower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1147 <iswlower+0x47>
cmpl   $0x80,-0x4(%rbp)
jge    1147 <iswlower+0x47>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1137 <iswlower+0x37>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <iswlower+0x51>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <iswlower+0x51>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswlower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @iswlower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
regx0indreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jg     113b <regx0indreg1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <regx0indreg1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void UART_1_ScbModeStop(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<UART_1_ScbModeStop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART_1_ScbModeStop+0x9>
jmp    110e <UART_1_ScbModeStop+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @UART_1_ScbModeStop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ quote_calc2_parse();
int /*<<< orphan*/ stdin;
int main(void) {
  while (!feof(stdin)) {
    quote_calc2_parse();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1152 <main+0x32>
jmp    115e <main+0x3e>
mov    $0x0,%al
call   1040 <quote_calc2_parse@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1030 <feof@plt>
test   %eax,%eax
jne    1144 <main+0x24>
xor    %eax,%eax
call   1040 <quote_calc2_parse@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call i32 @feof(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @quote_calc2_parse()
br label %2
9: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @feof(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @quote_calc2_parse()
%6 = load i32, i32* @stdin
%7 = tail call i32 @feof(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret i32 0
}
void foo660(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo660(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
void clear_file() {
  fclose(fopen("CustomUserFile.txt", "w"));
  printf("Custom file cleared! \nPlease restart the program to go back to the "
         "default file.\n\n");
}


x86 assembly (clang, -O0):
<clear_file>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1030 <fclose@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_file>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1040 <fclose@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"CustomUserFile.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [83 x i8] c"Custom file cleared! \0APlease restart the program to go back to the default file.\0A\0A\00"
define void @clear_file() {
%1 = call i32 @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @fclose(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"CustomUserFile.txt\00"
@.str.1 = [2 x i8] c"w\00"
@str = [82 x i8] c"Custom file cleared! \0APlease restart the program to go back to the default file.\0A\00"
define void @clear_file() {
%1 = tail call i32 @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int firstval, secoundval;
  int *pntr;
  pntr = &firstval;
  *pntr = 10;
  pntr = &secoundval;
  *pntr = 20;
  printf("firstval is %d\n", firstval);
  printf("secoundval is %d\n", secoundval);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"firstval is %d\0A\00"
@.str.1 = [18 x i8] c"secoundval is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %6, i32** %8
%9 = load i32*, i32** %8
store i32 10, i32* %9
store i32* %7, i32** %8
%10 = load i32*, i32** %8
store i32 20, i32* %10
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"firstval is %d\0A\00"
@.str.1 = [18 x i8] c"secoundval is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 20)
ret i32 0
}
void i2d_ASN1_BOOLEAN(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_BOOLEAN() {
ret void
}
int show_userinterface(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @show_userinterface() {
ret i32 1
}
void initial_sw_number_net() {}


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

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

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

LLVM IR (-O2):
define void @initial_sw_number_net() {
ret void
}
int test_imm_1Aint16_mem(short *val) {
  return ((*val) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Aint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 26
%7 = icmp ne i32 %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_1Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 26
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t WriteToDev(int port, const void *buf, size_t count) {
  return write(port, buf, count);
}


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

x86 assembly (clang, -O2):
<WriteToDev>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @WriteToDev(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendSystemManager(void) {
  SendInterrupt(0x47, 0x8, 0x0080, 0x00000080);
}


x86 assembly (clang, -O0):
<ScuSendSystemManager>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
mov    $0x8,%esi
mov    $0x80,%ecx
mov    %ecx,%edx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendSystemManager>:
mov    $0x47,%edi
mov    $0x8,%esi
mov    $0x80,%edx
mov    $0x80,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendSystemManager() {
%1 = call i32 @SendInterrupt(i32 71, i32 8, i32 128, i32 128)
ret void
}

LLVM IR (-O2):
define void @ScuSendSystemManager() {
%1 = tail call i32 @SendInterrupt(i32 71, i32 8, i32 128, i32 128)
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int ns_theater(char *s) { return strstr(s, "theater") && strstr(s, "NS"); }


x86 assembly (clang, -O0):
<ns_theater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <ns_theater+0x48>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_theater>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1141 <ns_theater+0x31>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"theater\00"
@.str.1 = [3 x i8] c"NS\00"
define i32 @ns_theater(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strstr(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
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):
@.str = [8 x i8] c"theater\00"
@.str.1 = [3 x i8] c"NS\00"
define i32 @ns_theater(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
__attribute__((no, noclone)) unsigned __int128 t150_3add(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((unsigned __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t150_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0x2,%rdx
adc    $0x0,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t150_3add+0x48>
jmp    115f <t150_3add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t150_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x2,%rbx
adc    $0x0,%r14
jae    112b <t150_3add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t150_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 2, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t150_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op85M1(void) { STA8(SA1Direct(2)); }


x86 assembly (clang, -O0):
<Op85M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op85M1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op85M1() {
%1 = call i32 @SA1Direct(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op85M1() {
%1 = tail call i32 @SA1Direct(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_read_bd_addr(const void *test_data) { test_command(0x1009); }


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

x86 assembly (clang, -O2):
<test_read_bd_addr>:
mov    $0x1009,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_read_bd_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 4105)
ret void
}

LLVM IR (-O2):
define void @test_read_bd_addr(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 4105)
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("EOF = %d", EOF); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"EOF = %d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"EOF = %d\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void rop3_5_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_5_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_5_0_1>:
mov    (%rdi),%al
not    %sil
and    %dl,%sil
and    %al,%sil
or     %dl,%al
not    %al
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_5_0_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** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = and i32 %20, %22
%24 = load i8, i8* %7
%25 = zext i8 %24 to i32
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = or i32 %23, %29
%31 = load i8, i8* %6
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = and i32 %36, %39
%41 = or i32 %30, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_5_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, -1
%7 = xor i8 %1, -1
%8 = and i8 %7, %2
%9 = and i8 %8, %4
%10 = or i8 %9, %6
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int main() {
  unsigned int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", (a + b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xebd(%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    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add i32 %4, %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
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int fk_t_cursor(int x) { return (x); }


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

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

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

LLVM IR (-O2):
define i32 @fk_t_cursor(i32 returned %0) {
ret i32 %0
}
int max(int lhs, int rhs) { return lhs > rhs ? lhs : rhs; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lcd_draw_pixel(int, int, int);
void lcd_draw_vline(int col, int row1, int row2, int color) {
  int i;
  for (i = row1; i <= row2; i++)
    lcd_draw_pixel(i, col, color);
}


x86 assembly (clang, -O0):
<lcd_draw_vline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <lcd_draw_vline+0x42>
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <lcd_draw_pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <lcd_draw_vline+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_draw_vline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1144 <lcd_draw_vline+0x34>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r15d
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <lcd_draw_pixel@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <lcd_draw_vline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lcd_draw_vline(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = tail call i32 @lcd_draw_pixel(i32 %7, i32 %0, i32 %3)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharUL(void) { printf("\x01B(0\x06D\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0m\1B(B\00"
define void @putLDCharUL() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void sting_log_vulnerable_access(struct common_audit_data *a) {}


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

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

LLVM IR (-O0):
%struct.common_audit_data = type opaque
define void @sting_log_vulnerable_access(%struct.common_audit_data* %0) {
%2 = alloca %struct.common_audit_data*
store %struct.common_audit_data* %0, %struct.common_audit_data** %2
ret void
}

LLVM IR (-O2):
%struct.common_audit_data = type opaque
define void @sting_log_vulnerable_access(%struct.common_audit_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_SendConsoleCommand(int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void CG_vstrDown_f(void) {
  if (trap_Argc() == 5)
    trap_SendConsoleCommand(va("vstr %s;", CG_Argv(1)));
  else
    CG_Printf("[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\n");
}


x86 assembly (clang, -O0):
<CG_vstrDown_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    1188 <CG_vstrDown_f+0x38>
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1060 <va@plt>
mov    %eax,%edi
call   1070 <trap_SendConsoleCommand@plt>
jmp    1194 <CG_vstrDown_f+0x44>
lea    0xe7a(%rip),%rdi
call   1050 <CG_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_vstrDown_f>:
push   %rax
xor    %eax,%eax
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    117d <CG_vstrDown_f+0x2d>
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1060 <va@plt>
mov    %eax,%edi
pop    %rax
jmp    1070 <trap_SendConsoleCommand@plt>
lea    0xe85(%rip),%rdi
pop    %rax
jmp    1050 <CG_Printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrDown_f() {
%1 = call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @CG_Argv(i32 1)
%5 = call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrDown_f() {
%1 = tail call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @CG_Argv(i32 1)
%5 = tail call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ makeHumanReadableTime(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void showElapsedTime(uint64_t elapsedTime) {
  char _elapsedTimeHR[200];
  makeHumanReadableTime(_elapsedTimeHR, elapsedTime);
  printf("Elapsed %s\n", _elapsedTimeHR);
}


x86 assembly (clang, -O0):
<showElapsedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <makeHumanReadableTime@plt>
lea    -0xd0(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showElapsedTime>:
push   %rbx
sub    $0xd0,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <makeHumanReadableTime@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Elapsed %s\0A\00"
define void @showElapsedTime(i32 %0) {
%2 = alloca i32
%3 = alloca [200 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @makeHumanReadableTime(i8* %4, i32 %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Elapsed %s\0A\00"
define void @showElapsedTime(i32 %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @makeHumanReadableTime(i8* %3, i32 %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void tcp_vegas_unregister(void) { ; }


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

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

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

LLVM IR (-O2):
define void @tcp_vegas_unregister() {
ret void
}
void X509_ALGOR_get0(void) {}


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

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

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

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

/* Variables and functions */
int add_int_data(struct buffer *, int, unsigned int);
int add_bearer_avp(struct buffer *buf, unsigned int bearer) {
  return add_int_data(buf, 18, bearer);
}


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

x86 assembly (clang, -O2):
<add_bearer_avp>:
mov    %esi,%edx
mov    $0x12,%esi
jmp    1030 <add_int_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_bearer_avp(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @add_int_data(%struct.buffer* %5, i32 18, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_bearer_avp(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @add_int_data(%struct.buffer* %0, i32 18, i32 %1)
ret i32 %3
}
int hammingDistance(int x, int y) {
  int xor = x ^ y;
  int result = 0;
  while (xor) {
    if (xor&1) {
      result++;
    }
    xor >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<hammingDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <hammingDistance+0x4a>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113c <hammingDistance+0x3c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <hammingDistance+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingDistance>:
xor    %eax,%eax
xor    %esi,%edi
je     1120 <hammingDistance+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <hammingDistance+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingDistance(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i32 [ %10, %5 ], [ %3, %2 ]
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %6, %8
%10 = ashr i32 %7, 1
%11 = icmp ult i32 %7, 2
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
void runDemoThread() {}


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

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

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

LLVM IR (-O2):
define void @runDemoThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void backcolor(int color) { printf("\033[%02dm", color + 40); }


x86 assembly (clang, -O0):
<backcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x28,%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backcolor>:
lea    0x28(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @backcolor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 40
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @backcolor(i32 %0) {
%2 = add nsw i32 %0, 40
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void expected(const char *s) {
  printf("\n");
  printf("  Error: `%s' expected\n", s);
  printf("\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<expected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<expected>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [24 x i8] c" Error: `%s' expected\0A\00"
@EXIT_FAILURE = global i32 0
define void @expected(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c" Error: `%s' expected\0A\00"
@EXIT_FAILURE = global i32 0
define void @expected(i8* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @putchar(i32 10)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSTBM(const char *the_title) { return any_decrqss(the_title, "r"); }


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

x86 assembly (clang, -O2):
<rpt_DECSTBM>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @rpt_DECSTBM(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void set_oss_buffers(int num, int size) {}


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

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

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

LLVM IR (-O2):
define void @set_oss_buffers(i32 %0, i32 %1) {
ret void
}