xunge/DecIR huggingface dataset:
int main(void) {
  int a[4][5] = {0};
  *(*a + 2 + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x [5 x i32]]
%2 = bitcast [4 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int /*<<< orphan*/);
int pit_read_remaining_ms() {
  register uint16_t ret = 0;
  outb(0x43, 0);
  ret = inb(0x40);
  ret |= inb(0x40) << 8;
  return ret;
}


x86 assembly (clang, -O0):
<pit_read_remaining_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x43,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
call   1040 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x40,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_read_remaining_ms>:
push   %rbx
mov    $0x43,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
mov    $0x40,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pit_read_remaining_ms() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @outb(i32 67, i32 0)
%3 = call i32 @inb(i32 64)
store i32 %3, i32* %1
%4 = call i32 @inb(i32 64)
%5 = shl i32 %4, 8
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @pit_read_remaining_ms() {
%1 = tail call i32 @outb(i32 67, i32 0)
%2 = tail call i32 @inb(i32 64)
%3 = tail call i32 @inb(i32 64)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int write(int, char *, int);
void send_server(int fd, char *buff) {
  int err;
  err = write(fd, buff, 32);
  if (err < 0) {
    printf("Error in write()\n Goodbye!!\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<send_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1173 <send_server+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_server>:
push   %rax
mov    $0x20,%edx
call   1040 <write@plt>
test   %eax,%eax
js     1141 <send_server+0x11>
pop    %rax
ret
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error in write()\0A Goodbye!!\0A\00"
define void @send_server(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @write(i32 %6, i8* %7, i32 32)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Error in write()\0A Goodbye!!\00"
define void @send_server(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 32)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}
void CompactionFilterV2Destroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @CompactionFilterV2Destroy(i8* nocapture %0) {
ret void
}
int i_greater(int *p1, int *p2) { return ((int)(*p1 - *p2)); }


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

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

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

LLVM IR (-O2):
define i32 @i_greater(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
void X509_get0_pubkey_bitstr(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_get0_pubkey_bitstr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ text_wrap();
void test_text_wrap() { text_wrap(); }


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

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

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

LLVM IR (-O2):
define void @test_text_wrap() {
%1 = tail call i32 (...) @text_wrap()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_remap(int);
void pic_setup(void) { pic_remap(0x20); }


x86 assembly (clang, -O0):
<pic_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <pic_remap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_setup>:
mov    $0x20,%edi
jmp    1030 <pic_remap@plt>

LLVM IR (-O0):
define void @pic_setup() {
%1 = call i32 @pic_remap(i32 32)
ret void
}

LLVM IR (-O2):
define void @pic_setup() {
%1 = tail call i32 @pic_remap(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCDcmd(int);
int /*<<< orphan*/ delay(int);
void LCDclear(void) {
  LCDcmd(0x01);
  delay(1000);
}


x86 assembly (clang, -O0):
<LCDclear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <LCDcmd@plt>
mov    $0x3e8,%edi
call   1040 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDclear>:
push   %rax
mov    $0x1,%edi
call   1030 <LCDcmd@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @LCDclear() {
%1 = call i32 @LCDcmd(i32 1)
%2 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @LCDclear() {
%1 = tail call i32 @LCDcmd(i32 1)
%2 = tail call i32 @delay(i32 1000)
ret void
}
int main(void) {
  double a = 42.9;
  double b = 0.9;
  double result = a - b;
  if (result > 41.9 && result < 42.1) {
    return 42;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xefd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116a <main+0x6a>
movsd  0xec5(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116a <main+0x6a>
movl   $0x2a,-0x4(%rbp)
jmp    1171 <main+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 4.290000e+01, double* %2
store double 9.000000e-01, double* %3
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fsub double %5, %6
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp ogt double %8, 4.190000e+01
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load double, double* %4
%12 = fcmp olt double %11, 4.210000e+01
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 42, i32* %1
br label %15
14: ; preds = %10, %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int strlen(char *);
int is_pointer_type(char *name) {
  if (name[strlen(name) - 1] == '*') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_pointer_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1152 <is_pointer_type+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1159 <is_pointer_type+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pointer_type>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x2a,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_pointer_type(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 42
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *data, size_t len) {
  void *ret = NULL;
  ret = malloc(len * sizeof(char));
  if (ret == NULL)
    return ret;
  memcpy(ret, data, len);
  return ret;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1161 <memdup+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <memdup+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
char *SelectLeftRight(int /*<<< orphan*/, char *, int /*<<< orphan*/, int);
char *QMSelectRight(int16_t fno, char *index_name, int16_t listno) {
  return SelectLeftRight(fno, index_name, listno, 45);
}


x86 assembly (clang, -O0):
<QMSelectRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x2d,%ecx
call   1030 <SelectLeftRight@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMSelectRight>:
mov    $0x2d,%ecx
jmp    1030 <SelectLeftRight@plt>

LLVM IR (-O0):
define i8* @QMSelectRight(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 i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @SelectLeftRight(i32 %7, i8* %8, i32 %9, i32 45)
ret i8* %10
}

LLVM IR (-O2):
define i8* @QMSelectRight(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @SelectLeftRight(i32 %0, i8* %1, i32 %2, i32 45)
ret i8* %4
}
/* Variables and functions */
int mus_write_1(int, int, int, int, int **, char *, int);
int mus_file_write_buffer(int charbuf_data_format, int beg, int end, int chans,
                          int **bufs, char *charbuf, int clipped) {
  return (mus_write_1(charbuf_data_format, beg, end, chans, bufs, charbuf,
                      clipped));
}


x86 assembly (clang, -O0):
<mus_file_write_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <mus_write_1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_write_buffer>:
jmp    1030 <mus_write_1@plt>

LLVM IR (-O0):
define i32 @mus_file_write_buffer(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i8* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32**
%13 = alloca i8*
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32** %4, i32*** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32**, i32*** %12
%20 = load i8*, i8** %13
%21 = load i32, i32* %14
%22 = call i32 @mus_write_1(i32 %15, i32 %16, i32 %17, i32 %18, i32** %19, i8* %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @mus_file_write_buffer(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i8* %5, i32 %6) {
%8 = tail call i32 @mus_write_1(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i8* %5, i32 %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void err(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int strlen(const char *s) {
  int len = 0;
  while (*s != '\0') {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
char *lassign(ldest, lsource)
unsigned *ldest, *lsource;
{
  *ldest++ = *lsource++;
  *ldest = *lsource;
  return (ldest);
}


x86 assembly (clang, -O0):
<lassign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lassign>:
mov    (%rsi),%ecx
lea    0x4(%rdi),%rax
mov    %ecx,(%rdi)
mov    0x4(%rsi),%ecx
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
define i8* @lassign(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %4
%7 = load i32, i32* %5
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %3
store i32 %7, i32* %8
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32*, i32** %3
%14 = bitcast i32* %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @lassign(i32* writeonly %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %0
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = bitcast i32* %5 to i8*
ret i8* %7
}
double df(double x, double dx) { return dx; }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @df(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @df(double %0, double returned %1) {
ret double %1
}
char **blkspl(up, vp)
register char **up, **vp;
{
  register char **wp =
      (char **)calloc((unsigned)(blklen(up) + blklen(vp) + 1), sizeof(char **));
  (void)blkcpy(wp, up);
  return (blkcat(wp, vp));
}


x86 assembly (clang, -O0):
<blkspl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <blklen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <blklen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <blkcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <blkcat@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkspl>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1050 <blklen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <blklen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <blkcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <blkcat@plt>
cltq
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8** @blkspl(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 = call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %6)
%8 = load i8**, i8*** %4
%9 = call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %8)
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @calloc(i64 %12, i64 8)
%14 = bitcast i8* %13 to i8**
store i8** %14, i8*** %5
%15 = load i8**, i8*** %5
%16 = load i8**, i8*** %3
%17 = call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %15, i8** %16)
%18 = load i8**, i8*** %5
%19 = load i8**, i8*** %4
%20 = call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcat to i32 (i8**, i8**, ...)*)(i8** %18, i8** %19)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8**
ret i8** %22
}

LLVM IR (-O2):
define i8** @blkspl(i8** %0, i8** %1) {
%3 = tail call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %0)
%4 = tail call i32 (i8**, ...) bitcast (i32 (...)* @blklen to i32 (i8**, ...)*)(i8** %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = tail call i8* @calloc(i64 %7, i64 8)
%9 = bitcast i8* %8 to i8**
%10 = tail call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcpy to i32 (i8**, i8**, ...)*)(i8** %9, i8** %0)
%11 = tail call i32 (i8**, i8**, ...) bitcast (i32 (...)* @blkcat to i32 (i8**, i8**, ...)*)(i8** %9, i8** %1)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8**
ret i8** %13
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
           struct timeval *);
int teclado() {
  fd_set fdset;
  int fd = 0;
  struct timeval timeout;
  FD_ZERO(&fdset);
  FD_SET(fd, &fdset);
  timeout.tv_sec = 1;
  timeout.tv_usec = 0;
  return (select(1, &fdset, 0, 0, &timeout));
}


x86 assembly (clang, -O0):
<teclado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0x4(%rbp),%rsi
call   1050 <FD_SET@plt>
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
mov    %ecx,%edx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teclado>:
push   %rbx
sub    $0x20,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
movl   $0x1,0x10(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x10(%rsp),%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @teclado() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 0, i32* %2
%4 = call i32 @FD_ZERO(i32* %1)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %1)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = call i32 @select(i32 1, i32* %1, i32 0, i32 0, %struct.timeval* %3)
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @teclado() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %1)
%6 = call i32 @FD_SET(i32 0, i32* %1)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %8
%9 = call i32 @select(i32 1, i32* %1, i32 0, i32 0, %struct.timeval* %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ESRCH;
int /*<<< orphan*/ errno;
int kill(int, int);
int killpg(int pgrp, int sig) {
  if (pgrp == 1 || pgrp < 0) {
    errno = ESRCH;
    return -1;
  }
  return kill(-pgrp, sig);
}


x86 assembly (clang, -O0):
<killpg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1132 <killpg+0x22>
cmpl   $0x0,-0x8(%rbp)
jge    1150 <killpg+0x40>
mov    0x2e97(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9e(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <killpg+0x50>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killpg>:
cmp    $0x1,%edi
je     1120 <killpg+0x10>
test   %edi,%edi
js     1120 <killpg+0x10>
neg    %edi
jmp    1030 <kill@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    0x2eb0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESRCH = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = load i32, i32* @ESRCH
store i32 %12, i32* @errno
store i32 -1, i32* %3
br label %18
13: ; preds = %8
%14 = load i32, i32* %4
%15 = sub nsw i32 0, %14
%16 = load i32, i32* %5
%17 = call i32 @kill(i32 %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@ESRCH = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp slt i32 %0, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i32, i32* @ESRCH
store i32 %7, i32* @errno
br label %11
8: ; preds = %2
%9 = sub nsw i32 0, %0
%10 = tail call i32 @kill(i32 %9, i32 %1)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ -1, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int read_until_delim(int, char *, size_t, int);
int get_line(int s, char *buf, size_t len) {
  return read_until_delim(s, buf, len, 012);
}


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

x86 assembly (clang, -O2):
<get_line>:
mov    $0xa,%ecx
jmp    1030 <read_until_delim@plt>

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

LLVM IR (-O2):
define i32 @get_line(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @read_until_delim(i32 %0, i8* %1, i64 %2, i32 10)
ret i32 %4
}
void syscall_except() {}


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

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

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

LLVM IR (-O2):
define void @syscall_except() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _warn_no_newline(char const *);
void warn(const char *message) {
  _warn_no_newline(message);
  _warn_no_newline("\n");
}


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

x86 assembly (clang, -O2):
<warn>:
push   %rax
call   1030 <_warn_no_newline@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <_warn_no_newline@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @warn(i8* %0) {
%2 = tail call i32 @_warn_no_newline(i8* %0)
%3 = tail call i32 @_warn_no_newline(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void __vtime_account_system(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__vtime_account_system(%struct.task_struct* nocapture %0) {
ret void
}
long umin(long a, long b) {
  if ((unsigned long)a < (unsigned long)b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<umin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <umin+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <umin+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @umin(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Errw1(void) {
  fprintf(stderr, "\nYou've selected 1-line output (-w 1) with a Linear (-L), "
                  "ladder (-l), gel (-g),\n"
                  "or proximity (-P) map, which doesn't make sense; '-w1' "
                  "should only be used with\n"
                  "the '-S' or '-F' flags.\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Errw1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Errw1>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [187 x i8] c"\0AYou've selected 1-line output (-w 1) with a Linear (-L), ladder (-l), gel (-g),\0Aor proximity (-P) map, which doesn't make sense; '-w1' should only be used with\0Athe '-S' or '-F' flags.\0A\0A\00"
define void @Errw1() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [187 x i8] c"\0AYou've selected 1-line output (-w 1) with a Linear (-L), ladder (-l), gel (-g),\0Aor proximity (-P) map, which doesn't make sense; '-w1' should only be used with\0Athe '-S' or '-F' flags.\0A\0A\00"
define void @Errw1() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int comp(const void *a, const void *b) { return *(int *)b - *(int *)a; }


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

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

LLVM IR (-O0):
define i32 @comp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ transwap(int, int);
void spindiagaxis() {
  int i, j;
  for (i = 0; i < 4; ++i) {
    for (j = i; j < 4; ++j) {
      transwap(i, j);
    }
  }
}


x86 assembly (clang, -O0):
<spindiagaxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1165 <spindiagaxis+0x55>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1152 <spindiagaxis+0x42>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <transwap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <spindiagaxis+0x1f>
jmp    1157 <spindiagaxis+0x47>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <spindiagaxis+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spindiagaxis>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <transwap@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <transwap@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <transwap@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <transwap@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <transwap@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <transwap@plt>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <transwap@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <transwap@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <transwap@plt>
mov    $0x3,%edi
mov    $0x3,%esi
pop    %rax
jmp    1030 <transwap@plt>

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

LLVM IR (-O2):
define void @spindiagaxis() {
%1 = tail call i32 @transwap(i32 0, i32 0)
%2 = tail call i32 @transwap(i32 0, i32 1)
%3 = tail call i32 @transwap(i32 0, i32 2)
%4 = tail call i32 @transwap(i32 0, i32 3)
%5 = tail call i32 @transwap(i32 1, i32 1)
%6 = tail call i32 @transwap(i32 1, i32 2)
%7 = tail call i32 @transwap(i32 1, i32 3)
%8 = tail call i32 @transwap(i32 2, i32 2)
%9 = tail call i32 @transwap(i32 2, i32 3)
%10 = tail call i32 @transwap(i32 3, i32 3)
ret void
}
/* Variables and functions */
scalar_t__ get_num(char *, char *);
char *long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_howmany(int);
char *macttHowmany(char *arg) {
  return long2str(arg, tt_howmany((int)get_num("ttHowmany", arg)));
}


x86 assembly (clang, -O0):
<macttHowmany>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,%edi
call   1050 <tt_howmany@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <long2str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttHowmany>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %eax,%edi
call   1050 <tt_howmany@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <long2str@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ttHowmany\00"
define i8* @macttHowmany(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @get_num(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = trunc i64 %5 to i32
%7 = call i32 @tt_howmany(i32 %6)
%8 = call i8* @long2str(i8* %3, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"ttHowmany\00"
define i8* @macttHowmany(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @tt_howmany(i32 %3)
%5 = tail call i8* @long2str(i8* %0, i32 %4)
ret i8* %5
}
int sqr(const int x) { return x * x; }


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

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

LLVM IR (-O0):
define i32 @sqr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @sqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void d_mutex_unlock(pthread_mutex_t *mutex) {
  int rv = pthread_mutex_unlock(mutex);
  if (rv != 0) {
    printf("error: pthread_mutex_unlock == %d\n", rv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<d_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116b <d_mutex_unlock+0x3b>
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_mutex_unlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    113c <d_mutex_unlock+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"error: pthread_mutex_unlock == %d\0A\00"
define void @d_mutex_unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"error: pthread_mutex_unlock == %d\0A\00"
define void @d_mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("binary ----> array\n\n");
  printf(
      "Interprets any file as plain binary data and dumps to a raw C array.\n");
  printf("usage: bin2array --one  <in-file> <out-file> [--arrayname "
         "<name-string> ] \n");
  printf("       bin2array --mult <in-file1> <in-file2> <in-file3> "
         "...<in-fileN>  <out-file> [--arrayname <name-string>] \n\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xf68(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"binary ----> array\0A\0A\00"
@.str.1 = [70 x i8] c"Interprets any file as plain binary data and dumps to a raw C array.\0A\00"
@.str.2 = [76 x i8] c"usage: bin2array --one <in-file> <out-file> [--arrayname <name-string> ] \0A\00"
@.str.3 = [114 x i8] c" bin2array --mult <in-file1> <in-file2> <in-file3> ...<in-fileN> <out-file> [--arrayname <name-string>] \0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"binary ----> array\0A\00"
@str.4 = [69 x i8] c"Interprets any file as plain binary data and dumps to a raw C array.\00"
@str.5 = [75 x i8] c"usage: bin2array --one <in-file> <out-file> [--arrayname <name-string> ] \00"
@str.6 = [113 x i8] c" bin2array --mult <in-file1> <in-file2> <in-file3> ...<in-fileN> <out-file> [--arrayname <name-string>] \0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @str.6, i64 0, i64 0))
ret void
}
__attribute__((weak)) void midi_clock_source_changed(int source) {}


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

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

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

LLVM IR (-O2):
define weak void @midi_clock_source_changed(i32 %0) {
ret void
}
wait(p) int *p;
{ return _wait(p); }


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

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

LLVM IR (-O0):
define i32 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @_wait to i32 (i32*, ...)*)(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @_wait to i32 (i32*, ...)*)(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf(
      "Usage: subnet [ip address] {netmask | cidr}\n          "
      "Example:\t192.168.0.1 255.255.255.0\n          \t\t192.168.0.1 /24\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [118 x i8] c"Usage: subnet [ip address] {netmask | cidr}\0A Example:\09192.168.0.1 255.255.255.0\0A \09\09192.168.0.1 /24\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [117 x i8] c"Usage: subnet [ip address] {netmask | cidr}\0A Example:\09192.168.0.1 255.255.255.0\0A \09\09192.168.0.1 /24\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ cwn__write(int /*<<< orphan*/);
void cwn_ref(int64_t refid) { cwn__write(refid); }


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

x86 assembly (clang, -O2):
<cwn_ref>:
jmp    1030 <cwn__write@plt>

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

LLVM IR (-O2):
define void @cwn_ref(i32 %0) {
%2 = tail call i32 @cwn__write(i32 %0)
ret void
}