xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "whoami", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [7 x i8] c"whoami\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int len(char *arrname, char *type) { return sizeof(arrname) / sizeof(type); }


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @len(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
int main() {
  unsigned int x = 0x100 * 0x100;
  unsigned int y = 0x100 * 0x80;
  return x * y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x10000,-0x8(%rbp)
movl   $0x8000,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 65536, i32* %2
store i32 32768, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = mul i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -2147483648
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int major_opcode;
};
typedef TYPE_1__ XExtCodes;

/* Variables and functions */
void set_XExtCodes_major_opcode(void *_p, int _v) {
  ((XExtCodes *)_p)->major_opcode = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XExtCodes_major_opcode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XExtCodes_major_opcode(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void map_freeMap(struct map *m) {}


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

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

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

LLVM IR (-O2):
%struct.map = type opaque
define void @map_freeMap(%struct.map* nocapture %0) {
ret void
}
__attribute__((no)) void caller(int x) { return; }


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

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

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

LLVM IR (-O2):
define void @caller(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
__u8 hea_set_u8_bits(__u8 oval, __u8 nval, int start, int end) {
  return hea_set_u64_bits(oval, nval, start + 56, end + 56);
}


x86 assembly (clang, -O0):
<hea_set_u8_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x38,%edx
mov    -0x10(%rbp),%ecx
add    $0x38,%ecx
call   1030 <hea_set_u64_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_set_u8_bits>:
add    $0x38,%edx
add    $0x38,%ecx
jmp    1030 <hea_set_u64_bits@plt>

LLVM IR (-O0):
define i32 @hea_set_u8_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 56
%13 = load i32, i32* %8
%14 = add nsw i32 %13, 56
%15 = call i32 @hea_set_u64_bits(i32 %9, i32 %10, i32 %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @hea_set_u8_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 56
%6 = add nsw i32 %3, 56
%7 = tail call i32 @hea_set_u64_bits(i32 %0, i32 %1, i32 %5, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *message) {
  fprintf(stderr, "%s\n", message);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
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    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

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


x86 assembly (clang, -O0):
<return_command>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <unstack_frame@plt>
cmp    $0x0,%rax
jne    113f <return_command+0x1f>
mov    $0x4,%edi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_command>:
push   %rax
xor    %eax,%eax
call   1030 <unstack_frame@plt>
test   %rax,%rax
je     112f <return_command+0xf>
pop    %rax
ret
mov    $0x4,%edi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
define void @return_command() {
%1 = call i64 (...) @unstack_frame()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @error(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @return_command() {
%1 = tail call i64 (...) @unstack_frame()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}
int a_corner_pack(array_in)
int array_in[8];
{
  int corner, ii;
  corner = 0;
  for (ii = 6; ii >= 0; ii--)
    corner = 3 * corner + array_in[ii];
  return corner;
}


x86 assembly (clang, -O0):
<a_corner_pack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1140 <a_corner_pack+0x40>
imul   $0x3,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <a_corner_pack+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_corner_pack>:
mov    0x18(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x14(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x10(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0xc(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x8(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x4(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @a_corner_pack(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
%8 = mul nsw i32 %7, 3
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = mul nsw i32 %11, 3
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
%16 = mul nsw i32 %15, 3
%17 = getelementptr inbounds i32, i32* %0, i64 2
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %16
%20 = mul nsw i32 %19, 3
%21 = getelementptr inbounds i32, i32* %0, i64 1
%22 = load i32, i32* %21
%23 = add nsw i32 %22, %20
%24 = mul nsw i32 %23, 3
%25 = load i32, i32* %0
%26 = add nsw i32 %25, %24
ret i32 %26
}
int glutCreateWindow(const char *title) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @glutCreateWindow(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int pl011_putc(char);
void serial_putc(char ch) {
  int err;
  do {
    err = pl011_putc(ch);
  } while (err == -1);
  if (ch == '\n')
    serial_putc('\r');
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <pl011_putc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     112e <serial_putc+0xe>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    115b <serial_putc+0x3b>
mov    $0xd,%edi
call   1040 <serial_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movsbl %bl,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <pl011_putc@plt>
cmp    $0xffffffff,%eax
je     1120 <serial_putc+0x10>
cmp    $0xa,%bl
jne    114f <serial_putc+0x3f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <pl011_putc@plt>
cmp    $0xffffffff,%eax
je     1140 <serial_putc+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @serial_putc(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
br label %4
4: ; preds = %7, %1
%5 = load i8, i8* %2
%6 = call i32 @pl011_putc(i8 signext %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %4, label %10
10: ; preds = %7
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %10
br label %15
15: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @serial_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @pl011_putc(i8 signext %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = icmp eq i8 %0, 10
br i1 %6, label %7, label %10
7: ; preds = %5, %7
%8 = tail call i32 @pl011_putc(i8 signext 13)
%9 = icmp eq i32 %8, -1
br i1 %9, label %7, label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ getpid();
int /*<<< orphan*/ stderr;
void send_my_pid(void) {
  int pid = (int)getpid();
  fprintf(stderr, "\nEP-TEST-PID%d\n", pid);
}


x86 assembly (clang, -O0):
<send_my_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_my_pid>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edi
lea    0xec8(%rip),%rsi
mov    %eax,%edx
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\0AEP-TEST-PID%d\0A\00"
define void @send_my_pid() {
%1 = alloca i32
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* @stderr
%5 = load i32, i32* %1
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\0AEP-TEST-PID%d\0A\00"
define void @send_my_pid() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit(int, char *);
void promote(int type) {
  if (type == 1)
    emit(3, "\x0f\xbe\x00");
  else if (type == 2)
    emit(2, "\x8b\x00");
}


x86 assembly (clang, -O0):
<promote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113b <promote+0x2b>
mov    $0x3,%edi
lea    0xecf(%rip),%rsi
call   1030 <emit@plt>
jmp    115b <promote+0x4b>
cmpl   $0x2,-0x4(%rbp)
jne    1156 <promote+0x46>
mov    $0x2,%edi
lea    0xeb3(%rip),%rsi
call   1030 <emit@plt>
jmp    115b <promote+0x4b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promote>:
cmp    $0x2,%edi
je     112b <promote+0x1b>
cmp    $0x1,%edi
jne    113c <promote+0x2c>
lea    0xedf(%rip),%rsi
mov    $0x3,%edi
jmp    1030 <emit@plt>
lea    0xed2(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <emit@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0F\BE\00\00"
@.str.1 = [3 x i8] c"\8B\00\00"
define void @promote(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @emit(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @emit(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0F\BE\00\00"
@.str.1 = [3 x i8] c"\8B\00\00"
define void @promote(i32 %0) {
switch i32 %0, label %6 [
i32 1, label %2
i32 2, label %4
]
2: ; preds = %1
%3 = tail call i32 @emit(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %6
4: ; preds = %1
%5 = tail call i32 @emit(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %4, %2
ret void
}
double absf(double v) { return v < 0.0 ? -v : v; }


x86 assembly (clang, -O0):
<absf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <absf+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <absf+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absf>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @absf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @absf(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
void RTco_waitThread(__attribute__((unused)) int tid) {}


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

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

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

LLVM IR (-O2):
define void @RTco_waitThread(i32 %0) {
ret void
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_tree_internal(struct Node *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_tree(struct Node *root) {
  print_tree_internal(root, 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <print_tree_internal@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tree>:
push   %rax
xor    %esi,%esi
call   1040 <print_tree_internal@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @print_tree(%struct.Node* %0) {
%2 = tail call i32 @print_tree_internal(%struct.Node* %0, i32 0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert_should_fail();
int /*<<< orphan*/ test_assert_should_succeed();
int main() {
  test_assert_should_succeed();
  test_assert_should_fail();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_assert_should_succeed()
%2 = tail call i32 (...) @test_assert_should_fail()
ret i32 0
}
void g_allocator_new() {}


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

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

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

LLVM IR (-O2):
define void @g_allocator_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_message();
int /*<<< orphan*/ sprintf(int /*<<< orphan*/, char *);
int prefix_del(const char *ifname, int ifindex, const char *prefixPlain,
               int prefixLength) {
  sprintf(error_message(),
          "Prefix configuration on BSD systems not implemented yet.");
  return -12;
}


x86 assembly (clang, -O0):
<prefix_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <error_message@plt>
mov    %eax,%edi
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_del>:
push   %rax
xor    %eax,%eax
call   1030 <error_message@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_del(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 (...) @error_message()
%10 = call i32 @sprintf(i32 %9, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}

LLVM IR (-O2):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_del(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @error_message()
%6 = tail call i32 @sprintf(i32 %5, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xae() {
  Assert_real((isalnum(174) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              875, ("isalnum should be 0 for 0xae"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xae>:
push   %rax
mov    $0xae,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x36b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xae\00"
define void @t_isalnum_0xae() {
%1 = tail call i64 @isalnum(i32 174)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  int c = 0;
  for (; c < 1024; c++)
    printf("%d : %c\n", c, (char)c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    1156 <main+0x46>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
lea    0xec0(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d : %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 1024
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
float icsi_log(float val, register const float *lookup_table,
               register const int n) {
  union {
    int i;
    float fp;
  } u;
  u.fp = val;
  register int x = u.i;
  register const int log_2 = ((x >> 23) & 255) - 127;
  x &= 0x7FFFFF;
  x = x >> (23 - n);
  val = lookup_table[x];
  return ((val + log_2) * 0.69314718f);
}


x86 assembly (clang, -O0):
<icsi_log>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x17,%eax
and    $0xff,%eax
sub    $0x7f,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x7fffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x17,%ecx
sub    -0x14(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xe8c(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<icsi_log>:
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x17,%ecx
movzbl %cl,%edx
and    $0x7fffff,%eax
mov    $0x17,%cl
sub    %sil,%cl
shr    %cl,%eax
add    $0xffffff81,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
addss  (%rdi,%rax,4),%xmm0
mulss  0xed1(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @icsi_log(float %0, float* %1, i32 %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca i32
%7 = alloca %union.anon
%8 = alloca i32
%9 = alloca i32
store float %0, float* %4
store float* %1, float** %5
store i32 %2, i32* %6
%10 = load float, float* %4
%11 = bitcast %union.anon* %7 to float*
store float %10, float* %11
%12 = bitcast %union.anon* %7 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = ashr i32 %14, 23
%16 = and i32 %15, 255
%17 = sub nsw i32 %16, 127
store i32 %17, i32* %9
%18 = load i32, i32* %8
%19 = and i32 %18, 8388607
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = sub nsw i32 23, %21
%23 = ashr i32 %20, %22
store i32 %23, i32* %8
%24 = load float*, float** %5
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
store float %28, float* %4
%29 = load float, float* %4
%30 = load i32, i32* %9
%31 = sitofp i32 %30 to float
%32 = fadd float %29, %31
%33 = fmul float %32, 0x3FE62E4300000000
ret float %33
}

LLVM IR (-O2):
define float @icsi_log(float %0, float* nocapture %1, i32 %2) {
%4 = bitcast float %0 to i32
%5 = lshr i32 %4, 23
%6 = and i32 %5, 255
%7 = add nsw i32 %6, -127
%8 = and i32 %4, 8388607
%9 = sub nsw i32 23, %2
%10 = lshr i32 %8, %9
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds float, float* %1, i64 %11
%13 = load float, float* %12
%14 = sitofp i32 %7 to float
%15 = fadd float %13, %14
%16 = fmul float %15, 0x3FE62E4300000000
ret float %16
}
/* Variables and functions */
int getchar();
int read_s() {
  int i = 0;
  int c = getchar();
  while (c != '\n' && c != '\0') {
    c = getchar();
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<read_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1142 <read_s+0x32>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <read_s+0x42>
jmp    116a <read_s+0x5a>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <read_s+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1133 <read_s+0x23>
xchg   %ax,%ax
cmp    $0xa,%eax
je     1133 <read_s+0x23>
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%ebx
test   %eax,%eax
jne    1120 <read_s+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read_s() {
%1 = tail call i32 (...) @getchar()
br label %2
2: ; preds = %5, %0
%3 = phi i32 [ 0, %0 ], [ %7, %5 ]
%4 = phi i32 [ %1, %0 ], [ %6, %5 ]
switch i32 %4, label %5 [
i32 10, label %8
i32 0, label %8
]
5: ; preds = %2
%6 = tail call i32 (...) @getchar()
%7 = add nuw nsw i32 %3, 1
br label %2
8: ; preds = %2, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xde() {
  Assert_real((isodigit(222) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1115, ("isodigit should be 0 for 0xde"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xde\00"
define void @t_isodigit_0xde() {
%1 = tail call i64 @isodigit(i32 222)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1115, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ intern_merge_sort(int *, int /*<<< orphan*/, int, int *);
int *malloc(int);
void merge_sort(int *array, int size) {
  int *tmp = malloc(sizeof(*tmp) * size);
  intern_merge_sort(array, 0, size, tmp);
  free(tmp);
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1040 <intern_merge_sort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x0(,%r15,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
mov    %rax,%rcx
call   1040 <intern_merge_sort@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = load i32*, i32** %5
%14 = call i32 @intern_merge_sort(i32* %11, i32 0, i32 %12, i32* %13)
%15 = load i32*, i32** %5
%16 = call i32 @free(i32* %15)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @intern_merge_sort(i32* %0, i32 0, i32 %1, i32* %4)
%6 = tail call i32 @free(i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int LOG_DEBUG;
int LOG_ERR;
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void os_log(void *facility, int reason, const char *fmt, va_list ap) {
  if (fmt) {
    int prio = (reason == 1) ? LOG_ERR : LOG_DEBUG;
    vsyslog(prio | (int)facility, fmt, ap);
  }
}


x86 assembly (clang, -O0):
<os_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <os_log+0x63>
cmpl   $0x1,-0xc(%rbp)
jne    114c <os_log+0x3c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <os_log+0x48>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rax
or     %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_log>:
test   %rdx,%rdx
je     1123 <os_log+0x13>
cmp    $0x1,%esi
jne    1124 <os_log+0x14>
mov    0x2eaf(%rip),%rax
jmp    112b <os_log+0x1b>
ret
mov    0x2eb5(%rip),%rax
or     (%rax),%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@LOG_DEBUG = global i32 0
define void @os_log(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %28
12: ; preds = %4
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i32, i32* @LOG_ERR
br label %19
17: ; preds = %12
%18 = load i32, i32* @LOG_DEBUG
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = load i8*, i8** %5
%23 = ptrtoint i8* %22 to i32
%24 = or i32 %21, %23
%25 = load i8*, i8** %7
%26 = load i32, i32* %8
%27 = call i32 @vsyslog(i32 %24, i8* %25, i32 %26)
br label %28
28: ; preds = %19, %4
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@LOG_DEBUG = global i32 0
define void @os_log(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %2, null
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = icmp eq i32 %1, 1
%8 = load i32, i32* @LOG_ERR
%9 = load i32, i32* @LOG_DEBUG
%10 = select i1 %7, i32 %8, i32 %9
%11 = ptrtoint i8* %0 to i64
%12 = trunc i64 %11 to i32
%13 = or i32 %10, %12
%14 = tail call i32 @vsyslog(i32 %13, i8* %2, i32 %3)
br label %15
15: ; preds = %6, %4
ret void
}
int fun493() { return 493; }


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

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

LLVM IR (-O0):
define i32 @fun493() {
ret i32 493
}

LLVM IR (-O2):
define i32 @fun493() {
ret i32 493
}
int G__globalsetup() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @G__globalsetup() {
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_waddwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_waddwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_waddwstr+0x2a>
jmp    1170 <cmd_waddwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_waddwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_waddwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_waddwstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_waddwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void RTStrmReadEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmReadEx() {
ret void
}
/* Variables and functions */
double airMode3_d(double *);
double airMode3(double v0, double v1, double v2) {
  double v[3];
  v[0] = v0;
  v[1] = v1;
  v[2] = v2;
  return airMode3_d(v);
}


x86 assembly (clang, -O0):
<airMode3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <airMode3_d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<airMode3>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <airMode3_d@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @airMode3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca [3 x double]
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
store double %8, double* %9
%10 = load double, double* %5
%11 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 1
store double %10, double* %11
%12 = load double, double* %6
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 2
store double %12, double* %13
%14 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%15 = call double @airMode3_d(double* %14)
ret double %15
}

LLVM IR (-O2):
define double @airMode3(double %0, double %1, double %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
store double %0, double* %6
%7 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
store double %1, double* %7
%8 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
store double %2, double* %8
%9 = call double @airMode3_d(double* %6)
ret double %9
}
/* Type definitions */
typedef int uint32_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
void ms2ts(struct timespec *ts, uint32_t ms) {
  ts->tv_sec = ms / 1000;
  ts->tv_nsec = (ms % 1000) * 1000000;
}


x86 assembly (clang, -O0):
<ms2ts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms2ts>:
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rdi)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @ms2ts(%struct.timespec* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 1000
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = srem i32 %1, 1000
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int EINVAL;
int tzdev_migrate(void) { return -EINVAL; }


x86 assembly (clang, -O0):
<tzdev_migrate>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tzdev_migrate>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @tzdev_migrate() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @tzdev_migrate() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}
int test_imm_5Buint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x5B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Buint64_highword_reg>:
movabs $0x5b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Buint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 91
%6 = icmp ne i64 %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_5Buint64_highword_reg(i64 %0) {
%2 = and i64 %0, 390842023936
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTStrSimplePatternMultiMatch(void) {}


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

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

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

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