xunge/DecIR huggingface dataset:
/* Type definitions */
struct node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct node *removeNode(struct list *list, struct node *node) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.node = type { i32 }
define noalias %struct.node* @removeNode(%struct.list* nocapture readnone %0, %struct.node* nocapture readnone %1) {
ret %struct.node* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_compression_mode_pg(struct list_head *, int);
uint8_t set_dlt_compression(struct list_head *m, int lvl) {
  ;
  return set_compression_mode_pg(m, lvl);
}


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

x86 assembly (clang, -O2):
<set_dlt_compression>:
jmp    1030 <set_compression_mode_pg@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_dlt_compression(%struct.list_head* %0, i32 %1) {
%3 = tail call i32 @set_compression_mode_pg(%struct.list_head* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
double bounceEaseInd(double);
double bounceEaseOutd(double);
double bounceEaseInOutd(double p) {
  if (p < 0.5) {
    return 0.5 * bounceEaseInd(p * 2);
  } else {
    return 0.5 * bounceEaseOutd(p * 2 - 1) + 0.5;
  }
}


x86 assembly (clang, -O0):
<bounceEaseInOutd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116b <bounceEaseInOutd+0x4b>
movsd  0xec8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <bounceEaseInd@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119a <bounceEaseInOutd+0x7a>
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <bounceEaseOutd@plt>
movsd  0xe73(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounceEaseInOutd>:
push   %rax
movsd  0xed7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1142 <bounceEaseInOutd+0x22>
addsd  %xmm0,%xmm0
call   1030 <bounceEaseInd@plt>
mulsd  0xec0(%rip),%xmm0
pop    %rax
ret
addsd  %xmm0,%xmm0
addsd  0xeba(%rip),%xmm0
call   1040 <bounceEaseOutd@plt>
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bounceEaseInOutd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, 2.000000e+00
%9 = call double @bounceEaseInd(double %8)
%10 = fmul double 5.000000e-01, %9
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double -1.000000e+00)
%14 = call double @bounceEaseOutd(double %13)
%15 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %14, double 5.000000e-01)
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @bounceEaseInOutd(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul double %0, 2.000000e+00
%5 = tail call double @bounceEaseInd(double %4)
%6 = fmul double %5, 5.000000e-01
br label %11
7: ; preds = %1
%8 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%9 = tail call double @bounceEaseOutd(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 5.000000e-01, double 5.000000e-01)
br label %11
11: ; preds = %7, %3
%12 = phi double [ %6, %3 ], [ %10, %7 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
void check_valid_symmetric_encrypted_item_size(int size) {
  if (size <= 10 + 32)
    abort_crypto_lib("Illegal size for symmetric encrypted item");
}


x86 assembly (clang, -O0):
<check_valid_symmetric_encrypted_item_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
jg     1131 <check_valid_symmetric_encrypted_item_size+0x21>
lea    0xed4(%rip),%rdi
call   1030 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_valid_symmetric_encrypted_item_size>:
cmp    $0x2a,%edi
jg     1121 <check_valid_symmetric_encrypted_item_size+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <abort_crypto_lib@plt>
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Illegal size for symmetric encrypted item\00"
define void @check_valid_symmetric_encrypted_item_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Illegal size for symmetric encrypted item\00"
define void @check_valid_symmetric_encrypted_item_size(i32 %0) {
%2 = icmp slt i32 %0, 43
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AllDaemon(int, int, int);
int ArgWord();
void Act_AllDaemon(void) {
  int v = ArgWord();
  int n = ArgWord();
  AllDaemon(v, n, ArgWord());
}


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

x86 assembly (clang, -O2):
<Act_AllDaemon>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <ArgWord@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgWord@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <ArgWord@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <AllDaemon@plt>

LLVM IR (-O0):
define void @Act_AllDaemon() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @ArgWord()
store i32 %3, i32* %1
%4 = call i32 (...) @ArgWord()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (...) @ArgWord()
%8 = call i32 @AllDaemon(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @Act_AllDaemon() {
%1 = tail call i32 (...) @ArgWord()
%2 = tail call i32 (...) @ArgWord()
%3 = tail call i32 (...) @ArgWord()
%4 = tail call i32 @AllDaemon(i32 %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
struct termios {
  int c_iflag;
  int c_cflag;
};
typedef int speed_t;

/* Variables and functions */
int CBAUD;
int CBAUDEX;
speed_t cfgetispeed(const struct termios *termios_p) {
  return ((termios_p->c_iflag & 020000000000)
              ? 0
              : termios_p->c_cflag & (CBAUD | CBAUDEX));
}


x86 assembly (clang, -O0):
<cfgetispeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1126 <cfgetispeed+0x26>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <cfgetispeed+0x44>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ea3(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgetispeed>:
cmpl   $0x0,(%rdi)
js     111b <cfgetispeed+0x1b>
mov    0x2ec4(%rip),%rcx
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
and    0x4(%rdi),%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32, i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = and i32 %5, -2147483648
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %17
9: ; preds = %1
%10 = load %struct.termios*, %struct.termios** %2
%11 = getelementptr inbounds %struct.termios, %struct.termios* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = load i32, i32* @CBAUD
%14 = load i32, i32* @CBAUDEX
%15 = or i32 %13, %14
%16 = and i32 %12, %15
br label %17
17: ; preds = %9, %8
%18 = phi i32 [ 0, %8 ], [ %16, %9 ]
ret i32 %18
}

LLVM IR (-O2):
%struct.termios = type { i32, i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cfgetispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = load i32, i32* @CBAUD
%9 = load i32, i32* @CBAUDEX
%10 = or i32 %9, %8
%11 = and i32 %10, %7
br label %12
12: ; preds = %1, %5
%13 = phi i32 [ %11, %5 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ gentables();
int /*<<< orphan*/ gkey(int, int, unsigned char *);
void aes_set_key(unsigned char *key) {
  gentables();
  gkey(4, 4, key);
}


x86 assembly (clang, -O0):
<aes_set_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gentables@plt>
mov    -0x8(%rbp),%rdx
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <gkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_set_key>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gentables@plt>
mov    $0x4,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <gkey@plt>

LLVM IR (-O0):
define void @aes_set_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @gentables()
%4 = load i8*, i8** %2
%5 = call i32 @gkey(i32 4, i32 4, i8* %4)
ret void
}

LLVM IR (-O2):
define void @aes_set_key(i8* %0) {
%2 = tail call i32 (...) @gentables()
%3 = tail call i32 @gkey(i32 4, i32 4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __ProcessError(const char *description) {
  fprintf(stderr, "Error: %s.\n", description);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<__ProcessError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__ProcessError>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Error: %s.\0A\00"
@EXIT_FAILURE = global i32 0
define void @__ProcessError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void udev_selinux_setfscreateconat(struct udev *udev, int dfd, const char *file,
                                   unsigned int mode) {}


x86 assembly (clang, -O0):
<udev_selinux_setfscreateconat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.udev = type opaque
define void @udev_selinux_setfscreateconat(%struct.udev* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.udev*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.udev* %0, %struct.udev** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.udev = type opaque
define void @udev_selinux_setfscreateconat(%struct.udev* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t __be_u24(const void *p) {
  const unsigned char *c = (const unsigned char *)p;
  return (((uint32_t)c[0]) << 16U) | (((uint32_t)c[1]) << 8U) |
         (((uint32_t)c[2]) << 0U);
}


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

x86 assembly (clang, -O2):
<__be_u24>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__be_u24(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 16
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 0
%21 = or i32 %15, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @__be_u24(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
/* Variables and functions */
long double cosh(double);
long double coshl(long double x) { return cosh((double)x); }


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cosh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <cosh@plt>

LLVM IR (-O0):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @cosh(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @cosh(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int getchar();
scalar_t__ isdigit(int /*<<< orphan*/);
int /*<<< orphan*/ peek();
int read_number(int val) {
  while (isdigit(peek()))
    val = val * 10 + (getchar() - '0');
  return val;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <peek@plt>
mov    %eax,%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1173 <read_number+0x43>
imul   $0xa,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <read_number+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <peek@plt>
mov    %eax,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     1165 <read_number+0x35>
lea    (%rbx,%rbx,4),%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
lea    (%rax,%rbx,2),%ebx
add    $0xffffffd0,%ebx
jmp    1140 <read_number+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 (...) @peek()
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 10
%10 = call i32 (...) @getchar()
%11 = sub nsw i32 %10, 48
%12 = add nsw i32 %9, %11
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @read_number(i32 %0) {
%2 = tail call i32 (...) @peek()
%3 = tail call i64 @isdigit(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %10, %5 ], [ %0, %1 ]
%7 = mul nsw i32 %6, 10
%8 = tail call i32 (...) @getchar()
%9 = add i32 %7, -48
%10 = add i32 %9, %8
%11 = tail call i32 (...) @peek()
%12 = tail call i64 @isdigit(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ %0, %1 ], [ %10, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sock_cleanup(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<sock_cleanup>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sock_cleanup(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void set(char *what, int *ar, int num) {
  if (num < 20) {
    ++ar[num];
  } else {
    printf("%s out of bounds: %d\n", what, num);
  }
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1143 <set+0x33>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    1156 <set+0x46>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
cmp    $0x13,%edx
jg     111d <set+0xd>
movslq %edx,%rax
addl   $0x1,(%rsi,%rax,4)
ret
mov    %rdi,%rax
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"%s out of bounds: %d\0A\00"
define void @set(i8* %0, i32* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 20
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
br label %12
10: ; preds = %3
%11 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
br label %12
12: ; preds = %10, %5
ret void
}
/* Variables and functions */
float _erfcf(float);
float erfcf(float x) { return _erfcf(x); }


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

x86 assembly (clang, -O2):
<erfcf>:
jmp    1030 <_erfcf@plt>

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

LLVM IR (-O2):
define float @erfcf(float %0) {
%2 = tail call float @_erfcf(float %0)
ret float %2
}
/* Variables and functions */
scalar_t__ getTempOutFloatStore(int);
double *getTempOutDoubleStore(int alignmentBytes) {
  return (double *)getTempOutFloatStore(alignmentBytes);
}


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

x86 assembly (clang, -O2):
<getTempOutDoubleStore>:
jmp    1030 <getTempOutFloatStore@plt>

LLVM IR (-O0):
define double* @getTempOutDoubleStore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @getTempOutFloatStore(i32 %3)
%5 = inttoptr i64 %4 to double*
ret double* %5
}

LLVM IR (-O2):
define double* @getTempOutDoubleStore(i32 %0) {
%2 = tail call i64 @getTempOutFloatStore(i32 %0)
%3 = inttoptr i64 %2 to double*
ret double* %3
}
/* Variables and functions */
int /*<<< orphan*/ _ctache_data_destroy(void *, int);
void ctache_data_destroy(void *data) { _ctache_data_destroy(data, true); }


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

x86 assembly (clang, -O2):
<ctache_data_destroy>:
mov    $0x1,%esi
jmp    1030 <_ctache_data_destroy@plt>

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

LLVM IR (-O2):
define void @ctache_data_destroy(i8* %0) {
%2 = tail call i32 @_ctache_data_destroy(i8* %0, i32 1)
ret void
}
int isgraph(int c) {
  return (int)((((unsigned)c) > ' ') && (((unsigned)c) <= (unsigned)'~'));
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jbe    1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setbe  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
int pwm_enable(struct pwm_device *pwm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pwm_device = type opaque
define i32 @pwm_enable(%struct.pwm_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int intel_gen(int /*<<< orphan*/);
bool is_gen6_plus(uint32_t devid, uint32_t pch) {
  return intel_gen(devid) >= 6;
}


x86 assembly (clang, -O0):
<is_gen6_plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <intel_gen@plt>
cmp    $0x6,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gen6_plus>:
push   %rax
call   1030 <intel_gen@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_gen6_plus(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 = call i32 @intel_gen(i32 %5)
%7 = icmp sge i32 %6, 6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_gen6_plus(i32 %0, i32 %1) {
%3 = tail call i32 @intel_gen(i32 %0)
%4 = icmp sgt i32 %3, 5
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int SEGGER_RTT_WriteString(int /*<<< orphan*/, char const *);
int puts(const char *s) { return SEGGER_RTT_WriteString(0, s); }


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

x86 assembly (clang, -O2):
<puts>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <SEGGER_RTT_WriteString@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @SEGGER_RTT_WriteString(i32 0, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
pclose(FILE *p) { printf("no pclose\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"no pclose\00"
define i32 @pclose(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ FSE_readLE32(void const *);
int /*<<< orphan*/ FSE_readLE64(void const *);
size_t FSE_readLEST(const void *memPtr) {
  if (sizeof(size_t) == 4)
    return (size_t)FSE_readLE32(memPtr);
  else
    return (size_t)FSE_readLE64(memPtr);
}


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

x86 assembly (clang, -O2):
<FSE_readLEST>:
push   %rax
call   1030 <FSE_readLE64@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @FSE_readLEST(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FSE_readLE64(i8* %3)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @FSE_readLEST(i8* %0) {
%2 = tail call i32 @FSE_readLE64(i8* %0)
%3 = sext i32 %2 to i64
ret i64 %3
}
unsigned char inb(unsigned short port) {
  unsigned char value;
  __asm__ __volatile__("inb %w1, %b0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
struct ts27010_ringbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct ts27010_ringbuf *);
void ts27010_ringbuf_free(struct ts27010_ringbuf *rbuf) { kfree(rbuf); }


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

x86 assembly (clang, -O2):
<ts27010_ringbuf_free>:
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.ts27010_ringbuf = type { i32 }
define void @ts27010_ringbuf_free(%struct.ts27010_ringbuf* %0) {
%2 = alloca %struct.ts27010_ringbuf*
store %struct.ts27010_ringbuf* %0, %struct.ts27010_ringbuf** %2
%3 = load %struct.ts27010_ringbuf*, %struct.ts27010_ringbuf** %2
%4 = call i32 @kfree(%struct.ts27010_ringbuf* %3)
ret void
}

LLVM IR (-O2):
%struct.ts27010_ringbuf = type { i32 }
define void @ts27010_ringbuf_free(%struct.ts27010_ringbuf* %0) {
%2 = tail call i32 @kfree(%struct.ts27010_ringbuf* %0)
ret void
}
/* Type definitions */
struct telnetp {
  int dummy;
};

/* Variables and functions */
int gather_ansi(struct telnetp *);
int process_ansi(struct telnetp *);
int process_ansi_escape(struct telnetp *t) {
  if (gather_ansi(t) == -1)
    return -1;
  if (process_ansi(t) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<process_ansi_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gather_ansi@plt>
cmp    $0xffffffff,%eax
jne    114a <process_ansi_escape+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <process_ansi_escape+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <process_ansi@plt>
cmp    $0xffffffff,%eax
jne    1168 <process_ansi_escape+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <process_ansi_escape+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_ansi_escape>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gather_ansi@plt>
cmp    $0xffffffff,%eax
je     1144 <process_ansi_escape+0x24>
mov    %rbx,%rdi
call   1030 <process_ansi@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.telnetp = type { i32 }
define i32 @process_ansi_escape(%struct.telnetp* %0) {
%2 = alloca i32
%3 = alloca %struct.telnetp*
store %struct.telnetp* %0, %struct.telnetp** %3
%4 = load %struct.telnetp*, %struct.telnetp** %3
%5 = call i32 @gather_ansi(%struct.telnetp* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load %struct.telnetp*, %struct.telnetp** %3
%10 = call i32 @process_ansi(%struct.telnetp* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.telnetp = type { i32 }
define i32 @process_ansi_escape(%struct.telnetp* %0) {
%2 = tail call i32 @gather_ansi(%struct.telnetp* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @process_ansi(%struct.telnetp* %0)
%6 = icmp eq i32 %5, -1
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
void init_joypad(void) {}


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

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

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

LLVM IR (-O2):
define void @init_joypad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int var0 = 1;
  if (var0) {
    printf("Var0 != 0\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <main+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Var0 != 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [10 x i8] c"Var0 != 0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
main() {
  const int i = 7;
  int b = 0;
  switch (i) {
  case 5 + 2:
    b = 1;
    break;
  case sizeof(int):;
  }
  assert(b);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SysTick_Wait(int);
void SysTick_Wait10ms(unsigned long delay) {
  unsigned long i;
  for (i = 0; i < delay; i++) {
    SysTick_Wait(60000);
  }
}


x86 assembly (clang, -O0):
<SysTick_Wait10ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114d <SysTick_Wait10ms+0x3d>
mov    $0xea60,%edi
call   1030 <SysTick_Wait@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <SysTick_Wait10ms+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTick_Wait10ms>:
push   %rbx
test   %rdi,%rdi
je     1130 <SysTick_Wait10ms+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0xea60,%edi
call   1030 <SysTick_Wait@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <SysTick_Wait10ms+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @SysTick_Wait10ms(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @SysTick_Wait(i32 60000)
br label %10
10: ; preds = %8
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @SysTick_Wait10ms(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @SysTick_Wait(i32 60000)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SAR_W_IMM(int reg, int count) {
  addbyte(0x66);
  if (reg & 8)
    addbyte(0x41);
  addbyte(0xc1);
  addbyte(0xc0 | (reg & 7) | 0x38);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SAR_W_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1141 <SAR_W_IMM+0x31>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
or     $0x38,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAR_W_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
test   $0x8,%bpl
je     1131 <SAR_W_IMM+0x21>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xc1,%edi
call   1030 <addbyte@plt>
or     $0xf8,%ebp
movzbl %bpl,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SAR_W_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = load i32, i32* %3
%7 = and i32 %6, 8
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @addbyte(i32 65)
br label %11
11: ; preds = %9, %2
%12 = call i32 @addbyte(i32 193)
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = or i32 192, %14
%16 = or i32 %15, 56
%17 = call i32 @addbyte(i32 %16)
%18 = load i32, i32* %4
%19 = call i32 @addbyte(i32 %18)
ret void
}

LLVM IR (-O2):
define void @SAR_W_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = and i32 %0, 8
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @addbyte(i32 193)
%10 = and i32 %0, 7
%11 = or i32 %10, 248
%12 = tail call i32 @addbyte(i32 %11)
%13 = tail call i32 @addbyte(i32 %1)
ret void
}
void unitserror(char *s) {}


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

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

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

LLVM IR (-O2):
define void @unitserror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello_world() {
  printf("Hello World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @hello_world() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ri_mem_copy(void *, void *, size_t);
void ri_parallel_gather(void *src, void *dst, size_t size) {
  ri_mem_copy(dst, src, size);
}


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

x86 assembly (clang, -O2):
<ri_parallel_gather>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <ri_mem_copy@plt>

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

LLVM IR (-O2):
define void @ri_parallel_gather(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @ri_mem_copy(i8* %1, i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memorial_delete(int);
int memorial_delete_timer(int tid, unsigned int tick, int id, void *data) {
  memorial_delete(id);
  return 0;
}


x86 assembly (clang, -O0):
<memorial_delete_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <memorial_delete@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @memorial_delete_timer(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @memorial_delete(i32 %2)
ret i32 0
}
int fct_hash(char *name) {
  int accum = 0;
  char *s = name;
  while (*s) {
    accum <<= 1;
    accum += (unsigned)(*s++ & 0xFF);
  }
  return accum % 113;
}


x86 assembly (clang, -O0):
<fct_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <fct_hash+0x4f>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
and    $0xff,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <fct_hash+0x17>
mov    -0xc(%rbp),%eax
mov    $0x71,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_hash>:
mov    (%rdi),%al
test   %al,%al
je     113e <fct_hash+0x3e>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl %al,%eax
lea    (%rax,%rcx,2),%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <fct_hash+0x10>
movslq %ecx,%rax
imul   $0x487ede05,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x71,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fct_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = zext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %11, 113
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int toascii(int c) { return (c & 0x7f); }


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

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ check_size_t(size_t *, size_t *, char *);
void check_size_t__(size_t *x, size_t *y, char *ret) {
  check_size_t(x, y, ret);
}


x86 assembly (clang, -O0):
<check_size_t__>:
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 <check_size_t@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_size_t__>:
jmp    1030 <check_size_t@plt>

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

LLVM IR (-O2):
define void @check_size_t__(i64* %0, i64* %1, i8* %2) {
%4 = tail call i32 @check_size_t(i64* %0, i64* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void penn_perror(const char *err) {
  fprintf(stderr, "portmsg: %s: %s\n", err, strerror(errno));
}


x86 assembly (clang, -O0):
<penn_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<penn_perror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"portmsg: %s: %s\0A\00"
@errno = global i32 0
define void @penn_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"portmsg: %s: %s\0A\00"
@errno = global i32 0
define void @penn_perror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}