xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You are %d miles away\n", distance);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"You are %d miles away\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"You are %d miles away\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
int isspace(int ch) {
  return ch == ' ' || ch == '\t' || (ch >= '\n' && ch <= '\r');
}


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     1144 <isspace+0x44>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <isspace+0x44>
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     113e <isspace+0x3e>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
cmp    $0x9,%edi
je     110f <isspace+0xf>
cmp    $0x20,%edi
jne    1110 <isspace+0x10>
ret
add    $0xfffffff6,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %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 %16, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %16, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 13
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5, %1
%17 = phi i1 [ true, %5 ], [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %6
i32 9, label %6
]
2: ; preds = %1
%3 = add i32 %0, -10
%4 = icmp ult i32 %3, 4
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int do_send(int, char *, char const *, char const *);
int irc_op(int fd, const char *channel, const char *nick, char op) {
  if (op)
    return do_send(fd, "MODE %s +o %s", channel, nick);
  else
    return do_send(fd, "MODE %s -o %s", channel, nick);
}


x86 assembly (clang, -O0):
<irc_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
cmpb   $0x0,-0x19(%rbp)
je     1151 <irc_op+0x41>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebc(%rip),%rsi
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <irc_op+0x5b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1030 <do_send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_op>:
mov    %rdx,%rax
mov    %rsi,%rdx
test   %cl,%cl
lea    0xeef(%rip),%rcx
lea    0xeda(%rip),%rsi
cmove  %rcx,%rsi
mov    %rax,%rcx
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"MODE %s +o %s\00"
@.str.1 = [14 x i8] c"MODE %s -o %s\00"
define i32 @irc_op(i32 %0, i8* %1, i8* %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8 %3, i8* %9
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @do_send(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
store i32 %16, i32* %5
br label %22
17: ; preds = %4
%18 = load i32, i32* %6
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @do_send(i32 %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %12
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [14 x i8] c"MODE %s +o %s\00"
@.str.1 = [14 x i8] c"MODE %s -o %s\00"
define i32 @irc_op(i32 %0, i8* %1, i8* %2, i8 signext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @do_send(i32 %0, i8* %6, i8* %1, i8* %2)
ret i32 %7
}
/* Type definitions */
struct tupid_tree {
  int dummy;
};
struct tupid_entries {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tupid_entries_RB_REMOVE(struct tupid_entries *,
                                           struct tupid_tree *);
void tupid_tree_rm(struct tupid_entries *root, struct tupid_tree *tt) {
  tupid_entries_RB_REMOVE(root, tt);
}


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

x86 assembly (clang, -O2):
<tupid_tree_rm>:
jmp    1030 <tupid_entries_RB_REMOVE@plt>

LLVM IR (-O0):
%struct.tupid_entries = type { i32 }
%struct.tupid_tree = type { i32 }
define void @tupid_tree_rm(%struct.tupid_entries* %0, %struct.tupid_tree* %1) {
%3 = alloca %struct.tupid_entries*
%4 = alloca %struct.tupid_tree*
store %struct.tupid_entries* %0, %struct.tupid_entries** %3
store %struct.tupid_tree* %1, %struct.tupid_tree** %4
%5 = load %struct.tupid_entries*, %struct.tupid_entries** %3
%6 = load %struct.tupid_tree*, %struct.tupid_tree** %4
%7 = call i32 @tupid_entries_RB_REMOVE(%struct.tupid_entries* %5, %struct.tupid_tree* %6)
ret void
}

LLVM IR (-O2):
%struct.tupid_entries = type { i32 }
%struct.tupid_tree = type { i32 }
define void @tupid_tree_rm(%struct.tupid_entries* %0, %struct.tupid_tree* %1) {
%3 = tail call i32 @tupid_entries_RB_REMOVE(%struct.tupid_entries* %0, %struct.tupid_tree* %1)
ret void
}
__attribute__((no, noclone)) signed __int128 t114_4sub(signed __int128 x) {
  signed __int128 y = (-1);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t114_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t114_4sub+0x5e>
jmp    1175 <t114_4sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t114_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
adc    $0x0,%r14
jno    112b <t114_4sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t114_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t114_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
extern int MessageDisplay(const char *Message) {
  printf(">>> %s", Message);
  return (0);
}


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

x86 assembly (clang, -O2):
<MessageDisplay>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c">>> %s\00"
define i32 @MessageDisplay(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveFIFOEnable(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = ui32Config | 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveFIFOEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
or     $0x1,%ecx
mov    -0x4(%rbp),%eax
add    $0x804,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveFIFOEnable>:
or     $0x1,%esi
movslq %edi,%rax
mov    %esi,0x804(%rax)
ret

LLVM IR (-O0):
define void @I2CSlaveFIFOEnable(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 = or i32 %5, 1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2052
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @I2CSlaveFIFOEnable(i32 %0, i32 %1) {
%3 = or i32 %1, 1
%4 = add nsw i32 %0, 2052
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};
typedef long int64_t;

/* Variables and functions */
int64_t timespec_to_us64(struct timespec *ts) {
  return ts->tv_sec * 1000000L + ts->tv_nsec / 1000L;
}


x86 assembly (clang, -O0):
<timespec_to_us64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_us64>:
imul   $0xf4240,(%rdi),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x8(%rdi)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_us64(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 1000
%8 = add nsw i64 %7, %4
ret i64 %8
}
void gdk_visual_get_system() {}


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

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

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

LLVM IR (-O2):
define void @gdk_visual_get_system() {
ret void
}
/* Variables and functions */
int rand();
int rand_r(unsigned int *);
int my_rand_r(unsigned int *seedp) { return seedp ? rand_r(seedp) : rand(); }


x86 assembly (clang, -O0):
<my_rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <my_rand_r+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,-0xc(%rbp)
jmp    1152 <my_rand_r+0x32>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand_r>:
test   %rdi,%rdi
je     112a <my_rand_r+0xa>
jmp    1030 <rand_r@plt>
xor    %eax,%eax
jmp    1040 <rand@plt>

LLVM IR (-O0):
define i32 @my_rand_r(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @rand_r(i32* %6)
br label %10
8: ; preds = %1
%9 = call i32 (...) @rand()
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_rand_r(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @rand_r(i32* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @rand()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void analyze(char *peptide) { printf("peptide: %s\n", peptide); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"peptide: %s\0A\00"
define void @analyze(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int module_init() {
  printk("hello from test.sys\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"hello from test.sys\0A\00"
define i32 @module_init() {
%1 = call i32 @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"hello from test.sys\0A\00"
define i32 @module_init() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int funci(void) {
  { return (1); }
}


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

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

LLVM IR (-O0):
define i32 @funci() {
ret i32 1
}

LLVM IR (-O2):
define i32 @funci() {
ret i32 1
}
float LerpAngle(float from, float to, float frac) {
  if (to - from > 180) {
    to -= 360;
  }
  if (to - from < -180) {
    to += 360;
  }
  return from + frac * (to - from);
}


x86 assembly (clang, -O0):
<LerpAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xedb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1144 <LerpAngle+0x44>
movss  -0x8(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xeb2(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1171 <LerpAngle+0x71>
movss  0xe9d(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LerpAngle>:
movaps %xmm1,%xmm3
subss  %xmm0,%xmm3
movss  0xef1(%rip),%xmm4
addss  %xmm1,%xmm4
movss  0xee9(%rip),%xmm5
cmpltss %xmm3,%xmm5
andps  %xmm5,%xmm4
andnps %xmm1,%xmm5
orps   %xmm4,%xmm5
movaps %xmm5,%xmm1
subss  %xmm0,%xmm1
movaps %xmm5,%xmm3
addss  0xecd(%rip),%xmm3
cmpltss 0xec8(%rip),%xmm1
andps  %xmm1,%xmm3
andnps %xmm5,%xmm1
orps   %xmm3,%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @LerpAngle(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = fcmp ogt float %9, 1.800000e+02
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load float, float* %5
%13 = fsub float %12, 3.600000e+02
store float %13, float* %5
br label %14
14: ; preds = %11, %3
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fsub float %15, %16
%18 = fcmp olt float %17, -1.800000e+02
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load float, float* %5
%21 = fadd float %20, 3.600000e+02
store float %21, float* %5
br label %22
22: ; preds = %19, %14
%23 = load float, float* %4
%24 = load float, float* %6
%25 = load float, float* %5
%26 = load float, float* %4
%27 = fsub float %25, %26
%28 = call float @llvm.fmuladd.f32(float %24, float %27, float %23)
ret float %28
}

LLVM IR (-O2):
define float @LerpAngle(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fcmp ogt float %4, 1.800000e+02
%6 = fadd float %1, -3.600000e+02
%7 = select i1 %5, float %6, float %1
%8 = fsub float %7, %0
%9 = fcmp olt float %8, -1.800000e+02
%10 = fadd float %7, 3.600000e+02
%11 = select i1 %9, float %10, float %7
%12 = fsub float %11, %0
%13 = tail call float @llvm.fmuladd.f32(float %2, float %12, float %0)
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void hDpMatrixFree(double *arr, int len) { free(arr); }


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

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

LLVM IR (-O0):
define void @hDpMatrixFree(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = call i32 @free(double* %5)
ret void
}

LLVM IR (-O2):
define void @hDpMatrixFree(double* nocapture %0, i32 %1) {
%3 = tail call i32 @free(double* %0)
ret void
}
void genteq() {}


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

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

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

LLVM IR (-O2):
define void @genteq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redrawScreen();
void sigWinChCatcher(int signum) { redrawScreen(); }


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

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

LLVM IR (-O0):
define void @sigWinChCatcher(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @redrawScreen()
ret void
}

LLVM IR (-O2):
define void @sigWinChCatcher(i32 %0) {
%2 = tail call i32 (...) @redrawScreen()
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ time_t;
typedef int /*<<< orphan*/ out_msg;

/* Variables and functions */
int /*<<< orphan*/ _xmit(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
scalar_t__ time(int /*<<< orphan*/ *);
void _get_jobs(void) {
  time_t now = time(NULL);
  char out_msg[128];
  snprintf(out_msg, sizeof(out_msg), "TS=%u AUTH=root DT=%s", (uint32_t)now,
           "CMD=GETJOBS ARG=0:ALL");
  _xmit(out_msg);
}


x86 assembly (clang, -O0):
<_get_jobs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x80,%esi
lea    0xe9f(%rip),%rdx
lea    0xeae(%rip),%r8
call   1030 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <_xmit@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_jobs>:
push   %rbx
sub    $0x80,%rsp
xor    %edi,%edi
call   1050 <time@plt>
lea    0xeba(%rip),%rdx
lea    0xec9(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <_xmit@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"TS=%u AUTH=root DT=%s\00"
@.str.1 = [22 x i8] c"CMD=GETJOBS ARG=0:ALL\00"
define void @_get_jobs() {
%1 = alloca i64
%2 = alloca [128 x i8]
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i32 @_xmit(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"TS=%u AUTH=root DT=%s\00"
@.str.1 = [22 x i8] c"CMD=GETJOBS ARG=0:ALL\00"
define void @_get_jobs() {
%1 = alloca [128 x i8]
%2 = tail call i64 @time(i32* null)
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = trunc i64 %2 to i32
%5 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_xmit(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Thrd_Flush_Buffer(int, int);
unsigned int Thrd_Get_Bits1(int);
int Thrd_extra_bit_information(int t) {
  int Byte_Count;
  unsigned int tmp;
  {
    Byte_Count = 0;
    while (1) {
      tmp = Thrd_Get_Bits1(t);
      if (!tmp) {
        break;
      }
      Thrd_Flush_Buffer(t, 8);
      Byte_Count++;
    }
    return (Byte_Count);
  }
}


x86 assembly (clang, -O0):
<Thrd_extra_bit_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Thrd_Get_Bits1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114c <Thrd_extra_bit_information+0x2c>
jmp    1167 <Thrd_extra_bit_information+0x47>
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <Thrd_Flush_Buffer@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <Thrd_extra_bit_information+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thrd_extra_bit_information>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <Thrd_Get_Bits1@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     114a <Thrd_extra_bit_information+0x2a>
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <Thrd_Flush_Buffer@plt>
add    $0x1,%ebp
mov    %ebx,%edi
call   1030 <Thrd_Get_Bits1@plt>
test   %eax,%eax
jne    1130 <Thrd_extra_bit_information+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Thrd_extra_bit_information(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %1, %11
%6 = load i32, i32* %2
%7 = call i32 @Thrd_Get_Bits1(i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %5
br label %16
11: ; preds = %5
%12 = load i32, i32* %2
%13 = call i32 @Thrd_Flush_Buffer(i32 %12, i32 8)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @Thrd_extra_bit_information(i32 %0) {
%2 = tail call i32 @Thrd_Get_Bits1(i32 %0)
%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 @Thrd_Flush_Buffer(i32 %0, i32 8)
%7 = add nuw nsw i32 %5, 1
%8 = tail call i32 @Thrd_Get_Bits1(i32 %0)
%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
}
void foo466() {}


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

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

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

LLVM IR (-O2):
define void @foo466() {
ret void
}
int ChkDesIvLen(unsigned long len) {
  return len != 0 && len != (8) ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkDesIvLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <ChkDesIvLen+0x23>
cmpq   $0x8,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkDesIvLen>:
xor    %eax,%eax
test   $0xfffffffffffffff7,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ChkDesIvLen(i64 %0) {
%2 = and i64 %0, -9
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
void serverWrite(int fd, void *data) {
  printf("serverWrite on FD %d\n");
  send(fd, "123", 4, 0);
}


x86 assembly (clang, -O0):
<serverWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
lea    0xed1(%rip),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverWrite>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
lea    0xee0(%rip),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"serverWrite on FD %d\0A\00"
@.str.1 = [4 x i8] c"123\00"
define void @serverWrite(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintTree(int);
int main() {
  PrintTree(4);
  PrintTree(7);
  PrintTree(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <PrintTree@plt>
mov    $0x7,%edi
call   1030 <PrintTree@plt>
mov    $0xb,%edi
call   1030 <PrintTree@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PrintTree(i32 4)
%3 = call i32 @PrintTree(i32 7)
%4 = call i32 @PrintTree(i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PrintTree(i32 4)
%2 = tail call i32 @PrintTree(i32 7)
%3 = tail call i32 @PrintTree(i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "fsb_mpeg 0.12 by hcs\n"
                  "usage: fsb_mpeg file.fsb [-p N] [-b N]\n"
                  " -p N: assume up to N bytes of padding per frame\n"
                  " -b N: assume that streams are padded to N bytes\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [159 x i8] c"fsb_mpeg 0.12 by hcs\0Ausage: fsb_mpeg file.fsb [-p N] [-b N]\0A -p N: assume up to N bytes of padding per frame\0A -b N: assume that streams are padded to N bytes\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [159 x i8] c"fsb_mpeg 0.12 by hcs\0Ausage: fsb_mpeg file.fsb [-p N] [-b N]\0A -p N: assume up to N bytes of padding per frame\0A -b N: assume that streams are padded to N bytes\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int *);
void *t_smartplug(void *arg) {
  static int rval = 0;
  pthread_exit(&rval);
}


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

x86 assembly (clang, -O2):
<t_smartplug>:
lea    0x2f15(%rip),%rdi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
@t_smartplug.rval = internal global i32 0
define i8* @t_smartplug(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @pthread_exit(i32* @t_smartplug.rval)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
@t_smartplug.rval = internal global i32 0
define noalias i8* @t_smartplug(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* @t_smartplug.rval)
ret i8* undef
}
void *trace_nothing(register void *ptr, register long length) { return ptr; }


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

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

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

LLVM IR (-O2):
define i8* @trace_nothing(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Variables and functions */
intptr_t minptr(intptr_t a, intptr_t b) { return ((a) < (b) ? (a) : (b)); }


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

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

LLVM IR (-O0):
define i64 @minptr(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 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @minptr(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
#define DirectColor 133
#define GrayScale 132
#define PseudoColor 131
#define StaticColor 130
#define StaticGray 129
#define TrueColor 128
int VisualRank(int class) {
  switch (class) {
  case PseudoColor:
    return 5;
  case TrueColor:
    return 4;
  case DirectColor:
    return 3;
  case StaticColor:
    return 2;
  case GrayScale:
    return 1;
  case StaticGray:
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<VisualRank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1178 <VisualRank+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x4,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x3,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x2,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x0,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VisualRank>:
add    $0xffffff80,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <VisualRank+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @VisualRank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 131, label %5
i32 128, label %6
i32 133, label %7
i32 130, label %8
i32 132, label %9
i32 129, label %10
]
5: ; preds = %1
store i32 5, i32* %2
br label %12
6: ; preds = %1
store i32 4, i32* %2
br label %12
7: ; preds = %1
store i32 3, i32* %2
br label %12
8: ; preds = %1
store i32 2, i32* %2
br label %12
9: ; preds = %1
store i32 1, i32* %2
br label %12
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.VisualRank = [6 x i32] [i32 4, i32 0, i32 2, i32 5, i32 1, i32 3]
define i32 @VisualRank(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.VisualRank, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
struct ts_platform_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enable_irq_wake(unsigned int);
void board_enable_irq_wake(const struct ts_platform_data *pdata,
                           unsigned int irq) {
  enable_irq_wake(irq);
}


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

x86 assembly (clang, -O2):
<board_enable_irq_wake>:
mov    %esi,%edi
jmp    1030 <enable_irq_wake@plt>

LLVM IR (-O0):
%struct.ts_platform_data = type { i32 }
define void @board_enable_irq_wake(%struct.ts_platform_data* %0, i32 %1) {
%3 = alloca %struct.ts_platform_data*
%4 = alloca i32
store %struct.ts_platform_data* %0, %struct.ts_platform_data** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @enable_irq_wake(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ts_platform_data = type { i32 }
define void @board_enable_irq_wake(%struct.ts_platform_data* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @enable_irq_wake(i32 %1)
ret void
}
int test_imm_8Fint16_reg(short val) {
  return ((val) & (-0x8F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff71,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fint16_reg>:
test   $0xff71,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Fint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -143
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Fint16_reg(i16 signext %0) {
%2 = and i16 %0, -143
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a == 5)
    printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x8(%rbp)
jne    1158 <main+0x38>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,0x4(%rsp)
jne    114a <main+0x2a>
lea    0xec0(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void cgi_http_header_begin(const char *content_type) {
  printf("Content-type: %s\n", content_type);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Content-type: %s\0A\00"
define void @cgi_http_header_begin(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t func_count(void) { return 6; }


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

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

LLVM IR (-O0):
define i64 @func_count() {
ret i64 6
}

LLVM IR (-O2):
define i64 @func_count() {
ret i64 6
}
/* Variables and functions */
scalar_t__ iopl(int);
int EnableIO(void) {
  if (iopl(3) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<EnableIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <iopl@plt>
cmp    $0x0,%rax
jne    1138 <EnableIO+0x28>
movl   $0x1,-0x4(%rbp)
jmp    113f <EnableIO+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnableIO>:
push   %rax
mov    $0x3,%edi
call   1030 <iopl@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @EnableIO() {
%1 = tail call i64 @iopl(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int div_128(unsigned int *, unsigned int *);
int div_int(unsigned int *y, unsigned int x) {
  unsigned int z[4] = {0, 0, 0, 0};
  z[3] = x;
  return div_128(z, y);
}


x86 assembly (clang, -O0):
<div_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <div_128@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_int>:
sub    $0x18,%rsp
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %esi,0xc(%rsp)
mov    %rsp,%rdi
mov    %rax,%rsi
call   1030 <div_128@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @div_int(i32* %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
store i32 %1, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = call i32 @div_128(i32* %6, i32* %0)
ret i32 %7
}
/* Type definitions */
typedef void iam_lentry;
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int iam_lfix_entry_size(struct iam_leaf const *);
struct iam_lentry *iam_lfix_shift(const struct iam_leaf *l,
                                  struct iam_lentry *entry, int shift) {
  return (void *)entry + shift * iam_lfix_entry_size(l);
}


x86 assembly (clang, -O0):
<iam_lfix_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <iam_lfix_entry_size@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%rax
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iam_lfix_shift>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
call   1030 <iam_lfix_entry_size@plt>
imul   %ebx,%eax
cltq
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_lentry = type opaque
define %struct.iam_lentry* @iam_lfix_shift(%struct.iam_leaf* %0, %struct.iam_lentry* %1, i32 %2) {
%4 = alloca %struct.iam_leaf*
%5 = alloca %struct.iam_lentry*
%6 = alloca i32
store %struct.iam_leaf* %0, %struct.iam_leaf** %4
store %struct.iam_lentry* %1, %struct.iam_lentry** %5
store i32 %2, i32* %6
%7 = load %struct.iam_lentry*, %struct.iam_lentry** %5
%8 = bitcast %struct.iam_lentry* %7 to i8*
%9 = load i32, i32* %6
%10 = load %struct.iam_leaf*, %struct.iam_leaf** %4
%11 = call i32 @iam_lfix_entry_size(%struct.iam_leaf* %10)
%12 = mul nsw i32 %9, %11
%13 = sext i32 %12 to i64
%14 = getelementptr i8, i8* %8, i64 %13
%15 = bitcast i8* %14 to %struct.iam_lentry*
ret %struct.iam_lentry* %15
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_lentry = type opaque
define %struct.iam_lentry* @iam_lfix_shift(%struct.iam_leaf* %0, %struct.iam_lentry* readnone %1, i32 %2) {
%4 = bitcast %struct.iam_lentry* %1 to i8*
%5 = tail call i32 @iam_lfix_entry_size(%struct.iam_leaf* %0)
%6 = mul nsw i32 %5, %2
%7 = sext i32 %6 to i64
%8 = getelementptr i8, i8* %4, i64 %7
%9 = bitcast i8* %8 to %struct.iam_lentry*
ret %struct.iam_lentry* %9
}
/* Type definitions */
struct statvfs64 {
  int dummy;
};
struct statfs64 {
  int dummy;
};

/* Variables and functions */
int __fstatfs64(int, struct statfs64 *);
int fstatvfs64(int fd, struct statvfs64 *buf) {
  return __fstatfs64(fd, (struct statfs64 *)buf);
}


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

x86 assembly (clang, -O2):
<fstatvfs64>:
jmp    1030 <__fstatfs64@plt>

LLVM IR (-O0):
%struct.statvfs64 = type { i32 }
%struct.statfs64 = type { i32 }
define i32 @fstatvfs64(i32 %0, %struct.statvfs64* %1) {
%3 = alloca i32
%4 = alloca %struct.statvfs64*
store i32 %0, i32* %3
store %struct.statvfs64* %1, %struct.statvfs64** %4
%5 = load i32, i32* %3
%6 = load %struct.statvfs64*, %struct.statvfs64** %4
%7 = bitcast %struct.statvfs64* %6 to %struct.statfs64*
%8 = call i32 @__fstatfs64(i32 %5, %struct.statfs64* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.statvfs64 = type { i32 }
%struct.statfs64 = type { i32 }
define i32 @fstatvfs64(i32 %0, %struct.statvfs64* %1) {
%3 = bitcast %struct.statvfs64* %1 to %struct.statfs64*
%4 = tail call i32 @__fstatfs64(i32 %0, %struct.statfs64* %3)
ret i32 %4
}