xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inb(uint16_t port) {
  uint8_t value;
  __asm__ volatile("inb %%dx, %%al" : "=a"(value) : "d"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
void _mcleanup() {}


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

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

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

LLVM IR (-O2):
define void @_mcleanup() {
ret void
}
int gen_j(int address) {
  int opcode;
  int target;
  target = (address & 0xFFFFFFC) >> 2;
  opcode = (0x2 << 26) + target;
  return opcode;
}


x86 assembly (clang, -O0):
<gen_j>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffc,%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x8000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_j>:
shr    $0x2,%edi
and    $0x3ffffff,%edi
lea    0x8000000(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @gen_j(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 268435452
%7 = ashr i32 %6, 2
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 134217728, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @gen_j(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 67108863
%4 = or i32 %3, 134217728
ret i32 %4
}
void putLexChar(char ch, char **writePointer) {
  **writePointer = ch;
  (*writePointer)++;
}


x86 assembly (clang, -O0):
<putLexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putLexChar>:
mov    (%rsi),%rax
mov    %dil,(%rax)
addq   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @putLexChar(i8 signext %0, i8** %1) {
%3 = alloca i8
%4 = alloca i8**
store i8 %0, i8* %3
store i8** %1, i8*** %4
%5 = load i8, i8* %3
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
ret void
}

LLVM IR (-O2):
define void @putLexChar(i8 signext %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
store i8 %0, i8* %3
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %1
ret void
}
/* Variables and functions */
double song_play(double, int);
double modipulategml_song_play(double songid) { return song_play(songid, 1); }


x86 assembly (clang, -O0):
<modipulategml_song_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <song_play@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @modipulategml_song_play(double %0) {
%2 = tail call double @song_play(double %0, i32 1)
ret double %2
}
SILC_TASK_CALLBACK(cont2) { SILC_LOG_DEBUG(("Adding %d fd tasks", 250 - 10)); }


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

x86 assembly (clang, -O2):
<SILC_TASK_CALLBACK>:
mov    $0xf0,%edi
xor    %eax,%eax
jmp    1030 <SILC_LOG_DEBUG@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Adding %d fd tasks\00"
define i32 @SILC_TASK_CALLBACK(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @SILC_LOG_DEBUG to i32 (i32, ...)*)(i32 240)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @SILC_TASK_CALLBACK(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @SILC_LOG_DEBUG to i32 (i32, ...)*)(i32 240)
ret i32 undef
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ perror(char const *);
void die(const char *s, int sock, struct addrinfo *res) {
  perror(s);
  if (sock)
    close(sock);
  if (res)
    freeaddrinfo(res);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
cmpl   $0x0,-0xc(%rbp)
je     116e <die+0x2e>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
cmpq   $0x0,-0x18(%rbp)
je     1182 <die+0x42>
mov    -0x18(%rbp),%rdi
call   1060 <freeaddrinfo@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <perror@plt>
test   %ebp,%ebp
je     1158 <die+0x18>
mov    %ebp,%edi
call   1030 <close@plt>
test   %rbx,%rbx
je     1165 <die+0x25>
mov    %rbx,%rdi
call   1060 <freeaddrinfo@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
@EXIT_FAILURE = global i32 0
define void @die(i8* %0, i32 %1, %struct.addrinfo* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.addrinfo*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.addrinfo* %2, %struct.addrinfo** %6
%7 = load i8*, i8** %4
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %11, %3
%15 = load %struct.addrinfo*, %struct.addrinfo** %6
%16 = icmp ne %struct.addrinfo* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load %struct.addrinfo*, %struct.addrinfo** %6
%19 = call i32 @freeaddrinfo(%struct.addrinfo* %18)
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture %0, i32 %1, %struct.addrinfo* %2) {
%4 = tail call i32 @perror(i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @close(i32 %1)
br label %8
8: ; preds = %6, %3
%9 = icmp eq %struct.addrinfo* %2, null
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @freeaddrinfo(%struct.addrinfo* %2)
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
}
void close_peerlog(void) {}


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

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

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

LLVM IR (-O2):
define void @close_peerlog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f4(void) { printf("f4\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"f4\00"
define void @f4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
int __attribute__((always_)) trace_puts(const char *s __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @trace_puts(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_dobldobl_one_affinization(void) {
  int fail, a, b;
  double c;
  fail = _ada_use_c2phc4c(902, &a, &b, &c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_one_affinization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x386,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_one_affinization>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x386,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_one_affinization() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = call i32 @_ada_use_c2phc4c(i32 902, i32* %2, i32* %3, double* %4, i32 0)
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_one_affinization() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @_ada_use_c2phc4c(i32 902, i32* %1, i32* %2, double* %3, i32 0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ generador();
void generar() { generador(); }


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

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

LLVM IR (-O0):
define void @generar() {
%1 = call i32 (...) @generador()
ret void
}

LLVM IR (-O2):
define void @generar() {
%1 = tail call i32 (...) @generador()
ret void
}
int old_main(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @old_main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t str_len_01(const char *s) {
  const char *e = s;
  for (; *s; s++)
    ;
  return s - e;
}


x86 assembly (clang, -O0):
<str_len_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <str_len_01+0x33>
jmp    1122 <str_len_01+0x22>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <str_len_01+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len_01>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_len_01+0x10>
ret

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

LLVM IR (-O2):
define i64 @str_len_01(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int Q_islower(int c) {
  if (c >= 'a' && c <= 'z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<Q_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <Q_islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <Q_islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Q_islower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @Q_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void io_wait(void) {
  __asm__ __volatile__("outb %%al, $0x80" ::"a"(0) : "memory");
}


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
xor    %eax,%eax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "outb %al, $$0x80", "{ax},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
void foo535() {}


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

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

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

LLVM IR (-O2):
define void @foo535() {
ret void
}
/* Type definitions */
typedef int ptr_arr;

/* Variables and functions */
char **malloc(int);
int main() {
  char a = 3;
  char b = 2;
  char **ptr_arr = malloc(sizeof(char *) * 3);
  ptr_arr[0] = &a;
  ptr_arr[1] = &b;
  ptr_arr[2] = &b;
  b = 5;
  return *(ptr_arr[0]) + *(ptr_arr[1]) + *(ptr_arr[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x3,-0x5(%rbp)
movb   $0x2,-0x6(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x5(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
lea    -0x6(%rbp),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
lea    -0x6(%rbp),%rcx
mov    %rcx,0x10(%rax)
movb   $0x5,-0x6(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8**
store i32 0, i32* %1
store i8 3, i8* %2
store i8 2, i8* %3
%5 = call i8** @malloc(i32 24)
store i8** %5, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* %2, i8** %7
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
store i8* %3, i8** %9
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 2
store i8* %3, i8** %11
store i8 5, i8* %3
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %16, %21
%23 = load i8**, i8*** %4
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = add nsw i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8** @malloc(i32 24)
ret i32 13
}
/* Variables and functions */
int /*<<< orphan*/ parse_pressures(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ toilet_paper_pressure();
int /*<<< orphan*/ toilet_seat_pressure();
void measure(void *arg) {
  parse_pressures(toilet_paper_pressure(), toilet_seat_pressure());
}


x86 assembly (clang, -O0):
<measure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <toilet_paper_pressure@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <toilet_seat_pressure@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <parse_pressures@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure>:
push   %rbx
xor    %eax,%eax
call   1030 <toilet_paper_pressure@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <toilet_seat_pressure@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <parse_pressures@plt>

LLVM IR (-O0):
define void @measure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @toilet_paper_pressure()
%4 = call i32 (...) @toilet_seat_pressure()
%5 = call i32 @parse_pressures(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @measure(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @toilet_paper_pressure()
%3 = tail call i32 (...) @toilet_seat_pressure()
%4 = tail call i32 @parse_pressures(i32 %2, i32 %3)
ret void
}
void arm_stc() {}


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

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

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

LLVM IR (-O2):
define void @arm_stc() {
ret void
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_get_current_slot(void *bus) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_get_current_slot(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int EOF;
int _fwrite(unsigned char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int c) {
  unsigned char ch = c;
  return _fwrite(&ch, 1, stdout) == 1 ? ch : EOF;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_fwrite@plt>
cmp    $0x1,%eax
jne    114d <putchar+0x3d>
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <putchar+0x49>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x7(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <_fwrite@plt>
cmp    $0x1,%eax
je     113e <putchar+0x2e>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i32, i32* @stdout
%7 = call i32 @_fwrite(i8* %3, i32 1, i32 %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
br label %14
12: ; preds = %1
%13 = load i32, i32* @EOF
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i32, i32* @stdout
%5 = call i32 @_fwrite(i8* %2, i32 1, i32 %4)
%6 = icmp eq i32 %5, 1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = load i32, i32* @EOF
%10 = select i1 %6, i32 %8, i32 %9
ret i32 %10
}
int fun857() { return 857; }


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

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

LLVM IR (-O0):
define i32 @fun857() {
ret i32 857
}

LLVM IR (-O2):
define i32 @fun857() {
ret i32 857
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
void conio_cputs(char *s) { addstr(s); }


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

x86 assembly (clang, -O2):
<conio_cputs>:
jmp    1030 <addstr@plt>

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

LLVM IR (-O2):
define void @conio_cputs(i8* %0) {
%2 = tail call i32 @addstr(i8* %0)
ret void
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_recv_common(struct mg_connection *, void *, int);
void mg_if_recv_tcp_cb(struct mg_connection *nc, void *buf, int len) {
  mg_recv_common(nc, buf, len);
}


x86 assembly (clang, -O0):
<mg_if_recv_tcp_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <mg_recv_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_if_recv_tcp_cb>:
jmp    1030 <mg_recv_common@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
define void @mg_if_recv_tcp_cb(%struct.mg_connection* %0, i8* %1, i32 %2) {
%4 = alloca %struct.mg_connection*
%5 = alloca i8*
%6 = alloca i32
store %struct.mg_connection* %0, %struct.mg_connection** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.mg_connection*, %struct.mg_connection** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @mg_recv_common(%struct.mg_connection* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_if_recv_tcp_cb(%struct.mg_connection* %0, i8* %1, i32 %2) {
%4 = tail call i32 @mg_recv_common(%struct.mg_connection* %0, i8* %1, i32 %2)
ret void
}
void aes() {}


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

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

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

LLVM IR (-O2):
define void @aes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
int /*<<< orphan*/ WatchdogStatusHandle();
void WatchdogStatusLogging() { UAVObjLogging(WatchdogStatusHandle()); }


x86 assembly (clang, -O0):
<WatchdogStatusLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <WatchdogStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStatusLogging>:
push   %rax
xor    %eax,%eax
call   1040 <WatchdogStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

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

LLVM IR (-O2):
define void @WatchdogStatusLogging() {
%1 = tail call i32 (...) @WatchdogStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hi_dword(uint64_t val) { return val >> 32; }


x86 assembly (clang, -O0):
<hi_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hi_dword(i32 %0) {
ret i32 poison
}
void SV_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @SV_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void copy_substring(char *destination, int startidx, int endidx,
                    const char *source) {
  if (startidx > -1) {
    strncpy(destination, source + startidx, endidx - startidx);
    destination[endidx - startidx] = '\0';
  }
}


x86 assembly (clang, -O0):
<copy_substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jle    115b <copy_substring+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_substring>:
test   %esi,%esi
js     113d <copy_substring+0x2d>
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %esi,%eax
add    %rax,%rcx
sub    %esi,%ebx
mov    %rcx,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @copy_substring(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp sgt i32 %1, -1
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = sub nsw i32 %2, %1
%10 = tail call i32 @strncpy(i8* %0, i8* %8, i32 %9)
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %6, %4
ret void
}
double foo(unsigned int x) { return (double)(float)(x & 0x1ffffff); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffffff,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0x1ffffff,%edi
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 33554431
%5 = uitofp i32 %4 to float
%6 = fpext float %5 to double
ret double %6
}

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = and i32 %0, 33554431
%3 = uitofp i32 %2 to float
%4 = fpext float %3 to double
ret double %4
}
long int lround(double x) { return (long)(x + __builtin_copysign(0.5, x)); }


x86 assembly (clang, -O0):
<lround>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xeeb(%rip),%xmm2
por    %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lround>:
movapd 0xef8(%rip),%xmm1
andpd  %xmm0,%xmm1
orpd   0xefc(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
ret

LLVM IR (-O0):
define i64 @lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.copysign.f64(double 5.000000e-01, double %4)
%6 = fadd double %3, %5
%7 = fptosi double %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call double @llvm.copysign.f64(double 5.000000e-01, double %0)
%3 = fadd double %2, %0
%4 = fptosi double %3 to i64
ret i64 %4
}
void RTNetTCPChecksum(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetTCPChecksum() {
ret void
}
int f(int *a, int *b) {
  if (sizeof(long unsigned int) != sizeof(long int))
    return -1;
  long unsigned int d = b - a;
  return d >= 5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x5,-0x18(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    %rdi,%rsi
xor    %eax,%eax
cmp    $0x11,%rsi
setae  %al
ret

LLVM IR (-O0):
define i32 @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %6 to i64
%9 = ptrtoint i32* %7 to i64
%10 = sub i64 %8, %9
%11 = sdiv exact i64 %10, 4
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = icmp uge i64 %12, 5
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32* %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = ptrtoint i32* %0 to i64
%5 = sub i64 %3, %4
%6 = icmp ugt i64 %5, 16
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned int call_notify(unsigned int descriptor, unsigned int event,
                         unsigned int count, void *data) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @call_notify(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
ret i32 0
}

LLVM IR (-O2):
define i32 @call_notify(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void smtp_send_data(int sock, char *strout) {
  write(sock, strout, strlen(strout));
}


x86 assembly (clang, -O0):
<smtp_send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_send_data>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @smtp_send_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @smtp_send_data(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int, int);
int main(void) { bar(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @bar(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LSR_();
int /*<<< orphan*/ c64_memZero();
void LSR_zp(void) {
  c64_memZero();
  LSR_();
}


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

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

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

LLVM IR (-O2):
define void @LSR_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @LSR_()
ret void
}
int test_imm_D7uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xD7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D7uint64_midword_reg>:
test   $0xd70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D7uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14090240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo196(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo196(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printFlags();
int /*<<< orphan*/ printHeapPointer();
int /*<<< orphan*/ printProgramCounter();
int /*<<< orphan*/ printRegister0();
int /*<<< orphan*/ printRegister1();
int /*<<< orphan*/ printf(char *);
void dumpCPU() {
  printf("\nCPU Contents:\n");
  printf("-------------\n");
  printRegister0();
  printRegister1();
  printProgramCounter();
  printHeapPointer();
  printFlags();
  printf("\n");
}


x86 assembly (clang, -O0):
<dumpCPU>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <printRegister0@plt>
mov    $0x0,%al
call   1060 <printRegister1@plt>
mov    $0x0,%al
call   1040 <printProgramCounter@plt>
mov    $0x0,%al
call   1080 <printHeapPointer@plt>
mov    $0x0,%al
call   1070 <printFlags@plt>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpCPU>:
push   %rax
lea    0xe88(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <printRegister0@plt>
xor    %eax,%eax
call   1070 <printRegister1@plt>
xor    %eax,%eax
call   1060 <printProgramCounter@plt>
xor    %eax,%eax
call   1090 <printHeapPointer@plt>
xor    %eax,%eax
call   1080 <printFlags@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0ACPU Contents:\0A\00"
@.str.1 = [15 x i8] c"-------------\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dumpCPU() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @printRegister0()
%4 = call i32 (...) @printRegister1()
%5 = call i32 (...) @printProgramCounter()
%6 = call i32 (...) @printHeapPointer()
%7 = call i32 (...) @printFlags()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"\0ACPU Contents:\00"
@str.3 = [14 x i8] c"-------------\00"
define void @dumpCPU() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (...) @printRegister0()
%4 = tail call i32 (...) @printRegister1()
%5 = tail call i32 (...) @printProgramCounter()
%6 = tail call i32 (...) @printHeapPointer()
%7 = tail call i32 (...) @printFlags()
%8 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int introduction() {
  printf("Welcome to the Craps Table\n");
  printf("Rules:\n");
  printf("1. Roll 2-dice\n");
  printf("2. Win if the sum of 2-dice is a 7 or 11\n");
  printf("3. Lose if the sum is 2, 3, or 12\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Welcome to the Craps Table\0A\00"
@.str.1 = [8 x i8] c"Rules:\0A\00"
@.str.2 = [16 x i8] c"1. Roll 2-dice\0A\00"
@.str.3 = [42 x i8] c"2. Win if the sum of 2-dice is a 7 or 11\0A\00"
@.str.4 = [36 x i8] c"3. Lose if the sum is 2, 3, or 12\0A\0A\00"
define i32 @introduction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Welcome to the Craps Table\00"
@str.5 = [7 x i8] c"Rules:\00"
@str.6 = [15 x i8] c"1. Roll 2-dice\00"
@str.7 = [41 x i8] c"2. Win if the sum of 2-dice is a 7 or 11\00"
@str.8 = [35 x i8] c"3. Lose if the sum is 2, 3, or 12\0A\00"
define i32 @introduction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex16array(char *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<lookcomplex16array>:
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex16array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookcomplex16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ mem;

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ tree_set_parent(void *, void *);
void *tree_zmalloc_init(void *mem, void *parent) {
  if (!mem)
    return NULL;
  memset(mem, 0, (sizeof(void *) * 3));
  mem = (void *)((void **)(mem) + 3);
  tree_set_parent(mem, parent);
  return mem;
}


x86 assembly (clang, -O0):
<tree_zmalloc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <tree_zmalloc_init+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1179 <tree_zmalloc_init+0x59>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <tree_set_parent@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_zmalloc_init>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114c <tree_zmalloc_init+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
add    $0x18,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <tree_set_parent@plt>
jmp    114e <tree_zmalloc_init+0x2e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @tree_zmalloc_init(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 0, i32 24)
%6 = getelementptr inbounds i8, i8* %0, i64 24
%7 = tail call i32 @tree_set_parent(i8* %6, i8* %1)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %9
}
int main() {
  int arr1[5] = {1, 2, 3, 4, 5};
  int arr2[5] = {5, 6, 7, 8, 9};
  int i = 0;
  arr1[0] = arr2[0];
  arr1[1] = arr2[1];
  arr1[2] = arr2[2];
  arr1[3] = arr2[3];
  arr1[4] = arr2[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xef6(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xef3(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xef1(%rip),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.arr2 = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
store i32 0, i32* %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32 %7, i32* %8
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
store i32 %13, i32* %14
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
%16 = load i32, i32* %15
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
store i32 %16, i32* %17
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
%19 = load i32, i32* %18
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 %19, i32* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void smbus_write_byte(unsigned device, unsigned address, unsigned char val) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @smbus_write_byte(i32 %0, i32 %1, i8 zeroext %2) {
ret void
}