xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcasecmp(char *, char const *);
char *strrchr(char const *, char);
int isFileOfType(const char *file, const char *type) {
  char *extension = strrchr(file, '.') + 1;
  if (extension == NULL || *extension == '\0') {
    return 0;
  }
  if (strcasecmp(extension, type) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isFileOfType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <isFileOfType+0x41>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116d <isFileOfType+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1197 <isFileOfType+0x77>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1190 <isFileOfType+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1197 <isFileOfType+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFileOfType>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
cmpb   $0x0,0x1(%rax)
je     1150 <isFileOfType+0x30>
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isFileOfType(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12, %2
store i32 0, i32* %3
br label %25
18: ; preds = %12
%19 = load i8*, i8** %6
%20 = load i8*, i8** %5
%21 = call i64 @strcasecmp(i8* %19, i8* %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 1, i32* %3
br label %25
24: ; preds = %18
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23, %17
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @isFileOfType(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i64 @strcasecmp(i8* %4, i8* %1)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ 0, %2 ], [ %10, %7 ]
ret i32 %12
}
unsigned short mod_N_p1(unsigned short a) {
  if (a > 624 - 1)
    return a - 624;
  else
    return a;
}


x86 assembly (clang, -O0):
<mod_N_p1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x26f,%eax
jle    112c <mod_N_p1+0x2c>
movzwl -0x4(%rbp),%eax
sub    $0x270,%eax
mov    %ax,-0x2(%rbp)
jmp    1134 <mod_N_p1+0x34>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_N_p1>:
lea    -0x270(%rdi),%eax
cmp    $0x270,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @mod_N_p1(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp sgt i32 %5, 623
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %9, 624
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
br label %14
12: ; preds = %1
%13 = load i16, i16* %3
store i16 %13, i16* %2
br label %14
14: ; preds = %12, %7
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @mod_N_p1(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 623
%3 = add i16 %0, -624
%4 = select i1 %2, i16 %3, i16 %0
ret i16 %4
}
int test_imm_25int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x25,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25int64_highword_mem>:
testb  $0x25,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 37
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_25int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 158913789952
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char z;
  z = getchar();
  while (z != EOF) {
    printf("%c", z);
    z = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116e <main+0x4e>
lea    0xeaa(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1157 <main+0x37>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
br label %4
4: ; preds = %10, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int fdd_sector_code_size(uint8_t code) { return (128 << code); }


x86 assembly (clang, -O0):
<fdd_sector_code_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x80,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdd_sector_code_size>:
mov    %edi,%ecx
mov    $0x80,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @fdd_sector_code_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 128, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @fdd_sector_code_size(i32 %0) {
%2 = shl i32 128, %0
ret i32 %2
}
void av_bsf_send_packet() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_send_packet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void drawThree(int y, int x) {
  mvaddch(y + 5, x + 2, 'O');
  mvaddch(y + 3, x + 6, 'O');
  mvaddch(y + 1, x + 10, 'O');
}


x86 assembly (clang, -O0):
<drawThree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x3,%edi
mov    -0x8(%rbp),%esi
add    $0x6,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0xa,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawThree>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x5(%rbx),%edi
lea    0x2(%r14),%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
lea    0x3(%rbx),%edi
lea    0x6(%r14),%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
add    $0x1,%ebx
add    $0xa,%r14d
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x4f,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <mvaddch@plt>

LLVM IR (-O0):
define void @drawThree(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 2
%9 = call i32 @mvaddch(i32 %6, i32 %8, i8 signext 79)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 6
%14 = call i32 @mvaddch(i32 %11, i32 %13, i8 signext 79)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 10
%19 = call i32 @mvaddch(i32 %16, i32 %18, i8 signext 79)
ret void
}

LLVM IR (-O2):
define void @drawThree(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 5
%4 = add nsw i32 %1, 2
%5 = tail call i32 @mvaddch(i32 %3, i32 %4, i8 signext 79)
%6 = add nsw i32 %0, 3
%7 = add nsw i32 %1, 6
%8 = tail call i32 @mvaddch(i32 %6, i32 %7, i8 signext 79)
%9 = add nsw i32 %0, 1
%10 = add nsw i32 %1, 10
%11 = tail call i32 @mvaddch(i32 %9, i32 %10, i8 signext 79)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "usage: chfreq [-hV] [-f format]\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 = [33 x i8] c"usage: chfreq [-hV] [-f format]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: chfreq [-hV] [-f format]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void get_barometer_sensordata(char *pchRcvDataFrame, int *iDataIdx,
                              struct sensor_value *sensorsdata) {
  return;
}


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

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

LLVM IR (-O0):
%struct.sensor_value = type opaque
define void @get_barometer_sensordata(i8* %0, i32* %1, %struct.sensor_value* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.sensor_value*
store i8* %0, i8** %4
store i32* %1, i32** %5
store %struct.sensor_value* %2, %struct.sensor_value** %6
ret void
}

LLVM IR (-O2):
%struct.sensor_value = type opaque
define void @get_barometer_sensordata(i8* nocapture %0, i32* nocapture %1, %struct.sensor_value* nocapture %2) {
ret void
}
unsigned long DRV_AT_GET_USER_EXIST_FLAG(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i64 @DRV_AT_GET_USER_EXIST_FLAG() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ funcall_in_loop(char *);
void call_funcall_in_loop(char *p) {
  funcall_in_loop(p);
  p[0] = 0;
}


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

x86 assembly (clang, -O2):
<call_funcall_in_loop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <funcall_in_loop@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @call_funcall_in_loop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @funcall_in_loop(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
define void @call_funcall_in_loop(i8* %0) {
%2 = tail call i32 @funcall_in_loop(i8* %0)
store i8 0, i8* %0
ret void
}
/* Type definitions */
struct t_relay_weechat_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ relay_weechat_msg_add_bytes(struct t_relay_weechat_msg *,
                                               char const *,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void relay_weechat_msg_add_type(struct t_relay_weechat_msg *msg,
                                const char *string) {
  if (string)
    relay_weechat_msg_add_bytes(msg, string, strlen(string));
}


x86 assembly (clang, -O0):
<relay_weechat_msg_add_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <relay_weechat_msg_add_type+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <relay_weechat_msg_add_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relay_weechat_msg_add_type>:
test   %rsi,%rsi
je     114b <relay_weechat_msg_add_type+0x2b>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <relay_weechat_msg_add_bytes@plt>
ret

LLVM IR (-O0):
%struct.t_relay_weechat_msg = type { i32 }
define void @relay_weechat_msg_add_type(%struct.t_relay_weechat_msg* %0, i8* %1) {
%3 = alloca %struct.t_relay_weechat_msg*
%4 = alloca i8*
store %struct.t_relay_weechat_msg* %0, %struct.t_relay_weechat_msg** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load %struct.t_relay_weechat_msg*, %struct.t_relay_weechat_msg** %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @relay_weechat_msg_add_bytes(%struct.t_relay_weechat_msg* %8, i8* %9, i32 %11)
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.t_relay_weechat_msg = type { i32 }
define void @relay_weechat_msg_add_type(%struct.t_relay_weechat_msg* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @relay_weechat_msg_add_bytes(%struct.t_relay_weechat_msg* %0, i8* %1, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ goredump();
int /*<<< orphan*/ gotrace(int /*<<< orphan*/);
void mill_preserve_debug(void) {
  static volatile int unoptimisable = 1;
  if (unoptimisable)
    return;
  goredump();
  gotrace(0);
}


x86 assembly (clang, -O0):
<mill_preserve_debug>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f06(%rip),%eax
cmp    $0x0,%eax
je     1138 <mill_preserve_debug+0x18>
jmp    1146 <mill_preserve_debug+0x26>
mov    $0x0,%al
call   1040 <goredump@plt>
xor    %edi,%edi
call   1030 <gotrace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_preserve_debug>:
push   %rax
cmpl   $0x0,0x2f08(%rip)
je     112c <mill_preserve_debug+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1040 <goredump@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <gotrace@plt>

LLVM IR (-O0):
@mill_preserve_debug.unoptimisable = internal global i32 1
define void @mill_preserve_debug() {
%1 = load volatile i32, i32* @mill_preserve_debug.unoptimisable
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %7
4: ; preds = %0
%5 = call i32 (...) @goredump()
%6 = call i32 @gotrace(i32 0)
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@mill_preserve_debug.unoptimisable = internal global i32 1
define void @mill_preserve_debug() {
%1 = load volatile i32, i32* @mill_preserve_debug.unoptimisable
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @goredump()
%5 = tail call i32 @gotrace(i32 0)
br label %6
6: ; preds = %0, %3
ret void
}
int fib(int k) {
  if (k == 0) {
    return 0;
  } else if (k == 1) {
    return 1;
  } else if (k >= 2) {
    return fib(k - 2) + fib(k - 1);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1183 <fib+0x73>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1183 <fib+0x73>
cmpl   $0x2,-0x8(%rbp)
jl     1179 <fib+0x69>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <fib+0x73>
jmp    117e <fib+0x6e>
jmp    1183 <fib+0x73>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
test   %ebx,%ebx
je     1143 <fib+0x33>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%ebx
je     113a <fib+0x2a>
jle    1141 <fib+0x31>
lea    -0x2(%rbx),%edi
call   1030 <fib@plt>
add    $0xffffffff,%ebx
add    %eax,%ebp
test   %ebx,%ebx
jne    1120 <fib+0x10>
jmp    1143 <fib+0x33>
mov    $0x1,%ebx
jmp    1143 <fib+0x33>
xor    %ebx,%ebx
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %11, %7 ]
%4 = phi i32 [ %0, %1 ], [ %10, %7 ]
switch i32 %4, label %5 [
i32 0, label %12
i32 1, label %14
]
5: ; preds = %2
%6 = icmp sgt i32 %4, 1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = add nsw i32 %4, -2
%9 = tail call i32 @fib(i32 %8)
%10 = add nsw i32 %4, -1
%11 = add nsw i32 %9, %3
br label %2
12: ; preds = %5, %2
%13 = phi i32 [ %4, %2 ], [ 0, %5 ]
br label %14
14: ; preds = %2, %12
%15 = phi i32 [ %13, %12 ], [ 1, %2 ]
%16 = add nsw i32 %15, %3
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[64];
  itob(-255, s, 8);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rsi
mov    $0xffffff01,%edi
mov    $0x8,%edx
call   1040 <itob@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    $0xffffff01,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <itob@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 -255, i8* %2, i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_regspace2_uniform(struct flashrom_flashctx *, int);
int printlock_regspace2_uniform_64k(struct flashrom_flashctx *flash) {
  return printlock_regspace2_uniform(flash, 64 * 1024);
}


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

x86 assembly (clang, -O2):
<printlock_regspace2_uniform_64k>:
mov    $0x10000,%esi
jmp    1030 <printlock_regspace2_uniform@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @printlock_regspace2_uniform(%struct.flashrom_flashctx* %3, i32 65536)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @printlock_regspace2_uniform(%struct.flashrom_flashctx* %0, i32 65536)
ret i32 %2
}
int kvm_cpu__configure_features(struct kvm_cpu *vcpu) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kvm_cpu = type opaque
define i32 @kvm_cpu__configure_features(%struct.kvm_cpu* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void **, void const *, int);
void *unpack_from_hptr(const void *v) {
  void *ptr;
  memcpy(&ptr, v, sizeof(void *));
  return ptr;
}


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

x86 assembly (clang, -O2):
<unpack_from_hptr>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @unpack_from_hptr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i8** %3, i8* %4, i32 8)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @unpack_from_hptr(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @memcpy(i8** %2, i8* %0, i32 8)
%5 = load i8*, i8** %2
ret i8* %5
}
void IN_Init_Cvars(void) {}


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

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

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

LLVM IR (-O2):
define void @IN_Init_Cvars() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ putlong(long, int);
void ft_putnbr_fd(int n, int fd) {
  long v;
  v = n;
  if (v < 0) {
    ft_putchar_fd('-', fd);
    v = -v;
  }
  putlong(v, fd);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1158 <ft_putnbr_fd+0x38>
mov    -0x8(%rbp),%esi
mov    $0x2d,%edi
call   1040 <ft_putchar_fd@plt>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <putlong@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %edi,%rbx
test   %ebx,%ebx
jns    113b <ft_putnbr_fd+0x1b>
mov    $0x2d,%edi
mov    %ebp,%esi
call   1040 <ft_putchar_fd@plt>
neg    %rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putlong@plt>

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @ft_putchar_fd(i8 signext 45, i32 %11)
%13 = load i64, i64* %5
%14 = sub nsw i64 0, %13
store i64 %14, i64* %5
br label %15
15: ; preds = %10, %2
%16 = load i64, i64* %5
%17 = load i32, i32* %4
%18 = call i32 @putlong(i64 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @ft_putchar_fd(i8 signext 45, i32 %1)
%7 = sub nsw i64 0, %3
br label %8
8: ; preds = %5, %2
%9 = phi i64 [ %7, %5 ], [ %3, %2 ]
%10 = tail call i32 @putlong(i64 %9, i32 %1)
ret void
}
void ignore_value(int i) { (void)i; }


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

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

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

LLVM IR (-O2):
define void @ignore_value(i32 %0) {
ret void
}
int sys$truncate(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(26), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$truncate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x1a,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$truncate>:
mov    $0x1a,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$truncate"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 26, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$truncate"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 26, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ bubblesort(int);
int /*<<< orphan*/ insertionsort(int);
int /*<<< orphan*/ quicksort(int /*<<< orphan*/, int);
int main() {
  quicksort(0, 9);
  bubblesort(10);
  insertionsort(10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <quicksort@plt>
mov    $0xa,%edi
call   1050 <bubblesort@plt>
mov    $0xa,%edi
call   1040 <insertionsort@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x9,%esi
call   1030 <quicksort@plt>
mov    $0xa,%edi
call   1050 <bubblesort@plt>
mov    $0xa,%edi
call   1040 <insertionsort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @quicksort(i32 0, i32 9)
%2 = call i32 @bubblesort(i32 10)
%3 = call i32 @insertionsort(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @quicksort(i32 0, i32 9)
%2 = tail call i32 @bubblesort(i32 10)
%3 = tail call i32 @insertionsort(i32 10)
ret i32 0
}
void roadmap_message_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_message_dummy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _flockfile_debug_stub(int /*<<< orphan*/ *, char *, int);
void _flockfile_debug(FILE *fp, char *fname, int lineno) {
  _flockfile_debug_stub(fp, fname, lineno);
}


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

x86 assembly (clang, -O2):
<_flockfile_debug>:
jmp    1030 <_flockfile_debug_stub@plt>

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

LLVM IR (-O2):
define void @_flockfile_debug(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_flockfile_debug_stub(i32* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
char *ch_ltoa(char *, long, int);
char *itoa(long val, char *s, int radix) { return ch_ltoa(s, val, radix); }


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

x86 assembly (clang, -O2):
<itoa>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <ch_ltoa@plt>

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

LLVM IR (-O2):
define i8* @itoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ch_ltoa(i8* %1, i64 %0, i32 %2)
ret i8* %4
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll29(struct __test_metadata *);
void wrapper_epoll29(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll29(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll29>:
jmp    1030 <epoll29@plt>

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

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll29(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll29(%struct.__test_metadata* %0)
ret void
}
int fne(float x, float y) {
  if (x != y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fne>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1128 <fne+0x28>
jp     1128 <fne+0x28>
jmp    1134 <fne+0x34>
movl   $0xd,-0x4(%rbp)
jmp    113b <fne+0x3b>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fne>:
ucomiss %xmm1,%xmm0
setp   %al
setne  %cl
or     %al,%cl
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fne(float %0, float %1) {
%3 = fcmp une float %0, %1
%4 = select i1 %3, i32 13, i32 140
ret i32 %4
}
void XGetSubImage() {}


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

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

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

LLVM IR (-O2):
define void @XGetSubImage() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *trim_string(char *str) {
  char *end;
  for (str = str; *str == ' '; str++)
    ;
  while ((end = strrchr(str, ' '))) {
    *end = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<trim_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114a <trim_string+0x3a>
jmp    1139 <trim_string+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <trim_string+0x14>
jmp    114f <trim_string+0x3f>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1177 <trim_string+0x67>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    114f <trim_string+0x3f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_string>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1120 <trim_string+0x10>
jmp    1133 <trim_string+0x23>
nopl   0x0(%rax)
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <trim_string+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trim_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %2
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %5
14: ; preds = %5
br label %15
15: ; preds = %19, %14
%16 = load i8*, i8** %2
%17 = call i8* @strrchr(i8* %16, i8 signext 32)
store i8* %17, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %3
store i8 0, i8* %20
br label %15
21: ; preds = %15
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @trim_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = tail call i8* @strrchr(i8* %3, i8 signext 32)
%9 = icmp eq i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %7, %10
%11 = phi i8* [ %12, %10 ], [ %8, %7 ]
store i8 0, i8* %11
%12 = tail call i8* @strrchr(i8* %3, i8 signext 32)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %10
14: ; preds = %10, %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void rtexit(const char *s) {
  fprintf(stderr, "Runtime error: %s. Aborting execution.\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<rtexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<rtexit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Runtime error: %s. Aborting execution.\0A\00"
define void @rtexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Runtime error: %s. Aborting execution.\0A\00"
define void @rtexit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ testMergeSort();
int main() {
  testMergeSort();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testMergeSort()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testMergeSort()
ret i32 0
}
int do_560() { return 560; }


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

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

LLVM IR (-O0):
define i32 @do_560() {
ret i32 560
}

LLVM IR (-O2):
define i32 @do_560() {
ret i32 560
}
int mainclient(cmd, message, serverhost, port, buffer, buffersize, maxrds)
int cmd;
char *message;
char *serverhost;
int port;
char *buffer;
int buffersize;
{
  sprintf(buffer, "%s",
          "HTTP/1.1 200 OK\n...\nContent-Length: 14082\nConnection: "
          "close\nContent-Type: text/html\n\n");
  return strlen(buffer);
}


x86 assembly (clang, -O0):
<mainclient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xeb4(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainclient>:
mov    %r8,%rdi
movups 0xf26(%rip),%xmm0
movups %xmm0,0x40(%r8)
movups 0xf0a(%rip),%xmm0
movups %xmm0,0x30(%r8)
movups 0xeee(%rip),%xmm0
movups %xmm0,0x20(%r8)
movups 0xed2(%rip),%xmm0
movups %xmm0,0x10(%r8)
movups 0xeb6(%rip),%xmm0
movups %xmm0,(%r8)
movabs $0xa0a6c6d74682f,%rax
mov    %rax,0x4e(%r8)
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [86 x i8] c"HTTP/1.1 200 OK\0A...\0AContent-Length: 14082\0AConnection: close\0AContent-Type: text/html\0A\0A\00"
define i32 @mainclient(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %12
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
%17 = load i8*, i8** %12
%18 = call i64 @strlen(i8* %17)
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [86 x i8] c"HTTP/1.1 200 OK\0A...\0AContent-Length: 14082\0AConnection: close\0AContent-Type: text/html\0A\0A\00"
define i32 @mainclient(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture %4, i32 %5, i32 %6) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(86) %4, i8* align 1 dereferenceable(86) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0), i64 86, i1 false)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%9 = trunc i64 %8 to i32
ret i32 %9
}
int getenv_int() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getenv_int() {
ret i32 0
}
void falFreeStringList() { return; }


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

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

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

LLVM IR (-O2):
define void @falFreeStringList() {
ret void
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_GetNodeProtocolInfo(int id) {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0x41;
  buf[2] = id;
  return SerialAPI_request(buf, 3);
}


x86 assembly (clang, -O0):
<ZW_GetNodeProtocolInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x110(%rbp)
movb   $0x41,-0x10f(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x10e(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_GetNodeProtocolInfo>:
sub    $0x108,%rsp
movw   $0x4100,(%rsp)
mov    %dil,0x2(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_GetNodeProtocolInfo(i32 %0) {
%2 = alloca i32
%3 = alloca [255 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 1
store i8 65, i8* %5
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 2
store i8 %7, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i32 @SerialAPI_request(i8* %9, i32 3)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ZW_GetNodeProtocolInfo(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 1
store i8 65, i8* %4
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 2
store i8 %5, i8* %6
%7 = call i32 @SerialAPI_request(i8* %3, i32 3)
ret i32 %7
}
/* Variables and functions */
char *vrna_db_pack(char const *);
char *pack_structure(const char *struc) { return vrna_db_pack(struc); }


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

x86 assembly (clang, -O2):
<pack_structure>:
jmp    1030 <vrna_db_pack@plt>

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

LLVM IR (-O2):
define i8* @pack_structure(i8* %0) {
%2 = tail call i8* @vrna_db_pack(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void _xte_platform_suspend_thread(int in_microseconds) {
  usleep(in_microseconds);
}


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

x86 assembly (clang, -O2):
<_xte_platform_suspend_thread>:
jmp    1030 <usleep@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @exit_file_handling() {
ret void
}