xunge/DecIR huggingface dataset:
void print_str(const char x[1]) { printf("%s", x); }


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

x86 assembly (clang, -O2):
<print_str>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_str(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void save_hi_score() {}


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

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

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

LLVM IR (-O2):
define void @save_hi_score() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_atof();
int /*<<< orphan*/ test_atoi();
int main(void) {
  test_atoi();
  test_atof();
  printf("PASS\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_atoi@plt>
mov    $0x0,%al
call   1030 <test_atof@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = call i32 (...) @test_atoi()
%2 = call i32 (...) @test_atof()
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @test_atoi()
%2 = tail call i32 (...) @test_atof()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__float128 from_uns_char_load_n(unsigned char *a, long n) {
  return (__float128)a[n];
}


x86 assembly (clang, -O0):
<from_uns_char_load_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<from_uns_char_load_n>:
push   %rax
movzbl (%rdi,%rsi,1),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_uns_char_load_n(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = uitofp i8 %8 to fp128
ret fp128 %9
}

LLVM IR (-O2):
define fp128 @from_uns_char_load_n(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = uitofp i8 %4 to fp128
ret fp128 %5
}
/* Variables and functions */
char *prefixParser(char *, char *, char *, char *);
char *unigeneGenbankParser(char *header) {
  return prefixParser(header, " ", "/gb=", "unigeneGenbankParser");
}


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

x86 assembly (clang, -O2):
<unigeneGenbankParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rdx
lea    0xee2(%rip),%rcx
jmp    1030 <prefixParser@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"/gb=\00"
@.str.2 = [21 x i8] c"unigeneGenbankParser\00"
define i8* @unigeneGenbankParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @prefixParser(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"/gb=\00"
@.str.2 = [21 x i8] c"unigeneGenbankParser\00"
define i8* @unigeneGenbankParser(i8* %0) {
%2 = tail call i8* @prefixParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i8* %2
}
int close(int fd) {
  int r;
  __asm__ __volatile__("\tint $0x80\n" : "=a"(r) : "a"(6), "b"(fd) : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x6,%eax
int    $0x80
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
mov    $0x6,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 6, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 6, i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ snprintf_s(char *, int, char const *, char const *);
void printf_s(const char *fmt, const char *s) {
  char buf[200];
  snprintf_s(buf, 200, fmt, s);
  puts(buf);
}


x86 assembly (clang, -O0):
<printf_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xc8,%esi
call   1030 <snprintf_s@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <puts@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_s>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1030 <snprintf_s@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @printf_s(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf_s(i8* %6, i32 200, i8* %7, i8* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret void
}

LLVM IR (-O2):
define void @printf_s(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf_s(i8* %4, i32 200, i8* %0, i8* %1)
%6 = call i32 @puts(i8* %4)
ret void
}
void av_frame_unref() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_unref() {
ret void
}
void __foreach(void *user_data, const void *key) { printf("[%s]\n", key); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
define void @__foreach(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RADIO_SFD_PIN() { return 0x01 & (inp_emulate(-2) >> 4); }


x86 assembly (clang, -O0):
<TOSH_READ_RADIO_SFD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffe,%edi
call   1030 <inp_emulate@plt>
sar    $0x4,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RADIO_SFD_PIN>:
push   %rax
mov    $0xfffffffe,%edi
call   1030 <inp_emulate@plt>
shr    $0x4,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RADIO_SFD_PIN() {
%1 = call i32 @inp_emulate(i32 -2)
%2 = ashr i32 %1, 4
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RADIO_SFD_PIN() {
%1 = tail call i32 @inp_emulate(i32 -2)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 4
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sighup_handler(int signo) {
  syslog(LOG_INFO, "Got SIGHUP, rehashing...\n");
}


x86 assembly (clang, -O0):
<sighup_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup_handler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Got SIGHUP, rehashing...\0A\00"
define void @sighup_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"Got SIGHUP, rehashing...\0A\00"
define void @sighup_handler(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t readb(void *a) {
  uint8_t *p = a;
  return *p;
}


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

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

LLVM IR (-O0):
define i32 @readb(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @readb(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_tc_printf();
int main(int argc, char *argv[]) { test_tc_printf(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_tc_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_tc_printf()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_success(void) {
  printf("  <h1>System Administration</h1>\n"
         "  <ul>\n"
         "   <li><a href=\"viewinv.pl\">View Inventory</a></li>\n"
         "   <li><a href=\"\">Edit Users</a></li>\n"
         "   <li><a href=\"index.html\">Return to Home Page</a></li>\n"
         "  </ul>\n");
}


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

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

LLVM IR (-O0):
@.str = [196 x i8] c" <h1>System Administration</h1>\0A <ul>\0A <li><a href=\22viewinv.pl\22>View Inventory</a></li>\0A <li><a href=\22\22>Edit Users</a></li>\0A <li><a href=\22index.html\22>Return to Home Page</a></li>\0A </ul>\0A\00"
define void @print_success() {
%1 = call i32 @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [195 x i8] c" <h1>System Administration</h1>\0A <ul>\0A <li><a href=\22viewinv.pl\22>View Inventory</a></li>\0A <li><a href=\22\22>Edit Users</a></li>\0A <li><a href=\22index.html\22>Return to Home Page</a></li>\0A </ul>\00"
define void @print_success() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ata_get_string(unsigned char const *, int, int, char *);
void ata_get_ata_identify_serial_number(const unsigned char *buf, char *out) {
  ata_get_string(buf, 10, 19, out);
}


x86 assembly (clang, -O0):
<ata_get_ata_identify_serial_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xa,%esi
mov    $0x13,%edx
call   1030 <ata_get_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_get_ata_identify_serial_number>:
mov    %rsi,%rcx
mov    $0xa,%esi
mov    $0x13,%edx
jmp    1030 <ata_get_string@plt>

LLVM IR (-O0):
define void @ata_get_ata_identify_serial_number(i8* %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 = call i32 @ata_get_string(i8* %5, i32 10, i32 19, i8* %6)
ret void
}

LLVM IR (-O2):
define void @ata_get_ata_identify_serial_number(i8* %0, i8* %1) {
%3 = tail call i32 @ata_get_string(i8* %0, i32 10, i32 19, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insecure_getrandom_buf(void *, int);
void arc4random_buf(void *auth, int len) {
  int ret;
  insecure_getrandom_buf(auth, len);
}


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

x86 assembly (clang, -O2):
<arc4random_buf>:
jmp    1030 <insecure_getrandom_buf@plt>

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

LLVM IR (-O2):
define void @arc4random_buf(i8* %0, i32 %1) {
%3 = tail call i32 @insecure_getrandom_buf(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct mibinfo {
  int dummy;
};

/* Variables and functions */
int format(char *, char *, size_t, void const *, size_t);
int hex32_format(struct mibinfo *m, const void *data, size_t data_size,
                 char *buf, size_t len) {
  return format("%4x ", buf, len, data, data_size);
}


x86 assembly (clang, -O0):
<hex32_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebd(%rip),%rdi
call   1030 <format@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex32_format>:
mov    %rdx,%r9
mov    %rsi,%rax
lea    0xee3(%rip),%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %rax,%rcx
mov    %r9,%r8
jmp    1030 <format@plt>

LLVM IR (-O0):
%struct.mibinfo = type { i32 }
@.str = [5 x i8] c"%4x \00"
define i32 @hex32_format(%struct.mibinfo* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca %struct.mibinfo*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store %struct.mibinfo* %0, %struct.mibinfo** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %9
%12 = load i64, i64* %10
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.mibinfo = type { i32 }
@.str = [5 x i8] c"%4x \00"
define i32 @hex32_format(%struct.mibinfo* nocapture readnone %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %4, i8* %1, i64 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sys_reset(void) { exit(0); }


x86 assembly (clang, -O0):
<sys_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sys_reset>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sys_reset() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sys_reset() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
void swap4(void *num) {
  char t, *p;
  p = (char *)num;
  t = *p;
  *p = *(p + 3);
  *(p + 3) = t;
  t = *(p + 1);
  *(p + 1) = *(p + 2);
  *(p + 2) = t;
}


x86 assembly (clang, -O0):
<swap4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap4>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @swap4(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
store i8 %7, i8* %3
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
store i8 %10, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 %12, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %3
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %3
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @swap4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void setBgcolor(int a) {
  printf("\033[1;%dm", a);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<setBgcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBgcolor>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;%dm\00"
@stdout = global i32 0
define void @setBgcolor(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int thermal_iio_sensor_register(struct thermal_zone_device *tz) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.thermal_zone_device = type opaque
define i32 @thermal_iio_sensor_register(%struct.thermal_zone_device* nocapture readnone %0) {
ret i32 0
}
_Complex long long cplx4(long long r) { return r + 2i; }


x86 assembly (clang, -O0):
<cplx4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x2,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cplx4>:
mov    %rdi,%rax
mov    $0x2,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @cplx4(i64 %0) {
%2 = alloca { i64, i64 }
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add i64 %4, 0
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %2, i32 0, i32 0
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %2, i32 0, i32 1
store i64 %5, i64* %6
store i64 2, i64* %7
%8 = load { i64, i64 }, { i64, i64 }* %2
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @cplx4(i64 %0) {
%2 = insertvalue { i64, i64 } poison, i64 %0, 0
%3 = insertvalue { i64, i64 } %2, i64 2, 1
ret { i64, i64 } %3
}
/* Variables and functions */
int /*<<< orphan*/ SCIprintf(char *, int, ...);
void test_func(int n) {
  int depth;
  depth = n;
  SCIprintf("test_func(): depth=%d, &depth=%0Xh\n", depth, &depth);
  if (depth < 8) {
    test_func(depth + 1);
  }
  SCIprintf("return, depth=%d\n", depth);
}


x86 assembly (clang, -O0):
<test_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <SCIprintf@plt>
cmpl   $0x8,-0x8(%rbp)
jge    115b <test_func+0x3b>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1040 <test_func@plt>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <SCIprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <SCIprintf@plt>
mov    0x4(%rsp),%esi
cmp    $0x7,%esi
jg     1151 <test_func+0x31>
add    $0x1,%esi
mov    %esi,%edi
call   1040 <test_func@plt>
mov    0x4(%rsp),%esi
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <SCIprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"test_func(): depth=%d, &depth=%0Xh\0A\00"
@.str.1 = [18 x i8] c"return, depth=%d\0A\00"
define void @test_func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i8*, i32, ...) @SCIprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) @SCIprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"test_func(): depth=%d, &depth=%0Xh\0A\00"
@.str.1 = [18 x i8] c"return, depth=%d\0A\00"
define void @test_func(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 %0, i32* %2
%4 = call i32 (i8*, i32, ...) @SCIprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = add nsw i32 %5, 1
%9 = load i32, i32* %2
br label %10
10: ; preds = %7, %1
%11 = phi i32 [ %9, %7 ], [ %5, %1 ]
%12 = call i32 (i8*, i32, ...) @SCIprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}
double subMean(int ns, double prevMean, double xj) {
  double nmin = ((double)ns) - 1;
  double nr = ((double)ns) / (nmin);
  return (nr * prevMean - (1.0 / nmin) * xj);
}


x86 assembly (clang, -O0):
<subMean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xeb8(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<subMean>:
cvtsi2sd %edi,%xmm2
movsd  0xef4(%rip),%xmm3
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
divsd  %xmm4,%xmm2
divsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @subMean(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fsub double %10, 1.000000e+00
store double %11, double* %7
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = load double, double* %7
%15 = fdiv double %13, %14
store double %15, double* %8
%16 = load double, double* %8
%17 = load double, double* %5
%18 = load double, double* %7
%19 = fdiv double 1.000000e+00, %18
%20 = load double, double* %6
%21 = fmul double %19, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %16, double %17, double %22)
ret double %23
}

LLVM IR (-O2):
define double @subMean(i32 %0, double %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = fadd double %4, -1.000000e+00
%6 = fdiv double %4, %5
%7 = fdiv double -1.000000e+00, %5
%8 = fmul double %7, %2
%9 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %8)
ret double %9
}
int LZ4_sizeofStreamStateHC(void) {
  return (4 * (1 << 15) + 2 * (1 << 16) + 56);
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262200
}

LLVM IR (-O2):
define i32 @LZ4_sizeofStreamStateHC() {
ret i32 262200
}
/* Variables and functions */
char *strrchr(char *, char);
char *cc_basename(char *file) {
  char *b;
  b = strrchr(file, '/');
  if (!b)
    return file;
  return b + 1;
}


x86 assembly (clang, -O0):
<cc_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <cc_basename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <cc_basename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cc_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @cc_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void irq_init() {
  (*(volatile uint32_t *)((0xe000e000 + 0x014)) = (((24 * 1000 * 1000) / 100)));
  (*(volatile uint32_t *)((0xe000e000 + 0x010)) =
       ((1 << 0) | (1 << 1) | (1 << 2)));
}


x86 assembly (clang, -O0):
<irq_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e014,%eax
movl   $0x3a980,(%rax)
mov    $0xe000e010,%eax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_init>:
mov    $0xe000e010,%eax
movl   $0x3a980,0x4(%rax)
movl   $0x7,(%rax)
ret

LLVM IR (-O0):
define void @irq_init() {
store volatile i32 240000, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @irq_init() {
store volatile i32 240000, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
void msrs_set(unsigned int msr, unsigned int low, unsigned int high) {
  __asm__ volatile("wrmsr" : : "a"(low), "d"(high), "c"(msr));
}


x86 assembly (clang, -O0):
<msrs_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%ecx
wrmsr
pop    %rbp
ret

x86 assembly (clang, -O2):
<msrs_set>:
mov    %esi,%eax
mov    %edi,%ecx
wrmsr
ret

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

LLVM IR (-O2):
define void @msrs_set(i32 %0, i32 %1, i32 %2) {
tail call void asm sideeffect "wrmsr", "{ax},{dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %2, i32 %0)
ret void
}
unsigned char x86_64_cmos_read(unsigned char addr) {
  unsigned char ret;
  x86_64_outb(0x70, addr);
  asm volatile("jmp 1f; 1: jmp 1f; 1:");
  ret = x86_64_inb(0x71);
  asm volatile("jmp 1f; 1: jmp 1f; 1:");
  return ret;
}


x86 assembly (clang, -O0):
<x86_64_cmos_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
mov    $0x70,%edi
mov    $0x0,%al
call   1040 <x86_64_outb@plt>
jmp    1143 <x86_64_cmos_read+0x23>
jmp    1148 <x86_64_cmos_read+0x28>
mov    $0x71,%edi
mov    $0x0,%al
call   1030 <x86_64_inb@plt>
mov    %al,-0x2(%rbp)
jmp    115c <x86_64_cmos_read+0x3c>
jmp    1161 <x86_64_cmos_read+0x41>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_64_cmos_read>:
push   %rax
mov    %edi,%esi
mov    $0x70,%edi
xor    %eax,%eax
call   1040 <x86_64_outb@plt>
jmp    1131 <x86_64_cmos_read+0x11>
jmp    1133 <x86_64_cmos_read+0x13>
mov    $0x71,%edi
xor    %eax,%eax
call   1030 <x86_64_inb@plt>
jmp    1141 <x86_64_cmos_read+0x21>
jmp    1143 <x86_64_cmos_read+0x23>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @x86_64_cmos_read(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %5)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @x86_64_inb to i32 (i32, ...)*)(i32 113)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @x86_64_cmos_read(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %2)
tail call void asm sideeffect "jmp 1f; 1: jmp 1f; 1:", "~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @x86_64_inb to i32 (i32, ...)*)(i32 113)
%5 = trunc i32 %4 to i8
tail call void asm sideeffect "jmp 1f; 1: jmp 1f; 1:", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %5
}
cucheck() {}


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

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

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

LLVM IR (-O2):
define i32 @cucheck() {
ret i32 undef
}
void hoge() {}


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

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

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

LLVM IR (-O2):
define void @hoge() {
ret void
}
int SRecvmsg(int sfd __attribute__((__unused__)),
             void *const msg __attribute__((__unused__)),
             int fl __attribute__((__unused__)),
             int tlen __attribute__((__unused__))) {
  ;
  ;
  ;
  ;
  return (-1);
}


x86 assembly (clang, -O0):
<SRecvmsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SRecvmsg(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void ls_lR(int i) {
  char cmd[100];
  sprintf(cmd, "./ls_lR.sh %03d", i);
}


x86 assembly (clang, -O0):
<ls_lR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_lR>:
sub    $0x68,%rsp
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rsp,%rdi
call   1030 <sprintf@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"./ls_lR.sh %03d\00"
define void @ls_lR(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"./ls_lR.sh %03d\00"
define void @ls_lR(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void yield(void) { __asm__ __volatile__("int $0x40" ::"a"(68), "b"(1)); }


x86 assembly (clang, -O0):
<yield>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x44,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<yield>:
push   %rbx
mov    $0x44,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @yield() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 1)
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int64_t timespec_to_msec(const struct timespec *a) {
  return (int64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<timespec_to_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_msec>:
imul   $0x3e8,0x8(%rdi),%ecx
movslq (%rdi),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @timespec_to_msec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000000
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @timespec_to_msec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000000
%9 = add nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ error(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int open_listener_sockert() {
  int s = socket(PF_INET, SOCK_STREAM, 0);
  if (s == -1) {
    error("Can't open socket");
  }
  return s;
}


x86 assembly (clang, -O0):
<open_listener_sockert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    115a <open_listener_sockert+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_listener_sockert>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114d <open_listener_sockert+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"Can't open socket\00"
define i32 @open_listener_sockert() {
%1 = alloca i32
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"Can't open socket\00"
define i32 @open_listener_sockert() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_num_name(int);
int main(int argc, char *argv[]) {
  print_num_name(10);
  print_num_name(121);
  print_num_name(1032);
  print_num_name(11043);
  print_num_name(1200000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1030 <print_num_name@plt>
mov    $0x79,%edi
call   1030 <print_num_name@plt>
mov    $0x408,%edi
call   1030 <print_num_name@plt>
mov    $0x2b23,%edi
call   1030 <print_num_name@plt>
mov    $0x124f80,%edi
call   1030 <print_num_name@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <print_num_name@plt>
mov    $0x79,%edi
call   1030 <print_num_name@plt>
mov    $0x408,%edi
call   1030 <print_num_name@plt>
mov    $0x2b23,%edi
call   1030 <print_num_name@plt>
mov    $0x124f80,%edi
call   1030 <print_num_name@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @print_num_name(i32 10)
%7 = call i32 @print_num_name(i32 121)
%8 = call i32 @print_num_name(i32 1032)
%9 = call i32 @print_num_name(i32 11043)
%10 = call i32 @print_num_name(i32 1200000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_num_name(i32 10)
%4 = tail call i32 @print_num_name(i32 121)
%5 = tail call i32 @print_num_name(i32 1032)
%6 = tail call i32 @print_num_name(i32 11043)
%7 = tail call i32 @print_num_name(i32 1200000)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ReadUint32(uint8_t *buffer) {
  uint32_t num = (uint32_t)buffer[0] << 24 | (uint32_t)buffer[1] << 16 |
                 (uint32_t)buffer[2] << 8 | (uint32_t)buffer[3];
  return num;
}


x86 assembly (clang, -O0):
<ReadUint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadUint32>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ReadUint32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_x(void *_p) { return (int)((XSizeHints *)_p)->x; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int main(int argc, char **argv) {
  int i = 0;
  while (1) {
    int tooLong = 0;
    while (i <= argc) {
      if (i == argc) {
        tooLong = 1;
      }
    }
    if (tooLong)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1144 <main+0x44>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113f <main+0x3f>
movl   $0x1,-0x18(%rbp)
jmp    1120 <main+0x20>
cmpl   $0x0,-0x18(%rbp)
je     1153 <main+0x53>
jmp    1158 <main+0x58>
jmp    1119 <main+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 0
br label %4
4: ; preds = %4, %2
br label %4
}
int init(int hup) {
  if (!hup) {
  }
  return (0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1116 <init+0x16>
jmp    1116 <init+0x16>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @init(i32 %0) {
ret i32 0
}