xunge/DecIR huggingface dataset:
long unsigned int f6(long unsigned int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i64 @f6(i64 returned %0) {
ret i64 %0
}
char isAlpha(char c) {
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <isAlpha+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jle    114b <isAlpha+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     113e <isAlpha+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jle    114b <isAlpha+0x4b>
movsbl -0x2(%rbp),%eax
cmp    $0x5f,%eax
jne    1154 <isAlpha+0x54>
movb   $0x1,-0x1(%rbp)
jmp    1158 <isAlpha+0x58>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlpha>:
lea    -0x41(%rdi),%ecx
mov    $0x1,%al
cmp    $0x1a,%cl
jb     111b <isAlpha+0x1b>
lea    -0x61(%rdi),%eax
cmp    $0x1a,%al
setb   %cl
cmp    $0x5f,%dil
sete   %al
or     %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @isAlpha(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 26
%7 = icmp eq i8 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %4, %1
%11 = phi i8 [ 1, %1 ], [ %9, %4 ]
ret i8 %11
}
int get_unsigned_bits(unsigned int num_values) {
  int cat = 0;
  if (num_values <= 1)
    return 0;
  num_values--;
  while (num_values > 0) {
    cat++;
    num_values >>= 1;
  }
  return cat;
}


x86 assembly (clang, -O0):
<get_unsigned_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
ja     1124 <get_unsigned_bits+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1154 <get_unsigned_bits+0x54>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    114e <get_unsigned_bits+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <get_unsigned_bits+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unsigned_bits>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <get_unsigned_bits+0x1c>
add    $0xffffffff,%edi
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <get_unsigned_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_unsigned_bits(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = add i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = lshr i32 %7, 1
%10 = icmp ult i32 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %12
}
void ignore_alarm(int sig) {}


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

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

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

LLVM IR (-O2):
define void @ignore_alarm(i32 %0) {
ret void
}
int qsortInts(const void *a, const void *b) {
  return *(const int *)a - *(const int *)b;
}


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

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

LLVM IR (-O0):
define i32 @qsortInts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @qsortInts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_EDuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xED << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EDuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 237
%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_EDuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1017907249152
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ corrupt_block(char *, int, int /*<<< orphan*/);
scalar_t__ mmalloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void test_corrupt() {
  char *p = (char *)mmalloc(40);
  strcpy(p, "testblockdata");
  corrupt_block(p, 40, 0);
}


x86 assembly (clang, -O0):
<test_corrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28,%edi
call   1050 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
xor    %edx,%edx
call   1040 <corrupt_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_corrupt>:
push   %rbx
mov    $0x28,%edi
call   1050 <mmalloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <corrupt_block@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"testblockdata\00"
define void @test_corrupt() {
%1 = alloca i8*
%2 = call i64 @mmalloc(i32 40)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @corrupt_block(i8* %6, i32 40, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"testblockdata\00"
define void @test_corrupt() {
%1 = tail call i64 @mmalloc(i32 40)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @corrupt_block(i8* %2, i32 40, i32 0)
ret void
}
/* Variables and functions */
size_t pad_size_to(size_t initial, size_t align) {
  if (initial <= align)
    return align;
  if ((initial % align) == 0)
    return initial;
  return initial + align - (initial % align);
}


x86 assembly (clang, -O0):
<pad_size_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     1127 <pad_size_to+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <pad_size_to+0x6d>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    114a <pad_size_to+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <pad_size_to+0x6d>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_size_to>:
cmp    %rsi,%rdi
jbe    1124 <pad_size_to+0x24>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1128 <pad_size_to+0x28>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
je     1133 <pad_size_to+0x33>
add    %rdi,%rsi
sub    %rdx,%rsi
mov    %rsi,%rax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    111e <pad_size_to+0x1e>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @pad_size_to(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = urem i64 %0, %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = add i64 %1, %0
%9 = sub i64 %8, %5
br label %10
10: ; preds = %4, %2, %7
%11 = phi i64 [ %9, %7 ], [ %1, %2 ], [ %0, %4 ]
ret i64 %11
}
/* Variables and functions */
int msrp_add_line(char *, char *, char *);
int msrp_add_messageid_line(char *buffer, char *messageid) {
  if (!buffer || !messageid)
    return -1;
  return msrp_add_line(buffer, "Message-ID: %s", messageid);
}


x86 assembly (clang, -O0):
<msrp_add_messageid_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <msrp_add_messageid_line+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <msrp_add_messageid_line+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <msrp_add_messageid_line+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <msrp_add_line@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msrp_add_messageid_line>:
test   %rdi,%rdi
je     1129 <msrp_add_messageid_line+0x19>
mov    %rsi,%rdx
test   %rsi,%rsi
je     1129 <msrp_add_messageid_line+0x19>
lea    0xedc(%rip),%rsi
jmp    1030 <msrp_add_line@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Message-ID: %s\00"
define i32 @msrp_add_messageid_line(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %16
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @msrp_add_line(i8* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"Message-ID: %s\00"
define i32 @msrp_add_messageid_line(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @msrp_add_line(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XA_CARDINAL;
int x_get_property(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, void **, int *);
int x_get_cardinal_property(Window window, Atom property,
                            unsigned long **prop_ret, int *nr_ret) {
  return x_get_property(window, XA_CARDINAL, property, sizeof(unsigned long),
                        (void **)prop_ret, nr_ret);
}


x86 assembly (clang, -O0):
<x_get_cardinal_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x8,%ecx
call   1030 <x_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_get_cardinal_property>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%ecx
jmp    1030 <x_get_property@plt>

LLVM IR (-O0):
@XA_CARDINAL = global i32 0
define i32 @x_get_cardinal_property(i32 %0, i32 %1, i64** %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64**
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64** %2, i64*** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* @XA_CARDINAL
%11 = load i32, i32* %6
%12 = load i64**, i64*** %7
%13 = bitcast i64** %12 to i8**
%14 = load i32*, i32** %8
%15 = call i32 @x_get_property(i32 %9, i32 %10, i32 %11, i32 8, i8** %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
@XA_CARDINAL = global i32 0
define i32 @x_get_cardinal_property(i32 %0, i32 %1, i64** %2, i32* %3) {
%5 = load i32, i32* @XA_CARDINAL
%6 = bitcast i64** %2 to i8**
%7 = tail call i32 @x_get_property(i32 %0, i32 %5, i32 %1, i32 8, i8** %6, i32* %3)
ret i32 %7
}
int fun1386() { return 1386; }


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

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

LLVM IR (-O0):
define i32 @fun1386() {
ret i32 1386
}

LLVM IR (-O2):
define i32 @fun1386() {
ret i32 1386
}
/* Variables and functions */
int /*<<< orphan*/ draw_map_sub(long, long, long, long, int /*<<< orphan*/);
void draw_map(long map_x, long map_y, long dx, long dy) {
  draw_map_sub(map_x, map_y, dx, dy, 0);
}


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

x86 assembly (clang, -O2):
<draw_map>:
xor    %r8d,%r8d
jmp    1030 <draw_map_sub@plt>

LLVM IR (-O0):
define void @draw_map(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @draw_map_sub(i64 %9, i64 %10, i64 %11, i64 %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @draw_map(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @draw_map_sub(i64 %0, i64 %1, i64 %2, i64 %3, i32 0)
ret void
}
fun(a, b) int a;
int b;
{ return a + b; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @fun(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 255; i++) {
    printf("%c -> %d", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
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)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c -> %d\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 = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c -> %d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int destroy_dlink();
int destroy_dlink_queue() { return destroy_dlink(); }


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

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

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

LLVM IR (-O2):
define i32 @destroy_dlink_queue() {
%1 = tail call i32 (...) @destroy_dlink()
ret i32 %1
}
/* Variables and functions */
scalar_t__ isnormal(double);
double force_normal(double x) { return isnormal(x) ? x : 0; }


x86 assembly (clang, -O0):
<force_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%rax
je     1140 <force_normal+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114d <force_normal+0x3d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114d <force_normal+0x3d>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_normal>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnormal@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     1128 <force_normal+0x18>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @force_normal(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isnormal(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi double [ %7, %6 ], [ 0.000000e+00, %8 ]
ret double %10
}

LLVM IR (-O2):
define double @force_normal(double %0) {
%2 = tail call i64 @isnormal(double %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, double 0.000000e+00, double %0
ret double %4
}
/* Variables and functions */
int copy_length_bits(int);
int copy_bits(int length) { return copy_length_bits(length) + 8 * length; }


x86 assembly (clang, -O0):
<copy_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <copy_length_bits@plt>
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_bits>:
push   %rbx
mov    %edi,%ebx
call   1030 <copy_length_bits@plt>
lea    (%rax,%rbx,8),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @copy_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @copy_length_bits(i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 8, %5
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @copy_bits(i32 %0) {
%2 = tail call i32 @copy_length_bits(i32 %0)
%3 = shl nsw i32 %0, 3
%4 = add nsw i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int _pack2(unsigned int, unsigned int);
short magnitude_fun_complexOf_short(unsigned int);
unsigned signum_fun_complexOf_short(unsigned a) {
  short m;
  if (a == 0) {
    return a;
  } else {
    m = magnitude_fun_complexOf_short(a);
    return _pack2((a >> 16) / m, (a & 0x0000ffff) / m);
  }
}


x86 assembly (clang, -O0):
<signum_fun_complexOf_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1140 <signum_fun_complexOf_short+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <signum_fun_complexOf_short+0x56>
mov    -0x8(%rbp),%edi
call   1040 <magnitude_fun_complexOf_short@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
movswl -0xa(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
movswl -0xa(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
call   1030 <_pack2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_complexOf_short>:
test   %edi,%edi
je     114b <signum_fun_complexOf_short+0x2b>
push   %rbx
mov    %edi,%ebx
call   1040 <magnitude_fun_complexOf_short@plt>
mov    %ebx,%ecx
shr    $0x10,%ecx
movswl %ax,%esi
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%edi
movzwl %bx,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_pack2@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @signum_fun_complexOf_short(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %23
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call signext i16 @magnitude_fun_complexOf_short(i32 %10)
store i16 %11, i16* %4
%12 = load i32, i32* %3
%13 = lshr i32 %12, 16
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
%16 = udiv i32 %13, %15
%17 = load i32, i32* %3
%18 = and i32 %17, 65535
%19 = load i16, i16* %4
%20 = sext i16 %19 to i32
%21 = udiv i32 %18, %20
%22 = call i32 @_pack2(i32 %16, i32 %21)
store i32 %22, i32* %2
br label %23
23: ; preds = %9, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @signum_fun_complexOf_short(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call signext i16 @magnitude_fun_complexOf_short(i32 %0)
%5 = lshr i32 %0, 16
%6 = sext i16 %4 to i32
%7 = udiv i32 %5, %6
%8 = and i32 %0, 65535
%9 = udiv i32 %8, %6
%10 = tail call i32 @_pack2(i32 %7, i32 %9)
br label %11
11: ; preds = %1, %3
%12 = phi i32 [ %10, %3 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_standard_read_system(int k) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(302, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_standard_read_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x12e,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_standard_read_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x12e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syspool_standard_read_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 302, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syspool_standard_read_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 302, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int SIGSEGV;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int signal) {
  if (signal == SIGSEGV) {
    printf("Segmentation fault capturado %d\n", signal);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    114c <signal_handler+0x2c>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    113a <signal_handler+0x1a>
mov    %edi,%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
@.str = [33 x i8] c"Segmentation fault capturado %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGSEGV
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@.str = [33 x i8] c"Segmentation fault capturado %d\0A\00"
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGSEGV
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
void cbir_skip_header(FILE *file) {
  int i, len = fgetc(file) * 256 + fgetc(file);
  for (i = 0; i < len - 2; i++)
    fgetc(file);
}


x86 assembly (clang, -O0):
<cbir_skip_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    116d <cbir_skip_header+0x5d>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <cbir_skip_header+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbir_skip_header>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%r14d
shl    $0x8,%r14d
mov    %rbx,%rdi
call   1030 <fgetc@plt>
lea    (%rax,%r14,1),%ebp
add    $0xfffffffe,%ebp
test   %ebp,%ebp
jle    114d <cbir_skip_header+0x3d>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
add    $0xffffffff,%ebp
jne    1140 <cbir_skip_header+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cbir_skip_header(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = shl nsw i32 %2, 8
%4 = tail call i32 @fgetc(i32* %0)
%5 = add i32 %4, -2
%6 = add i32 %5, %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1, %8
%9 = phi i32 [ %11, %8 ], [ 0, %1 ]
%10 = tail call i32 @fgetc(i32* %0)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %6
br i1 %12, label %13, label %8
13: ; preds = %8, %1
ret void
}
void my__builtin_va_end(__builtin_va_list arg0) { return; }


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

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

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @my__builtin_va_end(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @my__builtin_va_end(%struct.__va_list_tag* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned int pcg_rotr_32(unsigned int, unsigned int);
uint64_t pcg_output_xsl_rr_rr_64_64(uint64_t state) {
  uint32_t rot1 = (uint32_t)(state >> 59u);
  uint32_t high = (uint32_t)(state >> 32u);
  uint32_t low = (uint32_t)state;
  uint32_t xored = high ^ low;
  uint32_t newlow = pcg_rotr_32(xored, rot1);
  uint32_t newhigh = pcg_rotr_32(high, newlow & 31u);
  return (((uint64_t)newhigh) << 32u) | newlow;
}


x86 assembly (clang, -O0):
<pcg_output_xsl_rr_rr_64_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3b,%ecx
shr    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <pcg_rotr_32@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
and    $0x1f,%esi
call   1030 <pcg_rotr_32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_xsl_rr_rr_64_64>:
push   %rax
call   1030 <pcg_rotr_32@plt>
and    $0x1f,%eax
mov    %eax,%esi
pop    %rax
jmp    1030 <pcg_rotr_32@plt>

LLVM IR (-O0):
define i32 @pcg_output_xsl_rr_rr_64_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 59
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = lshr i32 %11, 32
store i32 %12, i32* %4
%13 = load i32, i32* %2
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = xor i32 %14, %15
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %3
%19 = call i32 @pcg_rotr_32(i32 %17, i32 %18)
store i32 %19, i32* %7
%20 = load i32, i32* %4
%21 = load i32, i32* %7
%22 = and i32 %21, 31
%23 = call i32 @pcg_rotr_32(i32 %20, i32 %22)
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = shl i32 %24, 32
%26 = load i32, i32* %7
%27 = or i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @pcg_output_xsl_rr_rr_64_64(i32 %0) {
%2 = tail call i32 @pcg_rotr_32(i32 poison, i32 poison)
%3 = and i32 %2, 31
%4 = tail call i32 @pcg_rotr_32(i32 poison, i32 %3)
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int lw_put_elem_hdr(uint8_t *dst, uint8_t type, uint16_t len) {
  *dst = type;
  *((uint16_t *)(dst + 1)) = htons(len);
  return 3;
}


x86 assembly (clang, -O0):
<lw_put_elem_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_put_elem_hdr>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,(%rdi)
mov    %edx,%edi
call   1030 <htons@plt>
mov    %eax,0x4(%rbx)
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lw_put_elem_hdr(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32, i32* %6
%10 = call i32 @htons(i32 %9)
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret i32 3
}

LLVM IR (-O2):
define i32 @lw_put_elem_hdr(i32* nocapture writeonly %0, i32 %1, i32 %2) {
store i32 %1, i32* %0
%4 = tail call i32 @htons(i32 %2)
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret i32 3
}
/* Variables and functions */
char *basename(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strdup(char const *);
void usage(const char *argv0) {
  fprintf(stderr,
          "usage: %s [OPTION] <filename>\n"
          "  -d <device file>     (default: /dev/pg_blitz0)\n"
          "  -l <map num pages>   (default: 16MB)\n"
          "  -o <map offset>      (default: 0)\n"
          "  -h                   print this message\n",
          basename(strdup(argv0)));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %eax,%edi
call   1040 <basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    (%rax),%ebx
call   1060 <strdup@plt>
mov    %eax,%edi
call   1040 <basename@plt>
lea    0xea3(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [197 x i8] c"usage: %s [OPTION] <filename>\0A -d <device file> (default: /dev/pg_blitz0)\0A -l <map num pages> (default: 16MB)\0A -o <map offset> (default: 0)\0A -h print this message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @strdup(i8* %4)
%6 = call i8* @basename(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [197 x i8] c"usage: %s [OPTION] <filename>\0A -d <device file> (default: /dev/pg_blitz0)\0A -l <map num pages> (default: 16MB)\0A -o <map offset> (default: 0)\0A -h print this message\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @strdup(i8* %0)
%4 = tail call i8* @basename(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long gu1_get_frame_buffer_size(void) { return (0x00400000); }


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

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

LLVM IR (-O0):
define i64 @gu1_get_frame_buffer_size() {
ret i64 4194304
}

LLVM IR (-O2):
define i64 @gu1_get_frame_buffer_size() {
ret i64 4194304
}
/* Variables and functions */
bool isPrime(int n) {
  int i;
  for (i = 3; i < n; i++)
    if (n % i == 0)
      return false;
  return true;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isPrime+0x50>
jmp    113b <isPrime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1120 <isPrime+0x20>
mov    $0x3,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 3
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 3, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void print_int16_t(int16_t m) { fprintf(stderr, "%d", m); }


x86 assembly (clang, -O0):
<print_int16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int16_t>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @print_int16_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @print_int16_t(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(void) {
  assert(5 < 4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
int test_function_pointer(struct test *test, int errval) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.test = type opaque
define i32 @test_function_pointer(%struct.test* nocapture readnone %0, i32 %1) {
ret i32 0
}
int isMatrixPart(char c) {
  if (c == '[')
    return 4;
  else if (c == ']')
    return 5;
  else if (c == ':' || c == ';')
    return 7;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isMatrixPart>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5b,%eax
jne    1123 <isMatrixPart+0x23>
movl   $0x4,-0x4(%rbp)
jmp    1169 <isMatrixPart+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x5d,%eax
jne    113c <isMatrixPart+0x3c>
movl   $0x5,-0x4(%rbp)
jmp    1169 <isMatrixPart+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
je     1156 <isMatrixPart+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
jne    1162 <isMatrixPart+0x62>
movl   $0x7,-0x4(%rbp)
jmp    1169 <isMatrixPart+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMatrixPart>:
cmp    $0x5b,%dil
je     1112 <isMatrixPart+0x12>
cmp    $0x5d,%dil
jne    1118 <isMatrixPart+0x18>
mov    $0x5,%eax
ret
mov    $0x4,%eax
ret
and    $0xfe,%dil
xor    %ecx,%ecx
cmp    $0x3a,%dil
mov    $0x7,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isMatrixPart(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 91
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4, i32* %2
br label %23
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 93
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 5, i32* %2
br label %23
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 58
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 59
br i1 %20, label %21, label %22
21: ; preds = %17, %13
store i32 7, i32* %2
br label %23
22: ; preds = %17
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21, %12, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @isMatrixPart(i8 signext %0) {
switch i8 %0, label %3 [
i8 91, label %7
i8 93, label %2
]
2: ; preds = %1
br label %7
3: ; preds = %1
%4 = and i8 %0, -2
%5 = icmp eq i8 %4, 58
%6 = select i1 %5, i32 7, i32 0
br label %7
7: ; preds = %3, %1, %2
%8 = phi i32 [ 5, %2 ], [ 4, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x2b() {
  Assert_real((isalpha(43) == 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_isalpha.c",
              220, ("isalpha should be 0 for +"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x2b>:
push   %rax
mov    $0x2b,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xdc,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for +\00"
define void @t_isalpha_0x2b() {
%1 = call i64 @isalpha(i32 43)
%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 220, i8* getelementptr inbounds ([26 x i8], [26 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for +\00"
define void @t_isalpha_0x2b() {
%1 = tail call i64 @isalpha(i32 43)
%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 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void range_except() {}


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

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

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

LLVM IR (-O2):
define void @range_except() {
ret void
}
int main() {
  int array[10];
  void init_array_1();
  void init_array_2();
  init_array_1(array);
  init_array_1(&array[0]);
  init_array_1(&array);
  init_array_2(array);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <init_array_1@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <init_array_1@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <init_array_1@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <init_array_2@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
ret i32 0
}