xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ SHA1(char *, size_t, unsigned char *);
int SHA_DIGEST_LENGTH;
int main() {
  char data[] = "Hello, world!";
  size_t length = sizeof(data);
  unsigned char hash[SHA_DIGEST_LENGTH];
  SHA1(data, length, hash);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movabs $0x21646c726f7720,%rax
mov    %rax,-0xa(%rbp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,-0x10(%rbp)
movq   $0xe,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%rsp
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <SHA1@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
movabs $0x21646c726f7720,%rax
mov    %rax,-0x12(%rbp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rdx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
lea    -0x18(%rbp),%rdi
mov    $0xe,%esi
call   1030 <SHA1@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.data = [14 x i8] c"Hello, world!\00"
@SHA_DIGEST_LENGTH = global i32 0
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast [14 x i8]* %1 to i8*
store i64 14, i64* %2
%6 = load i32, i32* @SHA_DIGEST_LENGTH
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%11 = load i64, i64* %2
%12 = call i32 @SHA1(i8* %10, i64 %11, i8* %9)
%13 = load i8*, i8** %3
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [14 x i8] c"Hello, world!\00"
@SHA_DIGEST_LENGTH = global i32 0
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @SHA_DIGEST_LENGTH
%4 = zext i32 %3 to i64
%5 = tail call i8* @llvm.stacksave()
%6 = alloca i8, i64 %4
%7 = call i32 @SHA1(i8* %2, i64 14, i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stu__cc(int);
int stu__off();
int stu__cc2(int a, int b) {
  stu__cc(a);
  stu__cc(b);
  return stu__off() - 2;
}


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

x86 assembly (clang, -O2):
<stu__cc2>:
push   %rbx
mov    %esi,%ebx
call   1030 <stu__cc@plt>
mov    %ebx,%edi
call   1030 <stu__cc@plt>
xor    %eax,%eax
call   1040 <stu__off@plt>
add    $0xfffffffe,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @stu__cc2(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 @stu__cc(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @stu__cc(i32 %7)
%9 = call i32 (...) @stu__off()
%10 = sub nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @stu__cc2(i32 %0, i32 %1) {
%3 = tail call i32 @stu__cc(i32 %0)
%4 = tail call i32 @stu__cc(i32 %1)
%5 = tail call i32 (...) @stu__off()
%6 = add nsw i32 %5, -2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void handle_sigchld(int x) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<handle_sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <handle_sigchld+0x31>
jmp    111b <handle_sigchld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigchld>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <handle_sigchld+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
int ide_do_packet_command_pio(char *, char *, int);
int ide_read_status(char *buf, int length, int type) {
  char cmd[12] = {0x40, 0, 0, 0, 0xFF, 0, 0, 0, 0, 0, 0, 0};
  cmd[1] = type;
  return ide_do_packet_command_pio(cmd, buf, length);
}


x86 assembly (clang, -O0):
<ide_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x1b(%rbp)
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_status>:
sub    $0x18,%rsp
mov    %esi,%eax
mov    %rdi,%rsi
movabs $0xff00000040,%rcx
mov    %rcx,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    %dl,0x9(%rsp)
lea    0x8(%rsp),%rdi
mov    %eax,%edx
call   1030 <ide_do_packet_command_pio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.ide_read_status.cmd = [12 x i8] c"@\00\00\00\FF\00\00\00\00\00\00\00"
define i32 @ide_read_status(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [12 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast [12 x i8]* %7 to i8*
%9 = load i32, i32* %6
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 1
store i8 %10, i8* %11
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i32 @ide_do_packet_command_pio(i8* %12, i8* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@__const.ide_read_status.cmd = [12 x i8] c"@\00\00\00\FF\00\00\00\00\00\00\00"
define i32 @ide_read_status(i8* %0, i32 %1, i32 %2) {
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%6 = trunc i32 %2 to i8
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 1
store i8 %6, i8* %7
%8 = call i32 @ide_do_packet_command_pio(i8* %5, i8* %0, i32 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clog_init();
void CLOG_INIT_(void) { clog_init(); }


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

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

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

LLVM IR (-O2):
define void @CLOG_INIT_() {
%1 = tail call i32 (...) @clog_init()
ret void
}
void inner(void) {}


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

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

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

LLVM IR (-O2):
define void @inner() {
ret void
}
void X509_STORE_CTX_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_CTX_cleanup() {
ret void
}
void __bitmap_weight(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__bitmap_weight>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bitmap_weight>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__bitmap_weight = [16 x i8] c"__bitmap_weight\00"
define void @__bitmap_weight() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.__bitmap_weight, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__bitmap_weight = [16 x i8] c"__bitmap_weight\00"
define void @__bitmap_weight() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.__bitmap_weight, i64 0, i64 0))
ret void
}
int getdtablesize() { return 32; }


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

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

LLVM IR (-O0):
define i32 @getdtablesize() {
ret i32 32
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__0__Out__set();
void LedsP__Led0__set(void) { ReverseGPIOP__0__Out__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__set() {
%1 = tail call i32 (...) @ReverseGPIOP__0__Out__set()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *n) {
  printf("usage: %s -s SERVERADDRESS -v VOLUME -u USER -p PASSWORD\n", n);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"usage: %s -s SERVERADDRESS -v VOLUME -u USER -p PASSWORD\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [58 x i8] c"usage: %s -s SERVERADDRESS -v VOLUME -u USER -p PASSWORD\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void keystroke_(ierr, result, length) char *result;
int *ierr, length;
{ *ierr = read(0, result, 1); }


x86 assembly (clang, -O0):
<keystroke_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keystroke_>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <read@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @keystroke_(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 0, i8* %7, i32 1)
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @keystroke_(i32* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 0, i8* %1, i32 1)
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BigBuf_get_EM_addr();
int /*<<< orphan*/ memset(int /*<<< orphan*/, int /*<<< orphan*/, int);
void BigBuf_Clear_EM(void) { memset(BigBuf_get_EM_addr(), 0, 4096); }


x86 assembly (clang, -O0):
<BigBuf_Clear_EM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <BigBuf_get_EM_addr@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigBuf_Clear_EM>:
push   %rax
xor    %eax,%eax
call   1040 <BigBuf_get_EM_addr@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x1000,%edx
pop    %rax
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @BigBuf_Clear_EM() {
%1 = call i32 (...) @BigBuf_get_EM_addr()
%2 = call i32 @memset(i32 %1, i32 0, i32 4096)
ret void
}

LLVM IR (-O2):
define void @BigBuf_Clear_EM() {
%1 = tail call i32 (...) @BigBuf_get_EM_addr()
%2 = tail call i32 @memset(i32 %1, i32 0, i32 4096)
ret void
}
void TimerOC2PreloadConfigure(unsigned long ulBase, unsigned long ulOCPreload) {
  unsigned long ulTempccmr1 = 0;

  ;

  ;
  ulTempccmr1 = (*((volatile unsigned long *)(ulBase + 0x00000018)));
  ulTempccmr1 &= ~0x00000800;
  ulTempccmr1 |= (ulOCPreload << 8);
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = ulTempccmr1;
}


x86 assembly (clang, -O0):
<TimerOC2PreloadConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffff7ff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC2PreloadConfigure>:
mov    $0xfffffffffffff7ff,%rax
and    0x18(%rdi),%rax
shl    $0x8,%rsi
or     %rax,%rsi
mov    %rsi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC2PreloadConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -2049
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = shl i64 %12, 8
%14 = load i64, i64* %5
%15 = or i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = add i64 %17, 24
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @TimerOC2PreloadConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 24
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -2049
%7 = shl i64 %1, 8
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
void security_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @security_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
vdiqrs() {}


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

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

LLVM IR (-O0):
define i32 @vdiqrs() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdiqrs() {
ret i32 undef
}
int _zstr(const char *s) { return !s || *s == '\0'; }


x86 assembly (clang, -O0):
<_zstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <_zstr+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zstr>:
test   %rdi,%rdi
je     110e <_zstr+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_zstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_zstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
void foo7e() {}


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

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

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

LLVM IR (-O2):
define void @foo7e() {
ret void
}
void XSetState() {}


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

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

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

LLVM IR (-O2):
define void @XSetState() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  long long unsigned int n;
  n = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1;
  printf("10!=%lli\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x375f00,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"10!=%lli\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 3628800)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, res;
  printf("\nEnter a number : ");
  scanf("%d", &num);
  printf("\nHere are the numbers from 0 to %d: ", num);
  print(num);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0AHere are the numbers from 0 to %d: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @print(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0AHere are the numbers from 0 to %d: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @print(i32 %7)
ret i32 0
}
__attribute__((always_)) const double rintk(double x) {
  return x < 0 ? (int)(x - 0.5) : (int)(x + 0.5);
}


x86 assembly (clang, -O0):
<rintk>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1134 <rintk+0x34>
movsd  -0x8(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <rintk+0x48>
movsd  0xec4(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintk>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @rintk(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fsub double %6, 5.000000e-01
%8 = fptosi double %7 to i32
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
%15 = sitofp i32 %14 to double
ret double %15
}

LLVM IR (-O2):
define double @rintk(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, unsigned char *, int);
int mp_hal_stdin_rx_chr(void) {
  unsigned char c = 0;
  int r = read(STDIN_FILENO, &c, 1);
  (void)r;
  return c;
}


x86 assembly (clang, -O0):
<mp_hal_stdin_rx_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_hal_stdin_rx_chr>:
push   %rax
movb   $0x0,0x7(%rsp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @mp_hal_stdin_rx_chr() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %1, i32 1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @mp_hal_stdin_rx_chr() {
%1 = alloca i8
store i8 0, i8* %1
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ flu64_do_encode(char *, int, char *);
int strlen(char *);
char *flu64_encode(char *in, ssize_t l) {
  if ((int)l == -1)
    l = strlen(in);
  char *out = calloc(l * 2, sizeof(char));
  flu64_do_encode(in, l, out);
  return out;
}


x86 assembly (clang, -O0):
<flu64_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1155 <flu64_encode+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <flu64_do_encode@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu64_encode>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
cmp    $0xffffffff,%esi
jne    114b <flu64_encode+0x1b>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    (%r15,%r15,1),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1050 <flu64_do_encode@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @flu64_encode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, 2
%14 = call i8* @calloc(i32 %13, i32 1)
store i8* %14, i8** %5
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = load i8*, i8** %5
%18 = call i32 @flu64_do_encode(i8* %15, i32 %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @flu64_encode(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
%8 = shl nsw i32 %7, 1
%9 = tail call i8* @calloc(i32 %8, i32 1)
%10 = tail call i32 @flu64_do_encode(i8* %0, i32 %7, i8* %9)
ret i8* %9
}
/* Variables and functions */
char *EncodeHttp(char const *, int, int /*<<< orphan*/);
char *urlize(const char *z, int n) { return EncodeHttp(z, n, 0); }


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

x86 assembly (clang, -O2):
<urlize>:
xor    %edx,%edx
jmp    1030 <EncodeHttp@plt>

LLVM IR (-O0):
define i8* @urlize(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 = call i8* @EncodeHttp(i8* %5, i32 %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @urlize(i8* %0, i32 %1) {
%3 = tail call i8* @EncodeHttp(i8* %0, i32 %1, i32 0)
ret i8* %3
}
void rb_dispose_float(float *obj_val) {
  if (obj_val) {
    *obj_val = 0.0;
  }
}


x86 assembly (clang, -O0):
<rb_dispose_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111e <rb_dispose_float+0x1e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_dispose_float>:
test   %rdi,%rdi
je     110b <rb_dispose_float+0xb>
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @rb_dispose_float(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = icmp ne float* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float*, float** %2
store float 0.000000e+00, float* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @rb_dispose_float(float* writeonly %0) {
%2 = icmp eq float* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store float 0.000000e+00, float* %0
br label %4
4: ; preds = %3, %1
ret void
}
/* Type definitions */
struct page {
  int dummy;
};
struct address_space {
  int dummy;
};

/* Variables and functions */
struct page *alloc_pages_node(int /*<<< orphan*/, int, int /*<<< orphan*/);
int mapping_gfp_mask(struct address_space *);
__attribute__((always_)) struct page *
page_cache_alloc_cold(struct address_space *x) {
  return alloc_pages_node(((0)), mapping_gfp_mask(x) | 0x100u | 0x20000u, 0);
}


x86 assembly (clang, -O0):
<page_cache_alloc_cold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mapping_gfp_mask@plt>
mov    %eax,%esi
or     $0x100,%esi
or     $0x20000,%esi
xor    %edx,%edx
mov    %edx,%edi
call   1040 <alloc_pages_node@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_cache_alloc_cold>:
push   %rax
call   1030 <mapping_gfp_mask@plt>
or     $0x20100,%eax
xor    %edi,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <alloc_pages_node@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
%struct.address_space = type { i32 }
define %struct.page* @page_cache_alloc_cold(%struct.address_space* %0) {
%2 = alloca %struct.address_space*
store %struct.address_space* %0, %struct.address_space** %2
%3 = load %struct.address_space*, %struct.address_space** %2
%4 = call i32 @mapping_gfp_mask(%struct.address_space* %3)
%5 = or i32 %4, 256
%6 = or i32 %5, 131072
%7 = call %struct.page* @alloc_pages_node(i32 0, i32 %6, i32 0)
ret %struct.page* %7
}

LLVM IR (-O2):
%struct.page = type { i32 }
%struct.address_space = type { i32 }
define %struct.page* @page_cache_alloc_cold(%struct.address_space* %0) {
%2 = tail call i32 @mapping_gfp_mask(%struct.address_space* %0)
%3 = or i32 %2, 131328
%4 = tail call %struct.page* @alloc_pages_node(i32 0, i32 %3, i32 0)
ret %struct.page* %4
}
/* Type definitions */
struct traversal_algorithm {
  int dummy;
};
struct expr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ast_safe_free_el(struct expr_list *,
                                    struct traversal_algorithm *);
void optimize_safe_free_el(struct expr_list *ptr,
                           struct traversal_algorithm *algo) {
  (void)(algo);
  ast_safe_free_el(ptr, algo);
}


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

x86 assembly (clang, -O2):
<optimize_safe_free_el>:
jmp    1030 <ast_safe_free_el@plt>

LLVM IR (-O0):
%struct.expr_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
define void @optimize_safe_free_el(%struct.expr_list* %0, %struct.traversal_algorithm* %1) {
%3 = alloca %struct.expr_list*
%4 = alloca %struct.traversal_algorithm*
store %struct.expr_list* %0, %struct.expr_list** %3
store %struct.traversal_algorithm* %1, %struct.traversal_algorithm** %4
%5 = load %struct.traversal_algorithm*, %struct.traversal_algorithm** %4
%6 = load %struct.expr_list*, %struct.expr_list** %3
%7 = load %struct.traversal_algorithm*, %struct.traversal_algorithm** %4
%8 = call i32 @ast_safe_free_el(%struct.expr_list* %6, %struct.traversal_algorithm* %7)
ret void
}

LLVM IR (-O2):
%struct.expr_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
define void @optimize_safe_free_el(%struct.expr_list* %0, %struct.traversal_algorithm* %1) {
%3 = tail call i32 @ast_safe_free_el(%struct.expr_list* %0, %struct.traversal_algorithm* %1)
ret void
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ sleep(unsigned int);
int main(int argc, char *argv[]) {
  unsigned int s;
  if (argc >= 2) {
    s = atoi(argv[1]);
    sleep(s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1158 <main+0x38>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     113a <main+0x1a>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <sleep@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @sleep(i32 %14)
br label %16
16: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @sleep(i32 %7)
br label %9
9: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302- spring 2014\n");
  printf("Name: Natasha Moreira\n");
  printf("Date Created: %d/%d/%d\n", 1, 28, 14);
  printf("Assignment:Assignment 5");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0xe,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0xe,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Course: EG1302- spring 2014\0A\00"
@.str.1 = [23 x i8] c"Name: Natasha Moreira\0A\00"
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [24 x i8] c"Assignment:Assignment 5\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 14)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [24 x i8] c"Assignment:Assignment 5\00"
@str = [28 x i8] c"Course: EG1302- spring 2014\00"
@str.4 = [22 x i8] c"Name: Natasha Moreira\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 14)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct dvb_resource {
  int dummy;
};

/* Variables and functions */
int _dvbres_ok_retval(struct dvb_resource *, int /*<<< orphan*/);
int _dvbres_ok(struct dvb_resource *res) { return _dvbres_ok_retval(res, 0); }


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

x86 assembly (clang, -O2):
<_dvbres_ok>:
xor    %esi,%esi
jmp    1030 <_dvbres_ok_retval@plt>

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

LLVM IR (-O2):
%struct.dvb_resource = type { i32 }
define i32 @_dvbres_ok(%struct.dvb_resource* %0) {
%2 = tail call i32 @_dvbres_ok_retval(%struct.dvb_resource* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void _exit(int status) {
  status &= 0xff;
  abort();
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
store i32 %4, i32* %2
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *strcat(char *, char *);
char *test(char *s, char *c) {
  char *res = strcat(s, c);
  puts(res);
  return res;
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strcat(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @puts(i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @test(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i8* %0
}
int zero_centered_mod(int x, int L) {
  int half_L = L / 2;
  while (x > half_L)
    x -= L;
  while (x < -half_L)
    x += L;
  return x;
}


x86 assembly (clang, -O0):
<zero_centered_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1134 <zero_centered_mod+0x34>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <zero_centered_mod+0x18>
jmp    1139 <zero_centered_mod+0x39>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1157 <zero_centered_mod+0x57>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <zero_centered_mod+0x39>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_centered_mod>:
mov    %edi,%eax
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
sub    %esi,%eax
cmp    %ecx,%edx
jg     1110 <zero_centered_mod+0x10>
neg    %ecx
nopw   0x0(%rax,%rax,1)
add    %esi,%eax
cmp    %ecx,%eax
jl     1120 <zero_centered_mod+0x20>
ret

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

LLVM IR (-O2):
define i32 @zero_centered_mod(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %0, %2 ], [ %7, %4 ]
%6 = icmp sgt i32 %5, %3
%7 = sub nsw i32 %5, %1
br i1 %6, label %4, label %8
8: ; preds = %4
%9 = sub nsw i32 0, %3
br label %10
10: ; preds = %10, %8
%11 = phi i32 [ %13, %10 ], [ %5, %8 ]
%12 = icmp slt i32 %11, %9
%13 = add nsw i32 %11, %1
br i1 %12, label %10, label %14
14: ; preds = %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void shl_reg32_imm8(unsigned long reg32, unsigned char imm8) {
  put8(0xC1);
  put8(0xE0 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<shl_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc1,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
add    $0xe0,%rax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xc1,%edi
call   1030 <put8@plt>
add    $0xe0,%bl
movzbl %bl,%edi
call   1030 <put8@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shl_reg32_imm8(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -63)
%6 = load i64, i64* %3
%7 = add i64 224, %6
%8 = trunc i64 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @shl_reg32_imm8(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -63)
%4 = trunc i64 %0 to i8
%5 = add i8 %4, -32
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, void *, int);
void read_or_exit(int fd, void *buffer, int size) {
  int result = -1;
  errno = 0;
  result = read(fd, buffer, size);
  if (result < 0) {
    perror("Can't read");
    exit(9);
  }
}


x86 assembly (clang, -O0):
<read_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    0x2e90(%rip),%rax
movq   $0x0,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1189 <read_or_exit+0x59>
lea    0xe86(%rip),%rdi
call   1040 <perror@plt>
mov    $0x9,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_or_exit>:
push   %rax
mov    0x2ea8(%rip),%rax
movq   $0x0,(%rax)
call   1030 <read@plt>
test   %eax,%eax
js     114a <read_or_exit+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x9,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"Can't read\00"
define void @read_or_exit(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 -1, i32* %7
store i64 0, i64* @errno
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 9)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"Can't read\00"
define void @read_or_exit(i32 %0, i8* nocapture %1, i32 %2) {
store i64 0, i64* @errno
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 9)
unreachable
9: ; preds = %3
ret void
}
int do_282() { return 282; }


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

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

LLVM IR (-O0):
define i32 @do_282() {
ret i32 282
}

LLVM IR (-O2):
define i32 @do_282() {
ret i32 282
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgBlack(char *str) { return addColor("40", str); }


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

x86 assembly (clang, -O2):
<bgBlack>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"40\00"
define i8* @bgBlack(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ccc();
void bbb(void) { ccc(); }


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

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

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

LLVM IR (-O2):
define void @bbb() {
%1 = tail call i32 (...) @ccc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned short func_71(short p_72, signed char p_73, int *p_74, int p_75) {
  step_hash(84);
  return p_75;
}


x86 assembly (clang, -O0):
<func_71>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    $0x54,%edi
call   1030 <step_hash@plt>
mov    -0x14(%rbp),%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_71>:
push   %rbx
mov    %ecx,%ebx
mov    $0x54,%edi
call   1030 <step_hash@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @func_71(i16 signext %0, i8 signext %1, i32* %2, i32 %3) {
%5 = alloca i16
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i32
store i16 %0, i16* %5
store i8 %1, i8* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = call i32 @step_hash(i32 84)
%10 = load i32, i32* %8
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @func_71(i16 signext %0, i8 signext %1, i32* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @step_hash(i32 84)
%6 = trunc i32 %3 to i16
ret i16 %6
}