xunge/DecIR huggingface dataset:
/* Variables and functions */
const char *bool_string(const bool value) { return value ? "true" : "false"; }


x86 assembly (clang, -O0):
<bool_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef4(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_string>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool_string(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct view_edit_contact {
  int dummy;
};
struct view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct view_edit_contact *);
void view_edit_contact_free(struct view *v) {
  free((struct view_edit_contact *)v);
}


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

x86 assembly (clang, -O2):
<view_edit_contact_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.view_edit_contact = type { i32 }
define void @view_edit_contact_free(%struct.view* %0) {
%2 = alloca %struct.view*
store %struct.view* %0, %struct.view** %2
%3 = load %struct.view*, %struct.view** %2
%4 = bitcast %struct.view* %3 to %struct.view_edit_contact*
%5 = call i32 @free(%struct.view_edit_contact* %4)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.view_edit_contact = type { i32 }
define void @view_edit_contact_free(%struct.view* nocapture %0) {
%2 = bitcast %struct.view* %0 to %struct.view_edit_contact*
%3 = tail call i32 @free(%struct.view_edit_contact* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_ring_buffer_read_write();
void test_ring_buffer(void) { test_ring_buffer_read_write(); }


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

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

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

LLVM IR (-O2):
define void @test_ring_buffer() {
%1 = tail call i32 (...) @test_ring_buffer_read_write()
ret void
}
int hidden_func(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @hidden_func() {
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_chld(int signum) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
    printf("child %d terminated, status: %d\n", pid, stat);
  }
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1165 <sig_chld+0x45>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_chld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    1182 <sig_chld+0x62>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edx
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_chld+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [33 x i8] c"child %d terminated, status: %d\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [33 x i8] c"child %d terminated, status: %d\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1, %7
%8 = phi i32 [ %12, %7 ], [ %5, %1 ]
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* @WNOHANG
%12 = call i32 @waitpid(i32 -1, i32* %2, i32 %11)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char root[4] = "root";
  int *str = (int *)root;
  printf("root -> %x\n", *str);
  return 0;
}


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

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

LLVM IR (-O0):
@__const.main.root = [4 x i8] c"root"
@.str = [12 x i8] c"root -> %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"root -> %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1953460082)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int xscom_read(int, int, int *);
int xscom_read_ex(uint32_t ex_target_id, uint64_t addr, uint64_t *val) {
  uint32_t chip_id = ex_target_id >> 4;
  ;
  addr |= (ex_target_id & 0xf) << 24;
  return xscom_read(chip_id, addr, val);
}


x86 assembly (clang, -O0):
<xscom_read_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <xscom_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xscom_read_ex>:
mov    %edi,%eax
sar    $0x4,%eax
and    $0xf,%edi
shl    $0x18,%edi
or     %edi,%esi
mov    %eax,%edi
jmp    1030 <xscom_read@plt>

LLVM IR (-O0):
define i32 @xscom_read_ex(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = ashr i32 %8, 4
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = and i32 %10, 15
%12 = shl i32 %11, 24
%13 = load i32, i32* %5
%14 = or i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %7
%16 = load i32, i32* %5
%17 = load i32*, i32** %6
%18 = call i32 @xscom_read(i32 %15, i32 %16, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @xscom_read_ex(i32 %0, i32 %1, i32* %2) {
%4 = ashr i32 %0, 4
%5 = shl i32 %0, 24
%6 = and i32 %5, 251658240
%7 = or i32 %6, %1
%8 = tail call i32 @xscom_read(i32 %4, i32 %7, i32* %2)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
__attribute__((always_)) void _tu_move(int y, int x) {
  printf("\x1b[%d;%dH", y, x);
}


x86 assembly (clang, -O0):
<_tu_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tu_move>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @_tu_move(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* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @_tu_move(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int toupper(char);
int main() {
  char c = 'a';
  printf("%c\n", toupper(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @toupper(i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr && size)
    die("Out of memory: failed to allocate %zu bytes", size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <xmalloc+0x3f>
cmpq   $0x0,-0x8(%rbp)
je     115f <xmalloc+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1148 <xmalloc+0x28>
test   %r14,%r14
jne    1148 <xmalloc+0x28>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Out of memory: failed to allocate %zu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %8, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [44 x i8] c"Out of memory: failed to allocate %zu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @die(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: pbs\nNo arguments necessary when calling pbs.\npbs prints out "
         "information from the boot sector.\n");
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"Usage: pbs\0ANo arguments necessary when calling pbs.\0Apbs prints out information from the boot sector.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [101 x i8] c"Usage: pbs\0ANo arguments necessary when calling pbs.\0Apbs prints out information from the boot sector.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str, i64 0, i64 0))
ret void
}
int foo(int foo_int, char *foo_char) {}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x04() {
  Assert_real((isxdigit(4) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              25, ("isxdigit should be 0 for 0x04"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x04>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x19,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x04>:
push   %rax
mov    $0x4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x19,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x04\00"
define void @t_isxdigit_0x04() {
%1 = call i64 @isxdigit(i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x04\00"
define void @t_isxdigit_0x04() {
%1 = tail call i64 @isxdigit(i32 4)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_prime(int num) {
  int div;
  if (num <= 0)
    return -1;
  if (num > 1)
    for (div = 2; num % div != 0; div++)
      ;
  if (div == num)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <is_prime+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <is_prime+0x75>
cmpl   $0x1,-0x8(%rbp)
jle    1156 <is_prime+0x56>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1151 <is_prime+0x51>
jmp    1143 <is_prime+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <is_prime+0x2e>
jmp    1156 <is_prime+0x56>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    116e <is_prime+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <is_prime+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
test   %edi,%edi
jle    1124 <is_prime+0x24>
cmp    $0x1,%edi
je     111c <is_prime+0x1c>
mov    $0x1,%ecx
xchg   %ax,%ax
add    $0x1,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <is_prime+0x10>
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5, %3
%11 = phi i32 [ undef, %3 ], [ %6, %5 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %1
%15 = phi i32 [ -1, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ m15setParams(int /*<<< orphan*/, int /*<<< orphan*/);
void m15reset() { m15setParams(0, 0); }


x86 assembly (clang, -O0):
<m15reset>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <m15setParams@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m15reset>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <m15setParams@plt>

LLVM IR (-O0):
define void @m15reset() {
%1 = call i32 @m15setParams(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @m15reset() {
%1 = tail call i32 @m15setParams(i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_BASICRESP;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_BASICRESP_it;
OCSP_BASICRESP *d2i_OCSP_BASICRESP(OCSP_BASICRESP **a, const unsigned char **in,
                                   long len) {
  return (OCSP_BASICRESP *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &OCSP_BASICRESP_it);
}


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

x86 assembly (clang, -O2):
<d2i_OCSP_BASICRESP>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_BASICRESP_it = global i32 0
define i32* @d2i_OCSP_BASICRESP(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 i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_BASICRESP_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_BASICRESP_it = global i32 0
define i32* @d2i_OCSP_BASICRESP(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_BASICRESP_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
unsigned alignreloc(nbytes)
register unsigned nbytes;
{
  while (nbytes % 4) {
    putchar(0);
    nbytes++;
  }
  return nbytes;
}


x86 assembly (clang, -O0):
<alignreloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1141 <alignreloc+0x31>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <alignreloc+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignreloc>:
push   %rbx
mov    %edi,%ebx
test   $0x3,%bl
je     1131 <alignreloc+0x21>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%ebx
test   $0x3,%bl
jne    1120 <alignreloc+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alignreloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = urem i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 0)
%9 = load i32, i32* %2
%10 = add i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @alignreloc(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 0)
%7 = add i32 %5, 1
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ %0, %1 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XInstallColormap() {
  printf("XInstallColormap called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"XInstallColormap called\00"
define i32 @XInstallColormap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ INTERM_COM(short, char *);
void INTERM(char *S) {
  short I = 0;
  INTERM_COM(I, S);
}


x86 assembly (clang, -O0):
<INTERM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <INTERM_COM@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @INTERM(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %3
%4 = load i16, i16* %3
%5 = load i8*, i8** %2
%6 = call i32 @INTERM_COM(i16 signext %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @INTERM(i8* %0) {
%2 = tail call i32 @INTERM_COM(i16 signext 0, i8* %0)
ret void
}
unsigned hash(char *string) {
  int i;
  unsigned u = 0;
  for (i = 0; string[i] != '\0'; i++)
    u = (u << 5) + (u >> (10 - 5)) + (unsigned char)string[i];
  return (u & ((1 << 10) - 1));
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <hash+0x58>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
mov    -0x10(%rbp),%ecx
shr    $0x5,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash+0x16>
mov    -0x10(%rbp),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <hash+0x32>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
shr    $0x5,%eax
mov    %eax,%esi
add    %edx,%esi
movzbl %cl,%eax
add    %esi,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x3ff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %29
13: ; preds = %5
%14 = load i32, i32* %4
%15 = shl i32 %14, 5
%16 = load i32, i32* %4
%17 = lshr i32 %16, 5
%18 = add i32 %15, %17
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add i32 %18, %24
store i32 %25, i32* %4
br label %26
26: ; preds = %13
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %5
29: ; preds = %5
%30 = load i32, i32* %4
%31 = and i32 %30, 1023
ret i32 %31
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %13, %4 ], [ 0, %1 ]
%6 = phi i8 [ %15, %4 ], [ %2, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 5
%9 = lshr i32 %7, 5
%10 = add i32 %8, %9
%11 = zext i8 %6 to i32
%12 = add i32 %10, %11
%13 = add nuw nsw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %12, 1023
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 0, %1 ], [ %18, %17 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hashids_free_f(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<hashids_free_f>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hashids_free_f(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void invlpg(unsigned long addr) {
  asm volatile("invlpg (%0)" ::"r"(addr) : "memory");
}


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

LLVM IR (-O0):
define void @invlpg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret void
}

LLVM IR (-O2):
define void @invlpg(i64 %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
void rdar8875946() {
  double _Complex P;
  float _Complex P2 = 3.3f + P;
}


x86 assembly (clang, -O0):
<rdar8875946>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
addsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rdar8875946() {
%1 = alloca { double, double }
%2 = alloca { float, float }
%3 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds { double, double }, { double, double }* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fadd double 0x400A666660000000, %4
%8 = fptrunc double %7 to float
%9 = fptrunc double %6 to float
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %8, float* %10
store float %9, float* %11
ret void
}

LLVM IR (-O2):
define void @rdar8875946() {
ret void
}
int __attribute__((__no__)) actual_function() { return 42; }


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

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

LLVM IR (-O0):
define i32 @actual_function() {
ret i32 42
}

LLVM IR (-O2):
define i32 @actual_function() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ asix88796_eeprom_send(int, int);
void asix88796_eeprom_command(int ioaddr) {
  asix88796_eeprom_send(ioaddr, 0);
  asix88796_eeprom_send(ioaddr, 1);
  asix88796_eeprom_send(ioaddr, 1);
  asix88796_eeprom_send(ioaddr, 0);
}


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

x86 assembly (clang, -O2):
<asix88796_eeprom_command>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <asix88796_eeprom_send@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <asix88796_eeprom_send@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <asix88796_eeprom_send@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <asix88796_eeprom_send@plt>

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

LLVM IR (-O2):
define void @asix88796_eeprom_command(i32 %0) {
%2 = tail call i32 @asix88796_eeprom_send(i32 %0, i32 0)
%3 = tail call i32 @asix88796_eeprom_send(i32 %0, i32 1)
%4 = tail call i32 @asix88796_eeprom_send(i32 %0, i32 1)
%5 = tail call i32 @asix88796_eeprom_send(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "\n-- Dinoex %s "
          "1.70"
          " , "
          "Copyright (c) 1992,93,94,95,96,97,98,99\n"
          " by Dirk Meyer, All rights reserved,"
          " Email: dirk.meyer@dinoex.sub.org\n",
          "bsmtp");
  fprintf(stderr, "\n"
                  " Usage: | bsmtp [ -verbose ] [-spool dir ] mail_from "
                  "rcpt_to [ rcpt_to ... ]\n"
                  "\n");
  exit(64);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xf49(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xf38(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x40,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
lea    0xf4c(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf42(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x40,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [132 x i8] c"\0A-- Dinoex %s 1.70 , Copyright (c) 1992,93,94,95,96,97,98,99\0A by Dirk Meyer, All rights reserved, Email: dirk.meyer@dinoex.sub.org\0A\00"
@.str.1 = [6 x i8] c"bsmtp\00"
@.str.2 = [80 x i8] c"\0A Usage: | bsmtp [ -verbose ] [-spool dir ] mail_from rcpt_to [ rcpt_to ... ]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 64)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [132 x i8] c"\0A-- Dinoex %s 1.70 , Copyright (c) 1992,93,94,95,96,97,98,99\0A by Dirk Meyer, All rights reserved, Email: dirk.meyer@dinoex.sub.org\0A\00"
@.str.1 = [6 x i8] c"bsmtp\00"
@.str.2 = [80 x i8] c"\0A Usage: | bsmtp [ -verbose ] [-spool dir ] mail_from rcpt_to [ rcpt_to ... ]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 64)
unreachable
}
void NullArc(struct ADrawTag *ctx __attribute__((unused)),
             unsigned int cx __attribute__((unused)),
             unsigned int cy __attribute__((unused)),
             unsigned int w __attribute__((unused)),
             unsigned int h __attribute__((unused)),
             unsigned int s __attribute__((unused)),
             unsigned int e __attribute__((unused))) {}


x86 assembly (clang, -O0):
<NullArc>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define void @NullArc(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.ADrawTag*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define void @NullArc(%struct.ADrawTag* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret void
}
/* Variables and functions */
int mfs_ls_r(int /*<<< orphan*/);
int mfs_ls() { return mfs_ls_r(0); }


x86 assembly (clang, -O0):
<mfs_ls>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mfs_ls_r@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfs_ls>:
xor    %edi,%edi
jmp    1030 <mfs_ls_r@plt>

LLVM IR (-O0):
define i32 @mfs_ls() {
%1 = call i32 @mfs_ls_r(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mfs_ls() {
%1 = tail call i32 @mfs_ls_r(i32 0)
ret i32 %1
}
unsigned int hash_function(const char *str, unsigned htab_size) {
  unsigned int h = 0;
  const unsigned char *p;
  for (p = (const unsigned char *)str; *p != '\0'; p++) {
    h = 65599 * h + *p;
  }
  return h % htab_size;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114e <hash_function+0x4e>
imul   $0x1003f,-0x10(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <hash_function+0x1a>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_function+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_function+0x10>
jmp    112a <hash_function+0x2a>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_function(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = zext i8 %6 to i32
%10 = mul i32 %8, 65599
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ na_print_nodes();
bool detailed_list_command(void) {
  na_print_nodes();
  return true;
}


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

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

LLVM IR (-O0):
define i32 @detailed_list_command() {
%1 = call i32 (...) @na_print_nodes()
ret i32 1
}

LLVM IR (-O2):
define i32 @detailed_list_command() {
%1 = tail call i32 (...) @na_print_nodes()
ret i32 1
}
int myfunction(int x) { return x + 1; }


x86 assembly (clang, -O0):
<myfunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunction>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @myfunction(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int Maximum(int a, int b) {
  if (a >= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<Maximum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <Maximum+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Maximum+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maximum>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Maximum(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 = load i32, i32* %5
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Maximum(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int ENOSYS;
int errno;
int removexattr(const char *path, const char *name) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<removexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<removexattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @removexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @removexattr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
float min(const float a, const float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
char *Malloc(sz)
unsigned int sz;
{
  register char *res = malloc(sz);
  if (sz && res == 0)
    No_Mem();
  return res;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1155 <Malloc+0x35>
cmpq   $0x0,-0x10(%rbp)
jne    1155 <Malloc+0x35>
mov    $0x0,%al
call   1030 <No_Mem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     113f <Malloc+0x1f>
test   %rbx,%rbx
jne    113f <Malloc+0x1f>
xor    %eax,%eax
call   1030 <No_Mem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @No_Mem()
br label %14
14: ; preds = %12, %9, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @Malloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp ne i32 %0, 0
%5 = icmp eq i8* %3, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (...) @No_Mem()
br label %9
9: ; preds = %7, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((weak)) f() { printf("original f..\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"original f..\00"
define weak void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int mc_inet_pton(int af, const char *strbuf, void *addr) {
  return inet_pton(af, strbuf, addr);
}


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

x86 assembly (clang, -O2):
<mc_inet_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @mc_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
char *cuserid(s)
char *s;
{ return "NONE"; }


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

x86 assembly (clang, -O2):
<cuserid>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"NONE\00"
define i8* @cuserid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"NONE\00"
define i8* @cuserid(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}