xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *programName) {
  printf("\n Usage: %s [Integer: Child Number] [String: Name of the file] "
         "[Integer: 0 < # of times to retry accessing the file] [Integer: 0 < "
         "Sleep Time] \n\n",
         programName);
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"\0A Usage: %s [Integer: Child Number] [String: Name of the file] [Integer: 0 < # of times to retry accessing the file] [Integer: 0 < Sleep Time] \0A\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [146 x i8] c"\0A Usage: %s [Integer: Child Number] [String: Name of the file] [Integer: 0 < # of times to retry accessing the file] [Integer: 0 < Sleep Time] \0A\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t elapsed(uint32_t start_hi, uint32_t start_lo, uint32_t end_hi,
                 uint32_t end_lo) {
  uint64_t start = (((uint64_t)start_hi) << 32) | start_lo;
  uint64_t end = (((uint64_t)end_hi) << 32) | end_lo;
  return end - start;
}


x86 assembly (clang, -O0):
<elapsed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @elapsed(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = shl i32 %11, 32
%13 = load i32, i32* %6
%14 = or i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 %15, 32
%17 = load i32, i32* %8
%18 = or i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %10
%20 = load i32, i32* %9
%21 = sub nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @elapsed(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 poison
}
void SCC_close() {}


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

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

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

LLVM IR (-O2):
define void @SCC_close() {
ret void
}
/* Variables and functions */
scalar_t__ atomic_cmpset_long(long *, long, long);
long test_and_set_bit(long bit, long *var) {
  long val;
  bit = 1 << bit;
  do {
    val = *(volatile long *)var;
  } while (atomic_cmpset_long(var, val, val | bit) == 0);
  return !!(val & bit);
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
or     -0x8(%rbp),%rdx
call   1030 <atomic_cmpset_long@plt>
cmp    $0x0,%rax
je     1133 <test_and_set_bit+0x23>
mov    -0x18(%rbp),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%rbx
mov    %rbx,%rdx
or     %r15,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <atomic_cmpset_long@plt>
test   %rax,%rax
je     1130 <test_and_set_bit+0x20>
xor    %eax,%eax
test   %r15,%rbx
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @test_and_set_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
br label %10
10: ; preds = %13, %2
%11 = load i64*, i64** %4
%12 = load volatile i64, i64* %11
store i64 %12, i64* %5
br label %13
13: ; preds = %10
%14 = load i64*, i64** %4
%15 = load i64, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = or i64 %16, %17
%19 = call i64 @atomic_cmpset_long(i64* %14, i64 %15, i64 %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %10, label %21
21: ; preds = %13
%22 = load i64, i64* %5
%23 = load i64, i64* %3
%24 = and i64 %22, %23
%25 = icmp ne i64 %24, 0
%26 = xor i1 %25, true
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = sext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @test_and_set_bit(i64 %0, i64* %1) {
%3 = trunc i64 %0 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %6, %2
%7 = load volatile i64, i64* %1
%8 = or i64 %7, %5
%9 = tail call i64 @atomic_cmpset_long(i64* %1, i64 %7, i64 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6
%12 = and i64 %7, %5
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ CDROMEJECT;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd = open(argv[1], O_RDONLY);
  ioctl(fd, CDROMEJECT);
  close(fd);
  return (EXIT_SUCCESS);
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@CDROMEJECT = global i32 0
@EXIT_SUCCESS = 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 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* @CDROMEJECT
%14 = call i32 @ioctl(i32 %12, i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @close(i32 %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@CDROMEJECT = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* %4, i32 %5)
%7 = load i32, i32* @CDROMEJECT
%8 = tail call i32 @ioctl(i32 %6, i32 %7)
%9 = tail call i32 @close(i32 %6)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
void TurnRight(float degrees) {}


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

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

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

LLVM IR (-O2):
define void @TurnRight(float %0) {
ret void
}
void initializeBrogueSaveLocation() {}


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

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

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

LLVM IR (-O2):
define void @initializeBrogueSaveLocation() {
ret void
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t s2010_get_version(const uint16_t *p_s2010) {
  return (p_s2010[0] & 0x18) >> 3;
}


x86 assembly (clang, -O0):
<s2010_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x18,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2010_get_version>:
mov    (%rdi),%eax
shr    $0x3,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @s2010_get_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 24
%7 = ashr i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @s2010_get_version(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 3
%4 = and i32 %3, 3
ret i32 %4
}
/* Type definitions */
struct fmt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fmt *);
struct fmt *wav_free_fmt(struct fmt **fmt) {
  if (*fmt == NULL)
    return *fmt;
  free(*fmt);
  *fmt = NULL;
  return *fmt;
}


x86 assembly (clang, -O0):
<wav_free_fmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <wav_free_fmt+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <wav_free_fmt+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wav_free_fmt>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <wav_free_fmt+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.fmt = type { i32 }
define %struct.fmt* @wav_free_fmt(%struct.fmt** %0) {
%2 = alloca %struct.fmt*
%3 = alloca %struct.fmt**
store %struct.fmt** %0, %struct.fmt*** %3
%4 = load %struct.fmt**, %struct.fmt*** %3
%5 = load %struct.fmt*, %struct.fmt** %4
%6 = icmp eq %struct.fmt* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.fmt**, %struct.fmt*** %3
%9 = load %struct.fmt*, %struct.fmt** %8
store %struct.fmt* %9, %struct.fmt** %2
br label %17
10: ; preds = %1
%11 = load %struct.fmt**, %struct.fmt*** %3
%12 = load %struct.fmt*, %struct.fmt** %11
%13 = call i32 @free(%struct.fmt* %12)
%14 = load %struct.fmt**, %struct.fmt*** %3
store %struct.fmt* null, %struct.fmt** %14
%15 = load %struct.fmt**, %struct.fmt*** %3
%16 = load %struct.fmt*, %struct.fmt** %15
store %struct.fmt* %16, %struct.fmt** %2
br label %17
17: ; preds = %10, %7
%18 = load %struct.fmt*, %struct.fmt** %2
ret %struct.fmt* %18
}

LLVM IR (-O2):
%struct.fmt = type { i32 }
define noalias %struct.fmt* @wav_free_fmt(%struct.fmt** nocapture %0) {
%2 = load %struct.fmt*, %struct.fmt** %0
%3 = icmp eq %struct.fmt* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(%struct.fmt* %2)
store %struct.fmt* null, %struct.fmt** %0
br label %6
6: ; preds = %1, %4
ret %struct.fmt* null
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
float vec2_dot(float *, float *);
__attribute__((always_)) float psvec2_dot(struct vec2 *a, struct vec2 *b) {
  return vec2_dot((float *)a, (float *)b);
}


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

x86 assembly (clang, -O2):
<psvec2_dot>:
jmp    1030 <vec2_dot@plt>

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define float @psvec2_dot(%struct.vec2* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2*
%4 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2*, %struct.vec2** %3
%6 = bitcast %struct.vec2* %5 to float*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call float @vec2_dot(float* %6, float* %8)
ret float %9
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define float @psvec2_dot(%struct.vec2* %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call float @vec2_dot(float* %3, float* %4)
ret float %5
}
int frag_svc_seek(void *fh, long off, int whence) { return -1; }


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

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

LLVM IR (-O0):
define i32 @frag_svc_seek(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @frag_svc_seek(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Com_Memset(void *, int /*<<< orphan*/, unsigned long);
void *GetHunkMemory(unsigned long);
void *GetClearedHunkMemory(unsigned long size) {
  void *ptr;
  ptr = GetHunkMemory(size);
  Com_Memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<GetClearedHunkMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <GetHunkMemory@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <Com_Memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetClearedHunkMemory>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <GetHunkMemory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <Com_Memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @GetClearedHunkMemory(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @GetHunkMemory(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @Com_Memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @GetClearedHunkMemory(i64 %0) {
%2 = tail call i8* @GetHunkMemory(i64 %0)
%3 = tail call i32 @Com_Memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
void foo347() {}


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

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

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

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

/* Variables and functions */
int av_popcount_c(int /*<<< orphan*/);
int av_popcount64_c(uint64_t x) {
  return av_popcount_c((uint32_t)x) + av_popcount_c((uint32_t)(x >> 32));
}


x86 assembly (clang, -O0):
<av_popcount64_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <av_popcount_c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <av_popcount_c@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_popcount64_c>:
push   %rbx
call   1030 <av_popcount_c@plt>
mov    %eax,%ebx
call   1030 <av_popcount_c@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @av_popcount64_c(i32 %0) {
%2 = tail call i32 @av_popcount_c(i32 %0)
%3 = tail call i32 @av_popcount_c(i32 poison)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Type definitions */
struct input_absinfo {
  int maximum;
  int minimum;
  int resolution;
};

/* Variables and functions */
int abs_size_mm(const struct input_absinfo *absinfo) {
  return (absinfo->maximum - absinfo->minimum) / absinfo->resolution;
}


x86 assembly (clang, -O0):
<abs_size_mm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
cltd
idivl  0x8(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_size_mm>:
mov    (%rdi),%eax
sub    0x4(%rdi),%eax
cltd
idivl  0x8(%rdi)
ret

LLVM IR (-O0):
%struct.input_absinfo = type { i32, i32, i32 }
define i32 @abs_size_mm(%struct.input_absinfo* %0) {
%2 = alloca %struct.input_absinfo*
store %struct.input_absinfo* %0, %struct.input_absinfo** %2
%3 = load %struct.input_absinfo*, %struct.input_absinfo** %2
%4 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.input_absinfo*, %struct.input_absinfo** %2
%7 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
%10 = load %struct.input_absinfo*, %struct.input_absinfo** %2
%11 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %10, i32 0, i32 2
%12 = load i32, i32* %11
%13 = sdiv i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.input_absinfo = type { i32, i32, i32 }
define i32 @abs_size_mm(%struct.input_absinfo* nocapture %0) {
%2 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = sub nsw i32 %3, %5
%7 = getelementptr inbounds %struct.input_absinfo, %struct.input_absinfo* %0, i64 0, i32 2
%8 = load i32, i32* %7
%9 = sdiv i32 %6, %8
ret i32 %9
}
/* Variables and functions */
void *dlsym(void *handler, const char *symbol) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int __libc_close(int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
int __attribute__((weak)) close(int fd) {
  int result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_close(fd);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
call   1030 <__libc_close@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%edi
call   1030 <__libc_close@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%6 = call i32 @pthread_setcanceltype(i32 %5, i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @__libc_close(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @close(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%5 = call i32 @pthread_setcanceltype(i32 %4, i32* %2)
%6 = call i32 @__libc_close(i32 %0)
%7 = load i32, i32* %2
%8 = call i32 @pthread_setcanceltype(i32 %7, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xb6() {
  Assert_real((islower(182) == 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_islower.c",
              915, ("islower should be 0 for 0xb6"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x393,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb6\00"
define void @t_islower_0xb6() {
%1 = call i64 @islower(i32 182)
%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 915, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb6\00"
define void @t_islower_0xb6() {
%1 = tail call i64 @islower(i32 182)
%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 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long long L_sgn(double v) {
  if (v > 0.0)
    return (long long)1;
  if (v < 0.0)
    return (long long)-1;
  return (long long)0;
}


x86 assembly (clang, -O0):
<L_sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1128 <L_sgn+0x28>
movq   $0x1,-0x8(%rbp)
jmp    114b <L_sgn+0x4b>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1143 <L_sgn+0x43>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114b <L_sgn+0x4b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<L_sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %rcx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @L_sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i64
%5 = select i1 %2, i64 1, i64 %4
ret i64 %5
}
SP_CASE(imacro, imetamacro_take) {
  int total = __ii_idx_i(0, 10, 100) + __ii_idx_i(1, 10, 200);
  SP_TRUE(total == 321);
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x64,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0xc8,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x141,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
push   %rbx
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
add    %ebx,%eax
xor    %edi,%edi
cmp    $0x141,%eax
sete   %dil
xor    %eax,%eax
pop    %rbx
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 0, i32 10, i32 100)
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 1, i32 10, i32 200)
%9 = add nsw i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 321
%12 = zext i1 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 0, i32 10, i32 100)
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 1, i32 10, i32 200)
%5 = add nsw i32 %4, %3
%6 = icmp eq i32 %5, 321
%7 = zext i1 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %7)
ret i32 undef
}
int do_107() { return 107; }


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

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

LLVM IR (-O0):
define i32 @do_107() {
ret i32 107
}

LLVM IR (-O2):
define i32 @do_107() {
ret i32 107
}
long kernel__Int__succ(long self) {
  long var;
  long var1;
  var1 = self + 1;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Int__succ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Int__succ>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @kernel__Int__succ(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = add nsw i64 %5, 1
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @kernel__Int__succ(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
const char *str_stmt_goto() { return "goto"; }


x86 assembly (clang, -O0):
<str_stmt_goto>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"goto\00"
define i8* @str_stmt_goto() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"goto\00"
define i8* @str_stmt_goto() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int bs(int *, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int data1[] = {10, 12, 22, 25, 1, 5, 5, 6};
  int data2[] = {10, 12, 25, 2, 5, 5, 6};
  int data3[] = {10, 12, 25, 27, 33, 37, 2, 5, 5, 6};
  printf("smallest= %d\n", bs(data3, 10));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0xa,%esi
call   1030 <bs@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <bs@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.data1 = [8 x i32] [i32 10, i32 12, i32 22, i32 25, i32 1, i32 5, i32 5, i32 6]
@__const.main.data2 = [7 x i32] [i32 10, i32 12, i32 25, i32 2, i32 5, i32 5, i32 6]
@__const.main.data3 = [10 x i32] [i32 10, i32 12, i32 25, i32 27, i32 33, i32 37, i32 2, i32 5, i32 5, i32 6]
@.str = [14 x i8] c"smallest= %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca [7 x i32]
%3 = alloca [10 x i32]
%4 = bitcast [8 x i32]* %1 to i8*
%5 = bitcast [7 x i32]* %2 to i8*
%6 = bitcast [10 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%8 = call i32 @bs(i32* %7, i32 10)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data3 = [10 x i32] [i32 10, i32 12, i32 25, i32 27, i32 33, i32 37, i32 2, i32 5, i32 5, i32 6]
@.str = [14 x i8] c"smallest= %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @bs(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list {
  int dummy;
};
struct entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_prepend(struct genlist *, struct entry *);
void entry_list_prepend(struct entry_list *tthis, struct entry *pfoo) {
  genlist_prepend((struct genlist *)tthis, pfoo);
}


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

x86 assembly (clang, -O2):
<entry_list_prepend>:
jmp    1030 <genlist_prepend@plt>

LLVM IR (-O0):
%struct.entry_list = type { i32 }
%struct.entry = type { i32 }
%struct.genlist = type { i32 }
define void @entry_list_prepend(%struct.entry_list* %0, %struct.entry* %1) {
%3 = alloca %struct.entry_list*
%4 = alloca %struct.entry*
store %struct.entry_list* %0, %struct.entry_list** %3
store %struct.entry* %1, %struct.entry** %4
%5 = load %struct.entry_list*, %struct.entry_list** %3
%6 = bitcast %struct.entry_list* %5 to %struct.genlist*
%7 = load %struct.entry*, %struct.entry** %4
%8 = call i32 @genlist_prepend(%struct.genlist* %6, %struct.entry* %7)
ret void
}

LLVM IR (-O2):
%struct.entry_list = type { i32 }
%struct.entry = type { i32 }
%struct.genlist = type { i32 }
define void @entry_list_prepend(%struct.entry_list* %0, %struct.entry* %1) {
%3 = bitcast %struct.entry_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_prepend(%struct.genlist* %3, %struct.entry* %1)
ret void
}
/* Variables and functions */
char *c();
int main() {
  char *s = c();
  return s ? *s : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <c@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <main+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <main+0x41>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <main+0x41>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <c@plt>
test   %rax,%rax
je     1122 <main+0x12>
movsbl (%rax),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @c()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 1, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @c()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void reportOOBHeader() {
  printf("Error rate (1-acc), on neg examples (1-spec), and on pos examples "
         "(1-sens)\n");
  printf("%5s  %6s  %6s  %6s\n", "tree", "err", "negerr", "poserr");
}


x86 assembly (clang, -O0):
<reportOOBHeader>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
lea    0xf30(%rip),%rsi
lea    0xf31(%rip),%rdx
lea    0xf27(%rip),%rcx
lea    0xf27(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reportOOBHeader>:
push   %rax
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xeda(%rip),%rdx
lea    0xed0(%rip),%rcx
lea    0xed0(%rip),%r8
xor    %eax,%eax
pop    %r9
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Error rate (1-acc), on neg examples (1-spec), and on pos examples (1-sens)\0A\00"
@.str.1 = [20 x i8] c"%5s %6s %6s %6s\0A\00"
@.str.2 = [5 x i8] c"tree\00"
@.str.3 = [4 x i8] c"err\00"
@.str.4 = [7 x i8] c"negerr\00"
@.str.5 = [7 x i8] c"poserr\00"
define void @reportOOBHeader() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"%5s %6s %6s %6s\0A\00"
@.str.2 = [5 x i8] c"tree\00"
@.str.3 = [4 x i8] c"err\00"
@.str.4 = [7 x i8] c"negerr\00"
@.str.5 = [7 x i8] c"poserr\00"
@str = [75 x i8] c"Error rate (1-acc), on neg examples (1-spec), and on pos examples (1-sens)\00"
define void @reportOOBHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void writeMiddleTower(int n, int max) {
  printf("%d", n);
  if (n == max) {
    return;
  } else {
    writeMiddleTower(n + 1, max);
    printf("%d", n);
  }
}


x86 assembly (clang, -O0):
<writeMiddleTower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114e <writeMiddleTower+0x2e>
jmp    116b <writeMiddleTower+0x4b>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <writeMiddleTower@plt>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeMiddleTower>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %ebp,%ebx
jne    1140 <writeMiddleTower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0x1(%rbx),%edi
mov    %ebp,%esi
call   1040 <writeMiddleTower@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @writeMiddleTower(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %6
5: ; preds = %2, %6
ret void
6: ; preds = %2
%7 = add nsw i32 %0, 1
tail call void @writeMiddleTower(i32 %7, i32 %1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
}
int c002(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c002() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((no)) void foo(void) { printf("Foo()"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Foo()\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Foo()\00"
define void @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vcard_parse(char *);
int main() {
  vcard_parse((char *)"BEGIN:VCARD\n"
                      "VERSION:3.0\n"
                      "END:VCARD\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <vcard_parse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"BEGIN:VCARD\0AVERSION:3.0\0AEND:VCARD\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vcard_parse(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"BEGIN:VCARD\0AVERSION:3.0\0AEND:VCARD\0A\00"
define i32 @main() {
%1 = tail call i32 @vcard_parse(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: [options] send phoneNumber message\n"
                  "       [options] recv [raw]> msg.txt \n"
                  "       [options] status \n"
                  "       [options] delete msg_index | all\n"
                  "options:\n"
                  "\t-D /dev/ttyUSB1\n"
                  "\t-b 115200\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [183 x i8] c"usage: [options] send phoneNumber message\0A [options] recv [raw]> msg.txt \0A [options] status \0A [options] delete msg_index | all\0Aoptions:\0A\09-D /dev/ttyUSB1\0A\09-b 115200\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [183 x i8] c"usage: [options] send phoneNumber message\0A [options] recv [raw]> msg.txt \0A [options] status \0A [options] delete msg_index | all\0Aoptions:\0A\09-D /dev/ttyUSB1\0A\09-b 115200\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int from64tobits_fast(char *, char const *, int);
int from64tobits(char *out, const char *in) {
  char *cp = (char *)in;
  while (*cp != 0)
    cp += 4;
  return from64tobits_fast(out, in, cp - in);
}


x86 assembly (clang, -O0):
<from64tobits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <from64tobits+0x39>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <from64tobits+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <from64tobits_fast@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from64tobits>:
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x4(%rdx),%rdx
jne    1120 <from64tobits+0x10>
add    $0xfffffffc,%edx
jmp    1030 <from64tobits_fast@plt>

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

LLVM IR (-O2):
define i32 @from64tobits(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 4
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %1 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
%13 = tail call i32 @from64tobits_fast(i8* %0, i8* %1, i32 %12)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ outofmemory();
void *realloc(void *, size_t);
extern void *MyRealloc(void *x, size_t y) {
  void *ret = realloc(x, y);
  if (ret == NULL)
    outofmemory();
  return (ret);
}


x86 assembly (clang, -O0):
<MyRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <MyRealloc+0x33>
mov    $0x0,%al
call   1030 <outofmemory@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyRealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <MyRealloc+0x15>
xor    %eax,%eax
call   1030 <outofmemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @MyRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @outofmemory()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @MyRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @outofmemory()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
brc2(pn1, pn2, c) int pn1, pn2;
char c;
{ printf("%c[%d;%d%c", 27, pn1, pn2, c); }


x86 assembly (clang, -O0):
<brc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
movsbl -0xd(%rbp),%r8d
lea    0xecb(%rip),%rdi
mov    $0x1b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brc2>:
mov    %esi,%ecx
mov    %edi,%eax
movsbl %dl,%r8d
lea    0xee1(%rip),%rdi
mov    $0x1b,%esi
mov    %eax,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%c[%d;%d%c\00"
define i32 @brc2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = trunc i32 %2 to i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %8, i8* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 %9, i32 %10, i32 %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c[%d;%d%c\00"
define i32 @brc2(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 24
%5 = ashr exact i32 %4, 24
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0, i32 %1, i32 %5)
ret i32 undef
}