xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_memory(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free_memory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
islong(t) {
  if (t == 6)
    return (2);
  return (1);
}


x86 assembly (clang, -O0):
<islong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jne    111d <islong+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    1124 <islong+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islong>:
xor    %eax,%eax
cmp    $0x6,%edi
sete   %al
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @islong(i32 %0) {
%2 = icmp eq i32 %0, 6
%3 = select i1 %2, i32 2, i32 1
ret i32 %3
}
/* Type definitions */
struct event_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_free_items(struct event_t *);
int /*<<< orphan*/ free(struct event_t *);
void event_free(struct event_t *event) {
  if (!event)
    return;
  event_free_items(event);
  free(event);
}


x86 assembly (clang, -O0):
<event_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <event_free+0x1c>
jmp    114e <event_free+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <event_free_items@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_free>:
test   %rdi,%rdi
je     1137 <event_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1030 <event_free_items@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
ret

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

LLVM IR (-O2):
%struct.event_t = type { i32 }
define void @event_free(%struct.event_t* %0) {
%2 = icmp eq %struct.event_t* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @event_free_items(%struct.event_t* %0)
%5 = tail call i32 @free(%struct.event_t* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightStatusHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FlightStatusLogging() { UAVObjLogging(FlightStatusHandle()); }


x86 assembly (clang, -O0):
<FlightStatusLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FlightStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightStatusLogging>:
push   %rax
xor    %eax,%eax
call   1040 <FlightStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @FlightStatusLogging() {
%1 = call i32 (...) @FlightStatusHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightStatusLogging() {
%1 = tail call i32 (...) @FlightStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
unsigned char HWL_GPIO_PIN_READ(unsigned char pin) {
  return (((*((unsigned char *)((0xF80) + pin / 8))) >> (pin % 8)) & 0x01);
}


x86 assembly (clang, -O0):
<HWL_GPIO_PIN_READ>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0xf80,%eax
cltq
movzbl (%rax),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HWL_GPIO_PIN_READ>:
mov    %edi,%ecx
mov    %ecx,%eax
shr    $0x3,%al
movzbl %al,%eax
mov    0xf80(%rax),%al
and    $0x7,%cl
shr    %cl,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @HWL_GPIO_PIN_READ(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 8
%6 = add nsw i32 3968, %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = srem i32 %12, 8
%14 = ashr i32 %10, %13
%15 = and i32 %14, 1
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @HWL_GPIO_PIN_READ(i8 zeroext %0) {
%2 = lshr i8 %0, 3
%3 = zext i8 %2 to i64
%4 = or i64 %3, 3968
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
%7 = and i8 %0, 7
%8 = lshr i8 %6, %7
%9 = and i8 %8, 1
ret i8 %9
}
int get_group_column_index(int column, int group_size) {
  return (column / group_size);
}


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

x86 assembly (clang, -O2):
<get_group_column_index>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @get_group_column_index(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_group_column_index(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int parser_IsDigit(char c) {
  if (c >= '0' && c <= '9')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<parser_IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <parser_IsDigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <parser_IsDigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <parser_IsDigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_IsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @parser_IsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void test6(int i, char c) {
  int j;
  j = i;
  j = +i - i;
  j = i + i;
  j = -i + -3;
  j = -i - 0;
  j = +-3 - -2;
  j = -0 + i;
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
add    $0xfffffffd,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
sub    $0x0,%eax
mov    %eax,-0xc(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test6(i32 %0, i8 signext %1) {
ret void
}
/* Variables and functions */
int calculate_block_size_without_gaps_with_start_end_index(char *, int *, int,
                                                           int, int,
                                                           int /*<<< orphan*/,
                                                           int);
int calculate_block_size_without_gaps(char *child_sequence, int *snp_locations,
                                      int starting_coordinate,
                                      int ending_coordinate,
                                      int length_of_original_genome) {
  return calculate_block_size_without_gaps_with_start_end_index(
      child_sequence, snp_locations, starting_coordinate, ending_coordinate,
      length_of_original_genome, 0, length_of_original_genome);
}


x86 assembly (clang, -O0):
<calculate_block_size_without_gaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%eax
xor    %r9d,%r9d
mov    %eax,(%rsp)
call   1030 <calculate_block_size_without_gaps_with_start_end_index@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_block_size_without_gaps>:
push   %rax
mov    %r8d,(%rsp)
xor    %r9d,%r9d
call   1030 <calculate_block_size_without_gaps_with_start_end_index@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calculate_block_size_without_gaps(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %10
%17 = call i32 @calculate_block_size_without_gaps_with_start_end_index(i8* %11, i32* %12, i32 %13, i32 %14, i32 %15, i32 0, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @calculate_block_size_without_gaps(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @calculate_block_size_without_gaps_with_start_end_index(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 0, i32 %4)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int *test() {
  int *a2 = (int *)malloc(sizeof(int));
  *a2 = 10;
  if (*a2 > 5) {
    return a2;
  }
  int *b2 = (int *)malloc(sizeof(int));
  return b2;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
jle    114a <test+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <test+0x50>
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0xa,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @test() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
store i32 10, i32* %6
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 5
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32*, i32** %2
store i32* %11, i32** %1
br label %16
12: ; preds = %0
%13 = call i64 @malloc(i32 4)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %3
%15 = load i32*, i32** %3
store i32* %15, i32** %1
br label %16
16: ; preds = %12, %10
%17 = load i32*, i32** %1
ret i32* %17
}

LLVM IR (-O2):
define i32* @test() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 10, i32* %2
ret i32* %2
}
void foo() {
  int *p = 0;
  *p = 42;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int do_lsmod(int, char **);
int main(int argc, char *argv[]) { return do_lsmod(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <do_lsmod@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @do_lsmod(i32 %0, i8** %1)
ret i32 %3
}
int is_pin(int pin) { return (pin >= 0 && pin <= (16 - 1)); }


x86 assembly (clang, -O0):
<is_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_pin+0x20>
cmpl   $0xf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pin>:
xor    %eax,%eax
cmp    $0x10,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_pin(i32 %0) {
%2 = icmp ult i32 %0, 16
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long strlenctc(const char *string, char c) {
  unsigned long n, retval = 0;
  for (n = 0; string[n] != 0; n++) {
    if (string[n] == c) {
      retval = n;
      break;
    }
  }
  return retval;
}


x86 assembly (clang, -O0):
<strlenctc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116e <strlenctc+0x6e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1158 <strlenctc+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    116e <strlenctc+0x6e>
jmp    115d <strlenctc+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <strlenctc+0x1e>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlenctc>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <strlenctc+0x22>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %sil,%cl
je     1124 <strlenctc+0x24>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strlenctc+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlenctc(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %12, %9 ], [ %3, %2 ]
%7 = phi i64 [ %10, %9 ], [ 0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i64 [ 0, %2 ], [ %7, %5 ], [ 0, %9 ]
ret i64 %15
}
void state_gameover_render() {}


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

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

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

LLVM IR (-O2):
define void @state_gameover_render() {
ret void
}
/* Type definitions */
typedef int u32Reg;

/* Variables and functions */
unsigned int RIU_READ_2BYTE(int);
unsigned int SC_R4BYTE(unsigned int u32Reg) {
  return RIU_READ_2BYTE((0x130000 + ((u32Reg)&0xFFFF)) << 1) |
         ((unsigned int)(RIU_READ_2BYTE((0x130000 + ((u32Reg)&0xFFFF) + 2)
                                        << 1))
          << 16);
}


x86 assembly (clang, -O0):
<SC_R4BYTE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
add    $0x130000,%edi
shl    $0x1,%edi
call   1030 <RIU_READ_2BYTE@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
add    $0x130000,%edi
add    $0x2,%edi
shl    $0x1,%edi
call   1030 <RIU_READ_2BYTE@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC_R4BYTE>:
push   %rbp
push   %rbx
push   %rax
movzwl %di,%ebx
add    %ebx,%ebx
lea    0x260000(%rbx),%edi
call   1030 <RIU_READ_2BYTE@plt>
mov    %eax,%ebp
add    $0x260004,%ebx
mov    %ebx,%edi
call   1030 <RIU_READ_2BYTE@plt>
shl    $0x10,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SC_R4BYTE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = add i32 1245184, %4
%6 = shl i32 %5, 1
%7 = call i32 @RIU_READ_2BYTE(i32 %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 65535
%10 = add i32 1245184, %9
%11 = add i32 %10, 2
%12 = shl i32 %11, 1
%13 = call i32 @RIU_READ_2BYTE(i32 %12)
%14 = shl i32 %13, 16
%15 = or i32 %7, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @SC_R4BYTE(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 131070
%4 = or i32 %3, 2490368
%5 = tail call i32 @RIU_READ_2BYTE(i32 %4)
%6 = add nuw nsw i32 %3, 2490372
%7 = tail call i32 @RIU_READ_2BYTE(i32 %6)
%8 = shl i32 %7, 16
%9 = or i32 %8, %5
ret i32 %9
}
int toi_checksum_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toi_checksum_init() {
ret i32 0
}
/* Variables and functions */
int stk_httpd_main(int /*<<< orphan*/, int, char **);
int main(int argc, char *argv[]) { return stk_httpd_main(0, argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <stk_httpd_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @stk_httpd_main(i32 0, i32 %0, i8** %1)
ret i32 %3
}
char *procprt_VSIZE_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    0K";
}


x86 assembly (clang, -O0):
<procprt_VSIZE_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_VSIZE_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_VSIZE_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int32_t mq_errno(void) {
  int32_t tmp = errno;
  return (tmp <= 0) ? tmp : -tmp;
}


x86 assembly (clang, -O0):
<mq_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1125 <mq_errno+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <mq_errno+0x2d>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%eax
neg    %eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @mq_errno() {
%1 = alloca i32
%2 = load i32, i32* @errno
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @mq_errno() {
%1 = load i32, i32* @errno
%2 = tail call i32 @llvm.abs.i32(i32 %1, i1 false)
%3 = sub i32 0, %2
ret i32 %3
}
/* Variables and functions */
char *wceex_getenv(const char *varname) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @wceex_getenv(i8* nocapture readnone %0) {
ret i8* null
}
char *putn(n)
register n;
{ return (itoa(n, -1)); }


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

x86 assembly (clang, -O2):
<putn>:
push   %rax
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1030 <itoa@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @putn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @itoa to i32 (i32, i32, ...)*)(i32 %3, i32 -1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @putn(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @itoa to i32 (i32, i32, ...)*)(i32 %0, i32 -1)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void tegra_throttle_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_throttle_exit() {
ret void
}
int test_imm_FDuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 253
%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_FDuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 253
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unlink(char const *);
void cleanEnd(int soc, const char *path) {
  close(soc);
  unlink(path);
  printf("Server down\n");
}


x86 assembly (clang, -O0):
<cleanEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanEnd>:
push   %rbx
mov    %rsi,%rbx
call   1050 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
lea    0xeb8(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Server down\0A\00"
define void @cleanEnd(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 @close(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @unlink(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Server down\00"
define void @cleanEnd(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @unlink(i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
double check2(double x) { return __builtin_copysign(1.0, x); }


x86 assembly (clang, -O0):
<check2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
movaps 0xef0(%rip),%xmm1
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check2>:
andps  0xef9(%rip),%xmm0
orps   0xf02(%rip),%xmm0
ret

LLVM IR (-O0):
define double @check2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.copysign.f64(double 1.000000e+00, double %3)
ret double %4
}

LLVM IR (-O2):
define double @check2(double %0) {
%2 = tail call double @llvm.copysign.f64(double 1.000000e+00, double %0)
ret double %2
}
int benchmark_initrun() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @benchmark_initrun() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ tone(int, float, long);
void ZowiTone(int speakerPin, float noteFrequency, long noteDuration,
              int silentDuration) {
  tone(speakerPin, noteFrequency, noteDuration);
  delay(noteDuration);
  delay(silentDuration);
}


x86 assembly (clang, -O0):
<ZowiTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
call   1040 <tone@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <delay@plt>
mov    -0x14(%rbp),%edi
call   1030 <delay@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZowiTone>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <tone@plt>
mov    %ebx,%edi
call   1030 <delay@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @ZowiTone(i32 %0, float %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load i64, i64* %7
%12 = call i32 @tone(i32 %9, float %10, i64 %11)
%13 = load i64, i64* %7
%14 = trunc i64 %13 to i32
%15 = call i32 @delay(i32 %14)
%16 = load i32, i32* %8
%17 = call i32 @delay(i32 %16)
ret void
}

LLVM IR (-O2):
define void @ZowiTone(i32 %0, float %1, i64 %2, i32 %3) {
%5 = tail call i32 @tone(i32 %0, float %1, i64 %2)
%6 = trunc i64 %2 to i32
%7 = tail call i32 @delay(i32 %6)
%8 = tail call i32 @delay(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x83() {
  Assert_real((isalnum(131) == 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",
              660, ("isalnum should be 0 for 0x83"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x83>:
push   %rax
mov    $0x83,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x294,%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 0x83\00"
define void @t_isalnum_0x83() {
%1 = call i64 @isalnum(i32 131)
%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 660, 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 0x83\00"
define void @t_isalnum_0x83() {
%1 = tail call i64 @isalnum(i32 131)
%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 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __merge_sort(int *, int *, int /*<<< orphan*/, int, int);
void merge_sort(int arr[], int len) { __merge_sort(arr, arr, 0, len - 1, len); }


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r8d
xor    %edx,%edx
call   1030 <__merge_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
mov    %esi,%r8d
lea    -0x1(%r8),%ecx
mov    %rdi,%rsi
xor    %edx,%edx
jmp    1030 <__merge_sort@plt>

LLVM IR (-O0):
define void @merge_sort(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** %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = call i32 @__merge_sort(i32* %5, i32* %6, i32 0, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @__merge_sort(i32* %0, i32* %0, i32 0, i32 %3, i32 %1)
ret void
}
long long bit57() { return 0x0200000000000000LL; }


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

x86 assembly (clang, -O2):
<bit57>:
movabs $0x200000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit57() {
ret i64 144115188075855872
}

LLVM IR (-O2):
define i64 @bit57() {
ret i64 144115188075855872
}
/* Variables and functions */
int /*<<< orphan*/ odd_ones(unsigned int);
int even_ones(unsigned x) { return !odd_ones(x); }


x86 assembly (clang, -O0):
<even_ones>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <odd_ones@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<even_ones>:
push   %rax
call   1030 <odd_ones@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @even_ones(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @odd_ones(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @even_ones(i32 %0) {
%2 = tail call i32 @odd_ones(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int system(char *);
int runfork(char *cmd) { return system(cmd); }


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

x86 assembly (clang, -O2):
<runfork>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @runfork(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
int StatCovMomentInt(int *, int *, int, int, int, int);
double StatCovInt(int a[], int b[], int n, int s) {
  return StatCovMomentInt(a, b, n, s, 1, 1) / (n - 1);
}


x86 assembly (clang, -O0):
<StatCovInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentInt@plt>
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCovInt>:
push   %rbx
mov    %edx,%ebx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentInt@plt>
add    $0xffffffff,%ebx
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatCovInt(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 = load i32, i32* %8
%13 = call i32 @StatCovMomentInt(i32* %9, i32* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load i32, i32* %7
%15 = sub nsw i32 %14, 1
%16 = sdiv i32 %13, %15
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @StatCovInt(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @StatCovMomentInt(i32* %0, i32* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = add nsw i32 %2, -1
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ printf(char *);
void fun(int signo) {
  if (signo == SIGINT)
    printf("recv SIGINT\n");
  if (signo == 40)
    printf("recv from driver msg_key!\n");
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <fun+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x28,-0x4(%rbp)
jne    114f <fun+0x3f>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
cmp    %edi,(%rax)
jne    112a <fun+0x1a>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x28,%ebx
jne    113c <fun+0x2c>
lea    0xeca(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [13 x i8] c"recv SIGINT\0A\00"
@.str.1 = [27 x i8] c"recv from driver msg_key!\0A\00"
define void @fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 40
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [26 x i8] c"recv from driver msg_key!\00"
@str.2 = [12 x i8] c"recv SIGINT\00"
define void @fun(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = icmp eq i32 %0, 40
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_general();
int /*<<< orphan*/ test_split();
int main(int argc, char **argv) {
  test_general();
  test_split();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_general()
%7 = call i32 (...) @test_split()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_general()
%4 = tail call i32 (...) @test_split()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ra;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, ...);
int test(int n, int ra[5][100]) {
  printf("sizeof(ra) = %d.  sizeof(*ra) = %d\n", sizeof(ra), sizeof(*ra));
  if (sizeof(ra) != sizeof(int *)) {
    printf("Error %d\n", (int)11);
    exit(11);
  };
  if (sizeof(*ra) != 100 * sizeof(int)) {
    printf("Error %d\n", (int)12);
    exit(12);
  };
  return n;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x8,%esi
mov    $0x190,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    $0x190,%edx
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"sizeof(ra) = %d. sizeof(*ra) = %d\0A\00"
define i32 @test(i32 %0, [100 x i32]* %1) {
%3 = alloca i32
%4 = alloca [100 x i32]*
store i32 %0, i32* %3
store [100 x i32]* %1, [100 x i32]** %4
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 8, i64 400)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [36 x i8] c"sizeof(ra) = %d. sizeof(*ra) = %d\0A\00"
define i32 @test(i32 returned %0, [100 x i32]* nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 8, i64 400)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_aw(void) { m68ki_write_8(EA_AW_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_aw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AW_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_aw>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AW_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ flock(int /*<<< orphan*/, int /*<<< orphan*/);
void filelock_release(FILE *lockfile) {
  flock(fileno(lockfile), LOCK_UN);
  fclose(lockfile);
}


x86 assembly (clang, -O0):
<filelock_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
call   1050 <flock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelock_release>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fileno@plt>
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <flock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@LOCK_UN = global i32 0
define void @filelock_release(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = load i32, i32* @LOCK_UN
%6 = call i32 @flock(i32 %4, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@LOCK_UN = global i32 0
define void @filelock_release(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = load i32, i32* @LOCK_UN
%4 = tail call i32 @flock(i32 %2, i32 %3)
%5 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[], char *envp[]) {
  printf("\nIN Hello2\n");
  while (1)
    ;
  int pid = fork();
  if (pid == 0) {
    printf("In child Hello2\n");
    char *args[] = {"bin/ps", NULL};
    char *en[] = {"PATH=/rootfs/bin", "CWD=/rootfs", NULL};
    execve("bin/ps", args, en);
  } else {
    waitpid(pid, 0, 0);
    printf("Back in hello2 parent pid: %d\n", getpid());
  }
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1138 <main+0x28>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [11 x i8] c"\0AIN Hello2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int UNUSED_argc __attribute__((__unused__)),
         char **UNUSED_argv __attribute__((__unused__))) {
  printf("%s, %s! \n", "Hello", "World");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xec6(%rip),%rsi
lea    0xec5(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
lea    0xeda(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s, %s! \0A\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [6 x i8] c"World\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s, %s! \0A\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [6 x i8] c"World\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void KeepMe(void) {}


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

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

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

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