xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_die();
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (size && !ptr)
    xalloc_die();
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <xmalloc+0x36>
cmpq   $0x0,-0x10(%rbp)
jne    1156 <xmalloc+0x36>
mov    $0x0,%al
call   1030 <xalloc_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   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xmalloc+0x20>
test   %r14,%r14
jne    1140 <xmalloc+0x20>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
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 i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 (...) @xalloc_die()
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @xalloc_die()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ STDOUT_FILENO;
int write(int /*<<< orphan*/, char *, int);
int putchar(int ch) {
  char c = ch;
  int len;
  len = write(STDOUT_FILENO, &c, 1);
  if (len <= 0) {
    return EOF;
  }
  return ch;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     1156 <putchar+0x46>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <putchar+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
jg     1140 <putchar+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@EOF = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8* %2, i32 1)
%6 = icmp slt i32 %5, 1
%7 = load i32, i32* @EOF
%8 = select i1 %6, i32 %7, i32 %0
ret i32 %8
}
char *name(void) {
  static char n[] = "test ctme: failure";
  return n;
}


x86 assembly (clang, -O0):
<name>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@name.n = internal global [19 x i8] c"test ctme: failure\00"
define i8* @name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @name.n, i64 0, i64 0)
}

LLVM IR (-O2):
@name.n = internal global [19 x i8] c"test ctme: failure\00"
define i8* @name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @name.n, i64 0, i64 0)
}
void f1() {
  for (; 1;) {
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f1+0x9>
mov    $0x1,%al
test   $0x1,%al
jne    1118 <f1+0x18>
jmp    111d <f1+0x1d>
jmp    1109 <f1+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
br label %1
1: ; preds = %2, %0
br i1 true, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f1() {
br label %1
1: ; preds = %1, %0
br label %1
}
void pcp_print_net_udp6_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_net_udp6_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_udp6_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
size_t CLIST_MaxSize(void) { return (-1); }


x86 assembly (clang, -O0):
<CLIST_MaxSize>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLIST_MaxSize>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @CLIST_MaxSize() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @CLIST_MaxSize() {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ld_bcp_a(void) { op_write1(0x02); }


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

x86 assembly (clang, -O2):
<op_enc_ld_bcp_a>:
mov    $0x2,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ld_bcp_a() {
%1 = call i32 @op_write1(i32 2)
ret void
}

LLVM IR (-O2):
define void @op_enc_ld_bcp_a() {
%1 = tail call i32 @op_write1(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gator_annotate_channel_end(int /*<<< orphan*/);
void gator_annotate_end(void) { gator_annotate_channel_end(0); }


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

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

LLVM IR (-O0):
define void @gator_annotate_end() {
%1 = call i32 @gator_annotate_channel_end(i32 0)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_end() {
%1 = tail call i32 @gator_annotate_channel_end(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _irc_chan_del(char *);
int /*<<< orphan*/ _irc_queue_insert(int, char *, char *, ...);
int irc_part(char *chan, char *msg) {
  if (msg)
    _irc_queue_insert(6, "PART %s :%s", chan, msg);
  else
    _irc_queue_insert(6, "PART %s", chan);
  _irc_chan_del(chan);
  return 0;
}


x86 assembly (clang, -O0):
<irc_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <irc_part+0x3b>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x6,%edi
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1040 <_irc_queue_insert@plt>
jmp    1172 <irc_part+0x52>
mov    -0x8(%rbp),%rdx
mov    $0x6,%edi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <_irc_queue_insert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_irc_chan_del@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_part>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1144 <irc_part+0x24>
mov    %rsi,%rcx
lea    0xecd(%rip),%rsi
mov    $0x6,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <_irc_queue_insert@plt>
jmp    115a <irc_part+0x3a>
lea    0xec1(%rip),%rsi
mov    $0x6,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <_irc_queue_insert@plt>
mov    %rbx,%rdi
call   1030 <_irc_chan_del@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"PART %s :%s\00"
@.str.1 = [8 x i8] c"PART %s\00"
define i32 @irc_part(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
%15 = load i8*, i8** %3
%16 = call i32 @_irc_chan_del(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"PART %s :%s\00"
@.str.1 = [8 x i8] c"PART %s\00"
define i32 @irc_part(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (i32, i8*, i8*, ...) @_irc_queue_insert(i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @_irc_chan_del(i8* %0)
ret i32 0
}
int roundUp(int first, int second) {
  if (first % second == 0) {
    return first;
  } else {
    return first + (second - first % second);
  }
}


x86 assembly (clang, -O0):
<roundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1125 <roundUp+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <roundUp+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUp>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @roundUp(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 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
br label %20
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = srem i32 %15, %16
%18 = sub nsw i32 %14, %17
%19 = add nsw i32 %13, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @roundUp(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void TMTimerGetMicro(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerGetMicro() {
ret void
}
int yamadie(char n) {
  if (n >= 'A' && n <= 'Z')
    return 1;
  else if (n >= 'a' && n <= 'z')
    return 2;
  else if (n >= '0' && n <= '9')
    return 3;
  else
    return 4;
}


x86 assembly (clang, -O0):
<yamadie>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <yamadie+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <yamadie+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1183 <yamadie+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1156 <yamadie+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1156 <yamadie+0x56>
movl   $0x2,-0x4(%rbp)
jmp    1183 <yamadie+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <yamadie+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <yamadie+0x7c>
movl   $0x3,-0x4(%rbp)
jmp    1183 <yamadie+0x83>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yamadie>:
lea    -0x41(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1a,%cl
jb     112a <yamadie+0x2a>
lea    -0x61(%rdi),%ecx
mov    $0x2,%eax
cmp    $0x1a,%cl
jb     112a <yamadie+0x2a>
add    $0xd0,%dil
cmp    $0xa,%dil
mov    $0x4,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @yamadie(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 2, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 48
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 3, i32* %2
br label %31
30: ; preds = %25, %21
store i32 4, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @yamadie(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 26
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add i8 %0, -48
%9 = icmp ult i8 %8, 10
%10 = select i1 %9, i32 3, i32 4
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 2, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
void bzero_loop(void *buffer, size_t size) {
  char *p = buffer;
  while (size--)
    *p++ = 0;
}


x86 assembly (clang, -O0):
<bzero_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <bzero_loop+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1114 <bzero_loop+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero_loop>:
test   %rsi,%rsi
je     1124 <bzero_loop+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero_loop(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
void freeBoard(char **w, int n) {
  int i;
  for (i = 0; i < n; i++) {
    free(w[i]);
  }
  free(w);
}


x86 assembly (clang, -O0):
<freeBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeBoard+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeBoard+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeBoard>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeBoard+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeBoard+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeBoard(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void start_rtorrent(char nickname[]) {
  char chaine[100] = {0};
  snprintf(chaine, 100, "su --command='screen -dmS %s-rtorrent rtorrent' %s\n",
           nickname, nickname);
  printf("%s", chaine);
  system(chaine);
}


x86 assembly (clang, -O0):
<start_rtorrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x64,%esi
lea    0xe8c(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_rtorrent>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rcx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe99(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %rcx,%r8
call   1050 <snprintf@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"su --command='screen -dmS %s-rtorrent rtorrent' %s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @start_rtorrent(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = bitcast [100 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %5, i32 100, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @system(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"su --command='screen -dmS %s-rtorrent rtorrent' %s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @start_rtorrent(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 100, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @system(i8* %3)
ret void
}
void Init_CPUhand() {}


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

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

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

LLVM IR (-O2):
define void @Init_CPUhand() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETTEXTALIGN_print(const char *contents) {
  core3_print("U_EMRSETTEXTALIGN", "iMode:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETTEXTALIGN_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"U_EMRSETTEXTALIGN\00"
@.str.1 = [7 x i8] c"iMode:\00"
define void @U_EMRSETTEXTALIGN_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"U_EMRSETTEXTALIGN\00"
@.str.1 = [7 x i8] c"iMode:\00"
define void @U_EMRSETTEXTALIGN_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void store32(void *dst, uint32_t w) { *(uint32_t *)(dst) = w; }


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

x86 assembly (clang, -O2):
<store32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int open_slave(int, char *);
scalar_t__ setsid();
int get_slave_fd(int master_fd, char *slave_name) {
  int fd;
  if (setsid() < 0)
    return -1;
  if ((fd = open_slave(master_fd, slave_name)) < 0)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<get_slave_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <setsid@plt>
cmp    $0x0,%rax
jge    114c <get_slave_fd+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <get_slave_fd+0x56>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <open_slave@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1170 <get_slave_fd+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <get_slave_fd+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_slave_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <setsid@plt>
test   %rax,%rax
js     114c <get_slave_fd+0x2c>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <open_slave@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
jmp    1151 <get_slave_fd+0x31>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_slave_fd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = call i64 (...) @setsid()
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i32 @open_slave(i32 %11, i8* %12)
store i32 %13, i32* %6
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %3
br label %18
16: ; preds = %10
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %15, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_slave_fd(i32 %0, i8* %1) {
%3 = tail call i64 (...) @setsid()
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @open_slave(i32 %0, i8* %1)
%7 = icmp sgt i32 %6, -1
%8 = select i1 %7, i32 %6, i32 -1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t abs_fun_int64_t(int64_t a) {
  int64_t mask = a >> 63;
  return (a + mask) ^ mask;
}


x86 assembly (clang, -O0):
<abs_fun_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs_fun_int64_t(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int tab[100], i;
  for (i = 0; i < 100; ++i) {
    tab[i] = i;
    printf("%i ", tab[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    117d <main+0x6d>
mov    -0x1a4(%rbp),%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    112c <main+0x1c>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
struct plugin_return {
  int dummy;
};
struct plugin_list {
  int dummy;
};
struct env_set {
  int dummy;
};
struct argv {
  int dummy;
};

/* Variables and functions */
int plugin_call_ssl(struct plugin_list const *, int const, struct argv const *,
                    struct plugin_return *, struct env_set *);
int plugin_call(const struct plugin_list *pl, const int type,
                const struct argv *av, struct plugin_return *pr,
                struct env_set *es) {
  return plugin_call_ssl(pl, type, av, pr, es);
}


x86 assembly (clang, -O0):
<plugin_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <plugin_call_ssl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_call>:
jmp    1030 <plugin_call_ssl@plt>

LLVM IR (-O0):
%struct.plugin_list = type { i32 }
%struct.argv = type { i32 }
%struct.plugin_return = type { i32 }
%struct.env_set = type { i32 }
define i32 @plugin_call(%struct.plugin_list* %0, i32 %1, %struct.argv* %2, %struct.plugin_return* %3, %struct.env_set* %4) {
%6 = alloca %struct.plugin_list*
%7 = alloca i32
%8 = alloca %struct.argv*
%9 = alloca %struct.plugin_return*
%10 = alloca %struct.env_set*
store %struct.plugin_list* %0, %struct.plugin_list** %6
store i32 %1, i32* %7
store %struct.argv* %2, %struct.argv** %8
store %struct.plugin_return* %3, %struct.plugin_return** %9
store %struct.env_set* %4, %struct.env_set** %10
%11 = load %struct.plugin_list*, %struct.plugin_list** %6
%12 = load i32, i32* %7
%13 = load %struct.argv*, %struct.argv** %8
%14 = load %struct.plugin_return*, %struct.plugin_return** %9
%15 = load %struct.env_set*, %struct.env_set** %10
%16 = call i32 @plugin_call_ssl(%struct.plugin_list* %11, i32 %12, %struct.argv* %13, %struct.plugin_return* %14, %struct.env_set* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.plugin_list = type { i32 }
%struct.argv = type { i32 }
%struct.plugin_return = type { i32 }
%struct.env_set = type { i32 }
define i32 @plugin_call(%struct.plugin_list* %0, i32 %1, %struct.argv* %2, %struct.plugin_return* %3, %struct.env_set* %4) {
%6 = tail call i32 @plugin_call_ssl(%struct.plugin_list* %0, i32 %1, %struct.argv* %2, %struct.plugin_return* %3, %struct.env_set* %4)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void __attribute__((unused)) atomic_add(volatile uint32_t *mem, int val) {
  *mem += val;
}


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_add(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 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = add nsw i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @atomic_add(i32* %0, i32 %1) {
%3 = load volatile i32, i32* %0
%4 = add nsw i32 %3, %1
store volatile i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_dump_formats() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_dump_formats"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sndfile_dump_formats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_sndfile_dump_formats\0A\00"
define i32 @pa_sndfile_dump_formats() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_sndfile_dump_formats\00"
define i32 @pa_sndfile_dump_formats() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
long round(long double value) {
  long intpart = value;
  value -= intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpll -0x28(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fldt   -0x10(%rbp)
fsubp  %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb6(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1167 <round+0x67>
jmp    115b <round+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
fldt   0x8(%rsp)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fld    %st(0)
fistpll -0x10(%rsp)
fldcw  -0x14(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
fsubrp %st,%st(1)
flds   0xec5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @round(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to x86_fp80
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %8, %7
store x86_fp80 %9, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %2
%11 = fcmp oge x86_fp80 %10, 0xK3FFE8000000000000000
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @round(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp oge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int le_to_u64(int /*<<< orphan*/ const *);
int64_t le_to_i64(const uint8_t *buf) {
  uint64_t v = le_to_u64(buf);
  return (v < 0x8000000000000000ULL
              ? v
              : -((int64_t)(0xffffffffffffffffULL - v)) - 1);
}


x86 assembly (clang, -O0):
<le_to_i64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_to_u64@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x8000000000000000,%rcx
cmp    %rcx,%rax
jae    114a <le_to_i64+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <le_to_i64+0x54>
movslq -0xc(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
sub    %rcx,%rax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i64>:
jmp    1030 <le_to_u64@plt>

LLVM IR (-O0):
define i32 @le_to_i64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u64(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, -9223372036854775808
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
br label %18
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = sub i64 -1, %13
%15 = trunc i64 %14 to i32
%16 = sub nsw i32 0, %15
%17 = sub nsw i32 %16, 1
br label %18
18: ; preds = %11, %9
%19 = phi i32 [ %10, %9 ], [ %17, %11 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @le_to_i64(i32* %0) {
%2 = tail call i32 @le_to_u64(i32* %0)
ret i32 %2
}
unsigned long long subull(unsigned long long a, unsigned long long b) {
  if (a < b)
    return -1ULL - b + a + 1;
  return a - b;
}


x86 assembly (clang, -O0):
<subull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1136 <subull+0x36>
mov    $0xffffffffffffffff,%rax
sub    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <subull+0x42>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @subull(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 %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = sub i64 -1, %10
%12 = load i64, i64* %4
%13 = add i64 %11, %12
%14 = add i64 %13, 1
store i64 %14, i64* %3
br label %19
15: ; preds = %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = sub i64 %16, %17
store i64 %18, i64* %3
br label %19
19: ; preds = %15, %9
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @subull(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
ret i64 %3
}
int is_modifier(char c) { return (c == 'l' || c == 'L'); }


x86 assembly (clang, -O0):
<is_modifier>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6c,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_modifier+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x4c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_modifier>:
and    $0xdf,%dil
xor    %eax,%eax
cmp    $0x4c,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_modifier(i8 signext %0) {
%2 = and i8 %0, -33
%3 = icmp eq i8 %2, 76
%4 = zext i1 %3 to i32
ret i32 %4
}
void bdf_correct_bbx(int *width, int *bbx) {
  if (*bbx < 0) {
    *width -= *bbx;
    *bbx = 0;
  }
}


x86 assembly (clang, -O0):
<bdf_correct_bbx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1133 <bdf_correct_bbx+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdf_correct_bbx>:
mov    (%rsi),%eax
test   %eax,%eax
js     1107 <bdf_correct_bbx+0x7>
ret
sub    %eax,(%rdi)
movl   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @bdf_correct_bbx(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %0
%7 = sub nsw i32 %6, %3
store i32 %7, i32* %0
store i32 0, i32* %1
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void syslog(int priority, const char *format, ...) {
  printf("log_test: syslog(%d, \"%s\", ...)\n", priority, format);
}


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

x86 assembly (clang, -O2):
<syslog>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"log_test: syslog(%d, \22%s\22, ...)\0A\00"
define void @syslog(i32 %0, i8* %1, ...) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
void emit_blob_start(struct processor_explicatory_state *process_state,
                     struct modern_stream *stream, void *stream_state,
                     struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_blob_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_blob_start(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_blob_start(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
size_t modulo_decrement(size_t i, size_t n) {
  if (i == 0) {
    i = n;
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<modulo_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111f <modulo_decrement+0x1f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_decrement>:
test   %rdi,%rdi
cmovne %rdi,%rsi
lea    -0x1(%rsi),%rax
ret

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

LLVM IR (-O2):
define i64 @modulo_decrement(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = select i1 %3, i64 %1, i64 %0
%5 = add i64 %4, -1
ret i64 %5
}
int isspace(int c) {
  return c == ' ' || c == '\t' || c == '\f' || c == '\n' || c == '\r' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 12
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int find_targets(char *);
int exec_daemons(void) {
  int status = 0;
  if ((status = find_targets("/etc/init.d/targets")) < 0)
    return status;
  return 0;
}


x86 assembly (clang, -O0):
<exec_daemons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <find_targets@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1142 <exec_daemons+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <exec_daemons+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_daemons>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <find_targets@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"/etc/init.d/targets\00"
define i32 @exec_daemons() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @find_targets(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %2
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"/etc/init.d/targets\00"
define i32 @exec_daemons() {
%1 = tail call i32 @find_targets(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i32 %1, 0
%3 = select i1 %2, i32 %1, i32 0
ret i32 %3
}