xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void occampi_rawnamenode_hook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


x86 assembly (clang, -O0):
<occampi_rawnamenode_hook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <occampi_rawnamenode_hook_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<occampi_rawnamenode_hook_free>:
test   %rdi,%rdi
je     111a <occampi_rawnamenode_hook_free+0xa>
jmp    1030 <sfree@plt>
ret

LLVM IR (-O0):
define void @occampi_rawnamenode_hook_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @occampi_rawnamenode_hook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void seatest_display_test(char *fixture_name, char *test_name) {
  if (test_name == NULL)
    return;
  printf("%s,%s\r\n", fixture_name, test_name);
}


x86 assembly (clang, -O0):
<seatest_display_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <seatest_display_test+0x20>
jmp    1144 <seatest_display_test+0x34>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seatest_display_test>:
mov    %rsi,%rdx
test   %rsi,%rsi
je     1127 <seatest_display_test+0x17>
mov    %rdi,%rsi
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s,%s\0D\0A\00"
define void @seatest_display_test(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ k(int);
int main(int argc, char **argv) {
  k(5);
  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    $0x5,%edi
call   1030 <k@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <k@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 @k(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @k(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stat_buf_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<stat_buf_free>:
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):
<stat_buf_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @stat_buf_free(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 @stat_buf_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
extern unsigned char get_bit_2(const unsigned char c) { return (c & 0x4) > 0; }


x86 assembly (clang, -O0):
<get_bit_2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_2>:
mov    %edi,%eax
shr    $0x2,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_bit_2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 4
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_bit_2(i8 zeroext %0) {
%2 = lshr i8 %0, 2
%3 = and i8 %2, 1
ret i8 %3
}
int test_imm_95uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 149
%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_95uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9764864
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ connect_sequence(char *, char *);
void main() {
  char *str0 = "abdbcc";
  char *str1 = "abc";
  connect_sequence(str0, str1);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
jmp    1030 <connect_sequence@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"abdbcc\00"
@.str.1 = [4 x i8] c"abc\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @connect_sequence(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"abdbcc\00"
@.str.1 = [4 x i8] c"abc\00"
define void @main() {
%1 = tail call i32 @connect_sequence(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int pipe(int pipefd[2]) {
  int result;
  asm("movl $42, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(pipefd));
  return result;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x2a,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2a,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 asm "movl $$42, %eax;int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @pipe(i32* readnone %0) {
%2 = tail call i32 asm "movl $$42, %eax;int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32* %0)
ret i32 %2
}
long random(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @random() {
ret i64 0
}

LLVM IR (-O2):
define i64 @random() {
ret i64 0
}
div2(signed short x) { return x / -1; }


x86 assembly (clang, -O0):
<div2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    $0xffffffff,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div2>:
mov    %edi,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @div2(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = sdiv i32 %4, -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @div2(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ backpage(int, int);
int /*<<< orphan*/ nextwind(int /*<<< orphan*/, int);
int prevwind(int /*<<< orphan*/, int);
int scrnextup(int f, int n) {
  nextwind(0, 1);
  backpage(f, n);
  return (prevwind(0, 1));
}


x86 assembly (clang, -O0):
<scrnextup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nextwind@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <backpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <prevwind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrnextup>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nextwind@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <backpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <prevwind@plt>

LLVM IR (-O0):
define i32 @scrnextup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @nextwind(i32 0, i32 1)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @backpage(i32 %6, i32 %7)
%9 = call i32 @prevwind(i32 0, i32 1)
ret i32 %9
}

LLVM IR (-O2):
define i32 @scrnextup(i32 %0, i32 %1) {
%3 = tail call i32 @nextwind(i32 0, i32 1)
%4 = tail call i32 @backpage(i32 %0, i32 %1)
%5 = tail call i32 @prevwind(i32 0, i32 1)
ret i32 %5
}
/* Type definitions */
struct vtxgrp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_vtxgrp(struct vtxgrp *grp) { free_object(63, (short *)grp); }


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

x86 assembly (clang, -O2):
<free_vtxgrp>:
mov    %rdi,%rsi
mov    $0x3f,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.vtxgrp = type { i32 }
define void @free_vtxgrp(%struct.vtxgrp* %0) {
%2 = alloca %struct.vtxgrp*
store %struct.vtxgrp* %0, %struct.vtxgrp** %2
%3 = load %struct.vtxgrp*, %struct.vtxgrp** %2
%4 = bitcast %struct.vtxgrp* %3 to i16*
%5 = call i32 @free_object(i32 63, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.vtxgrp = type { i32 }
define void @free_vtxgrp(%struct.vtxgrp* %0) {
%2 = bitcast %struct.vtxgrp* %0 to i16*
%3 = tail call i32 @free_object(i32 63, i16* %2)
ret void
}
char itox(int x) {
  if ((x >= 0) && (x <= 9)) {
    return '0' + (x - 0);
  } else if ((x >= 10) && (x <= 15)) {
    return 'A' + (x - 10);
  }
  return -1;
}


x86 assembly (clang, -O0):
<itox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112c <itox+0x2c>
cmpl   $0x9,-0x8(%rbp)
jg     112c <itox+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x0,%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    115a <itox+0x5a>
cmpl   $0xa,-0x8(%rbp)
jl     1151 <itox+0x51>
cmpl   $0xf,-0x8(%rbp)
jg     1151 <itox+0x51>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    115a <itox+0x5a>
jmp    1156 <itox+0x56>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itox>:
cmp    $0x9,%edi
ja     110b <itox+0xb>
add    $0x30,%dil
jmp    1119 <itox+0x19>
lea    -0xa(%rdi),%ecx
mov    $0xff,%al
cmp    $0x5,%ecx
ja     111b <itox+0x1b>
add    $0x37,%dil
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @itox(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 55
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ -1, %6 ]
ret i8 %13
}
/* Variables and functions */
int f330(int *);
int f331(int *p) { return f330(p); }


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

x86 assembly (clang, -O2):
<f331>:
jmp    1030 <f330@plt>

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

LLVM IR (-O2):
define i32 @f331(i32* %0) {
%2 = tail call i32 @f330(i32* %0)
ret i32 %2
}
int sci_is_adi_vaddr(unsigned long vaddr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sci_is_adi_vaddr(i64 %0) {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ObReferenceObjectByHandle(int Handle, int DesiredAccess, int ObjectType,
                              int AccessMode, int Object,
                              int HandleInformation) {
  {
    int tmp_ndt_13;
    tmp_ndt_13 = __VERIFIER_nondet_int();
    if (tmp_ndt_13 == 0) {
      goto switch_10_0;
    } else {
      goto switch_10_default;
      if (0) {
      switch_10_0:
        return (0);
      switch_10_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ObReferenceObjectByHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1145 <ObReferenceObjectByHandle+0x35>
jmp    114a <ObReferenceObjectByHandle+0x3a>
jmp    1156 <ObReferenceObjectByHandle+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115d <ObReferenceObjectByHandle+0x4d>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ObReferenceObjectByHandle>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ObReferenceObjectByHandle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%15 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %15, i32* %14
%16 = load i32, i32* %14
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %6
br label %22
19: ; preds = %6
br label %23
20: ; No predecessors!
br i1 false, label %21, label %24
21: ; preds = %20
br label %22
22: ; preds = %21, %18
store i32 0, i32* %7
br label %26
23: ; preds = %19
store i32 -1073741823, i32* %7
br label %26
24: ; preds = %20
br label %25
25: ; preds = %24
br label %26
26: ; preds = %22, %23, %25
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @ObReferenceObjectByHandle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 0, i32 -1073741823
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int STDIN_FILENO;
int setfds(fd_set *set) {
  FD_ZERO(set);
  FD_SET(STDIN_FILENO, set);
  return STDIN_FILENO + 1;
}


x86 assembly (clang, -O0):
<setfds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <FD_SET@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfds>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <FD_ZERO@plt>
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <FD_SET@plt>
mov    (%r14),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @setfds(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* @STDIN_FILENO
%6 = load i32*, i32** %2
%7 = call i32 @FD_SET(i32 %5, i32* %6)
%8 = load i32, i32* @STDIN_FILENO
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @setfds(i32* %0) {
%2 = tail call i32 @FD_ZERO(i32* %0)
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @FD_SET(i32 %3, i32* %0)
%5 = load i32, i32* @STDIN_FILENO
%6 = add nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void count_up_to_n(int n) {
  for (int i = 0; i < n; i++) {
    printf(">> %d\n", i + 1);
  }
}


x86 assembly (clang, -O0):
<count_up_to_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114e <count_up_to_n+0x3e>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <count_up_to_n+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_up_to_n>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114d <count_up_to_n+0x3d>
mov    %edi,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <count_up_to_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c">> %d\0A\00"
define void @count_up_to_n(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i32 %6, %0
br i1 %8, label %3, label %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
int get_XButtonEvent_x(void *_p) { return (int)((XButtonEvent *)_p)->x; }


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

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

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

LLVM IR (-O2):
define i32 @get_XButtonEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int);
int main() {
  printf("%d\n", reverse(1234578));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x12d692,%edi
call   1030 <reverse@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @reverse(i32 1234578)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void send_error(int status_code) {}


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

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

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

LLVM IR (-O2):
define void @send_error(i32 %0) {
ret void
}
unsigned ring_data_avail(unsigned size, unsigned head, unsigned tail) {
  if (head >= tail)
    return head - tail;
  else
    return size + head - tail;
}


x86 assembly (clang, -O0):
<ring_data_avail>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jb     1127 <ring_data_avail+0x27>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <ring_data_avail+0x33>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_data_avail>:
xor    %eax,%eax
sub    %edx,%esi
cmovb  %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ring_data_avail(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, %2
%5 = select i1 %4, i32 %0, i32 0
%6 = sub i32 %1, %2
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x8b() {
  Assert_real((ispunct(139) == 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_ispunct.c",
              700, ("ispunct should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8b\00"
define void @t_ispunct_0x8b() {
%1 = call i64 @ispunct(i32 139)
%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 700, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8b\00"
define void @t_ispunct_0x8b() {
%1 = tail call i64 @ispunct(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int utf8skip(char *str) {
  unsigned char s;
  s = (unsigned char)(unsigned int)(*str);
  if (s < 0x80)
    return 0;
  if ((s & 0xe0) == 0xc0) {
    return 1;
  }
  if ((s & 0xf0) == 0xe0) {
    return 2;
  }
  if ((s & 0xf8) == 0xf0) {
    return 3;
  }
  return -1;
}


x86 assembly (clang, -O0):
<utf8skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x80,%eax
jge    112d <utf8skip+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1194 <utf8skip+0x94>
movzbl -0x11(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    114d <utf8skip+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1194 <utf8skip+0x94>
movzbl -0x11(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    116d <utf8skip+0x6d>
movl   $0x2,-0x4(%rbp)
jmp    1194 <utf8skip+0x94>
movzbl -0x11(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    118d <utf8skip+0x8d>
movl   $0x3,-0x4(%rbp)
jmp    1194 <utf8skip+0x94>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8skip>:
movzbl (%rdi),%ecx
xor    %eax,%eax
test   %cl,%cl
js     110a <utf8skip+0xa>
ret
mov    %ecx,%edx
and    $0xffffffe0,%edx
mov    $0x1,%eax
cmp    $0xc0,%edx
je     1109 <utf8skip+0x9>
mov    %ecx,%edx
and    $0xfffffff0,%edx
mov    $0x2,%eax
cmp    $0xe0,%edx
je     1109 <utf8skip+0x9>
and    $0xfffffff8,%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
sete   %al
lea    -0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @utf8skip(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 128
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %32
13: ; preds = %1
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = and i32 %15, 224
%17 = icmp eq i32 %16, 192
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %32
19: ; preds = %13
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = and i32 %21, 240
%23 = icmp eq i32 %22, 224
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 2, i32* %2
br label %32
25: ; preds = %19
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = and i32 %27, 248
%29 = icmp eq i32 %28, 240
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 3, i32* %2
br label %32
31: ; preds = %25
store i32 -1, i32* %2
br label %32
32: ; preds = %31, %30, %24, %18, %12
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @utf8skip(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = icmp sgt i8 %2, -1
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = and i32 %3, 224
%7 = icmp eq i32 %6, 192
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = and i32 %3, 240
%10 = icmp eq i32 %9, 224
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = and i32 %3, 248
%13 = icmp eq i32 %12, 240
%14 = select i1 %13, i32 3, i32 -1
br label %15
15: ; preds = %11, %8, %5, %1
%16 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 2, %8 ], [ %14, %11 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The process ID is %d\n", (int)getpid());
  printf("The parent process ID is %d\n", (int)getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The process ID is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process ID is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 (...) @getppid()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The process ID is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process ID is %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 (...) @getppid()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned short array_uint16_be(const unsigned char data[]) {
  return (data[0] << 8) + data[1];
}


x86 assembly (clang, -O0):
<array_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_uint16_be>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @array_uint16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @array_uint16_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_menu() {
  printf("*************** Menu *******************\n");
  printf("* ps  chname  fork  switch  wait  exit *\n");
  printf("****************************************\n");
}


x86 assembly (clang, -O0):
<show_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"*************** Menu *******************\0A\00"
@.str.1 = [42 x i8] c"* ps chname fork switch wait exit *\0A\00"
@.str.2 = [42 x i8] c"****************************************\0A\00"
define i32 @show_menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@str = [41 x i8] c"*************** Menu *******************\00"
@str.3 = [41 x i8] c"* ps chname fork switch wait exit *\00"
@str.4 = [41 x i8] c"****************************************\00"
define i32 @show_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int errno;
int fork();
int main(int argc, char const *argv[]) {
  int pid;
  pid = fork();
  assert(pid == -1);
  pid = fork();
  assert(pid == -1);
  return errno;
}


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    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 (...) @fork()
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* @errno
ret i32 %17
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 (...) @fork()
%8 = icmp eq i32 %7, -1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i32, i32* @errno
ret i32 %11
}
unsigned int btrl_mem(char *base, int bitno) {
  unsigned char res;
  __asm__ __volatile__("btrl\t%2, %0\n\t"
                       "setc\t%1"
                       : "=m"(*base), "=q"(res)
                       : "r"(bitno));
  return res;
}


x86 assembly (clang, -O0):
<btrl_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
btr    %ecx,(%rax)
setb   %al
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btrl_mem>:
btr    %esi,(%rdi)
setb   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @btrl_mem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8 asm sideeffect "btrl\09$2, $0\0A\09setc\09$1", "=*m,=q,r,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %6, i32 %7)
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @btrl_mem(i8* %0, i32 %1) {
%3 = tail call i8 asm sideeffect "btrl\09$2, $0\0A\09setc\09$1", "=*m,=q,r,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i32 %1)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long long strtoull(char const *, char **, int);
unsigned long long module_libc_strtoull(const char *str, char **end, int base) {
  return strtoull(str, end, base);
}


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

x86 assembly (clang, -O2):
<module_libc_strtoull>:
jmp    1030 <strtoull@plt>

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

LLVM IR (-O2):
define i64 @module_libc_strtoull(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void format_output(int choice, char *argv2) {
  void print_help(void);
  void read_driver(char *);
  void write_driver(char *);
  switch (choice) {
  case -1:
    printf("Invalid command. Type gmem_test -help for details\n");
    return;
  case 1:
    print_help();
    return;
  case 2:
    read_driver(argv2);
    return;
  case 3:
    write_driver(argv2);
    return;
  }
}


x86 assembly (clang, -O0):
<format_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11aa <format_output+0x6a>
mov    -0x18(%rbp),%rax
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    11aa <format_output+0x6a>
call   1060 <print_help@plt>
jmp    11aa <format_output+0x6a>
mov    -0x10(%rbp),%rdi
call   1030 <read_driver@plt>
jmp    11aa <format_output+0x6a>
mov    -0x10(%rbp),%rdi
call   1050 <write_driver@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_output>:
add    $0x1,%edi
cmp    $0x4,%edi
ja     1164 <format_output+0x24>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xeb5(%rip),%rdi
jmp    1040 <puts@plt>
ret
jmp    1060 <print_help@plt>
mov    %rsi,%rdi
jmp    1030 <read_driver@plt>
mov    %rsi,%rdi
jmp    1050 <write_driver@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Invalid command. Type gmem_test -help for details\0A\00"
define void @format_output(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
switch i32 %5, label %13 [
i32 -1, label %6
i32 1, label %8
i32 2, label %9
i32 3, label %11
]
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = load i8*, i8** %4
br label %13
11: ; preds = %2
%12 = load i8*, i8** %4
br label %13
13: ; preds = %6, %8, %9, %11, %2
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c"Invalid command. Type gmem_test -help for details\00"
define void @format_output(i32 %0, i8* %1) {
switch i32 %0, label %8 [
i32 -1, label %3
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %2
tail call void @print_help()
br label %8
6: ; preds = %2
tail call void @read_driver(i8* %1)
br label %8
7: ; preds = %2
tail call void @write_driver(i8* %1)
br label %8
8: ; preds = %3, %5, %6, %7, %2
ret void
}
int getopt_l(argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<getopt_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_l>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @getopt_l(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @getopt_l(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int is_pow_of_2(uint32_t x) { return !(x & (x - 1)); }


x86 assembly (clang, -O0):
<is_pow_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_pow_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_pow_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned int getCONTROL();
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ setCONTROL(unsigned int);
void p5a() {
  unsigned int p5Status;
  print("p5 - try to generate a TLB exception\n");
  p5Status = getCONTROL();
  p5Status = p5Status | 0x00000001;
  setCONTROL(p5Status);
}


x86 assembly (clang, -O0):
<p5a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <print@plt>
mov    $0x0,%al
call   1030 <getCONTROL@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <setCONTROL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p5a>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1030 <getCONTROL@plt>
or     $0x1,%eax
mov    %eax,%edi
pop    %rax
jmp    1050 <setCONTROL@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"p5 - try to generate a TLB exception\0A\00"
define void @p5a() {
%1 = alloca i32
%2 = call i32 @print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getCONTROL()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = or i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @setCONTROL(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"p5 - try to generate a TLB exception\0A\00"
define void @p5a() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getCONTROL()
%3 = or i32 %2, 1
%4 = tail call i32 @setCONTROL(i32 %3)
ret void
}
void release_bus(void) {}


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

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

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

LLVM IR (-O2):
define void @release_bus() {
ret void
}
int bool_flip_flop() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bool_flip_flop() {
ret i32 0
}