xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void ref_int16_t(int16_t arg, int16_t *result) { *result = arg; }


x86 assembly (clang, -O0):
<ref_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_int16_t>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ref_int16_t(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
/* Type definitions */
typedef int int_least32_t;

/* Variables and functions */
scalar_t__ foo();
int_least32_t fn10(void) {
  if (foo())
    return 1732984;
  else if (foo())
    return 18409;
  return 0;
}


x86 assembly (clang, -O0):
<fn10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
je     1135 <fn10+0x25>
movl   $0x1a7178,-0x4(%rbp)
jmp    115e <fn10+0x4e>
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
je     1152 <fn10+0x42>
movl   $0x47e9,-0x4(%rbp)
jmp    115e <fn10+0x4e>
jmp    1157 <fn10+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn10>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <foo@plt>
mov    %rax,%rcx
mov    $0x1a7178,%eax
test   %rcx,%rcx
je     1129 <fn10+0x19>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <foo@plt>
test   %rax,%rax
mov    $0x47e9,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fn10() {
%1 = alloca i32
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1732984, i32* %1
br label %11
5: ; preds = %0
%6 = call i64 (...) @foo()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 18409, i32* %1
br label %11
9: ; preds = %5
br label %10
10: ; preds = %9
store i32 0, i32* %1
br label %11
11: ; preds = %10, %8, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn10() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @foo()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 18409
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1732984, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void reverse_uint8_t(uint8_t *it, uint8_t *end) {
  uint8_t tmp;
  while (it < end) {
    tmp = *it;
    --end;
    *it++ = *end;
    *end = tmp;
  }
}


x86 assembly (clang, -O0):
<reverse_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1154 <reverse_uint8_t+0x54>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    110c <reverse_uint8_t+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_uint8_t>:
cmp    %rsi,%rdi
jae    1128 <reverse_uint8_t+0x28>
add    $0xfffffffffffffffc,%rsi
nopl   0x0(%rax)
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
add    $0x4,%rdi
mov    %eax,(%rsi)
lea    -0x4(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <reverse_uint8_t+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_uint8_t(i32* %0, i32* %1) {
%3 = icmp ult i32* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32* [ %10, %4 ], [ %0, %2 ]
%6 = phi i32* [ %8, %4 ], [ %1, %2 ]
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %6, i64 -1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %9, i32* %5
store i32 %7, i32* %8
%11 = icmp ult i32* %10, %8
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int calcParallaxY(int camY, int y, char layer) {
  long dy = y - camY;
  return (camY) + ((dy - 32) / layer + 32);
}


x86 assembly (clang, -O0):
<calcParallaxY>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x20,%rax
movsbq -0x9(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    $0x20,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcParallaxY>:
mov    %edx,%ecx
sub    %edi,%esi
movslq %esi,%rax
add    $0xffffffffffffffe0,%rax
movslq %edx,%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1125 <calcParallaxY+0x25>
cqto
idiv   %rsi
add    %edi,%eax
add    $0x20,%eax
ret
xor    %edx,%edx
div    %ecx
add    %edi,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @calcParallaxY(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %7
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = load i64, i64* %7
%15 = sub nsw i64 %14, 32
%16 = load i8, i8* %6
%17 = sext i8 %16 to i64
%18 = sdiv i64 %15, %17
%19 = add nsw i64 %18, 32
%20 = add nsw i64 %13, %19
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @calcParallaxY(i32 %0, i32 %1, i8 signext %2) {
%4 = sub nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, -32
%7 = sext i8 %2 to i64
%8 = sdiv i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = add i32 %0, 32
%11 = add i32 %10, %9
ret i32 %11
}
float max(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print_arr(int *, int);
int main() {
  int arr[10] = {8, 4, 6, 9, 0, -1, 5, -7, 10, -3};
  print_arr(arr, 10);
  merge_sort(arr, 0, 10 - 1);
  print_arr(arr, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1050 <merge_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1040 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 8, i32 4, i32 6, i32 9, i32 0, i32 -1, i32 5, i32 -7, i32 10, i32 -3]
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 @print_arr(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @merge_sort(i32* %5, i32 0, i32 9)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @print_arr(i32* %7, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 8, i32 4, i32 6, i32 9, i32 0, i32 -1, i32 5, i32 -7, i32 10, i32 -3]
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 @print_arr(i32* %3, i32 10)
%5 = call i32 @merge_sort(i32* %3, i32 0, i32 9)
%6 = call i32 @print_arr(i32* %3, i32 10)
ret i32 0
}
void decode(char line[], char mapEncodeToDecode[]) {
  int i;
  for (i = 0; line[i] != '\0'; i++)
    line[i] = mapEncodeToDecode[(int)line[i]];
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <decode+0x57>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <decode+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    (%rdi),%al
test   %al,%al
je     1126 <decode+0x26>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
movsbq %al,%rax
movzbl (%rsi,%rax,1),%eax
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <decode+0x10>
ret

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

LLVM IR (-O2):
define void @decode(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %7 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
ret void
}
unsigned Cyc_umax(unsigned i, unsigned j) {
  unsigned _T0;
  unsigned _T1;
  if (i <= j)
    goto _TL9;
  _T0 = i;
  return _T0;
_TL9:
  _T1 = j;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     111b <Cyc_umax+0x1b>
jmp    112c <Cyc_umax+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <Cyc_umax+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_umax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int c096(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c096() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void oth_keyboard(unsigned char key, int x, int y) {
  if (key == 27)
    exit(0);
}


x86 assembly (clang, -O0):
<oth_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1138 <oth_keyboard+0x28>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oth_keyboard>:
cmp    $0x1b,%dil
je     1117 <oth_keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @oth_keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @oth_keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
char angle(long x, long y, long z) {
  long long tmp = x * x + y * y - z * z;
  return (tmp ? (tmp > 0 ? 1 : 2) : tmp);
}


x86 assembly (clang, -O0):
<angle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
imul   -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1160 <angle+0x60>
mov    -0x20(%rbp),%rdx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
cltq
mov    %rax,-0x28(%rbp)
jmp    1168 <angle+0x68>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle>:
imul   %rdi,%rdi
imul   %rsi,%rsi
add    %rdi,%rsi
imul   %rdx,%rdx
mov    %rsi,%rax
sub    %rdx,%rax
test   %rax,%rax
setg   %al
mov    $0x2,%cl
sub    %al,%cl
xor    %edi,%edi
cmp    %rdx,%rsi
movzbl %cl,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @angle(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %0, %0
%5 = mul nsw i64 %1, %1
%6 = add nuw nsw i64 %5, %4
%7 = mul nsw i64 %2, %2
%8 = sub nsw i64 %6, %7
%9 = icmp eq i64 %8, 0
%10 = icmp sgt i64 %8, 0
%11 = select i1 %10, i8 1, i8 2
%12 = select i1 %9, i8 0, i8 %11
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ validptr(int *);
int sum(int *buf, int *end) {
  int sum = 0;
  while (buf <= end) {
    validptr(buf);
    sum += *buf;
    buf++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     115b <sum+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <validptr@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1127 <sum+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
cmp    %rsi,%rdi
ja     1143 <sum+0x33>
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <validptr@plt>
add    (%rbx),%ebp
add    $0x4,%rbx
cmp    %r14,%rbx
jbe    1130 <sum+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sum(i32* %0, i32* readnone %1) {
%3 = icmp ugt i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @validptr(i32* %6)
%8 = load i32, i32* %6
%9 = add nsw i32 %8, %5
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp ugt i32* %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ play_beep_sys(int, int);
void play_beep(int freq, int time) {
  play_beep_sys(freq, time);
  return;
}


x86 assembly (clang, -O0):
<play_beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <play_beep_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_beep>:
jmp    1030 <play_beep_sys@plt>

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

LLVM IR (-O2):
define void @play_beep(i32 %0, i32 %1) {
%3 = tail call i32 @play_beep_sys(i32 %0, i32 %1)
ret void
}
double f4_sum_float_post_int(float v, int v0) {
  return (double)v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_float_post_int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_float_post_int>:
cvtsi2sd %edi,%xmm1
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_float_post_int(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_float_post_int(float %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fpext float %0 to double
%5 = fadd double %4, %3
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void c2bf_dump_indent(FILE *f, int indent) {
  int i;
  for (i = 0; i < indent; i++)
    fprintf(f, "  ");
}


x86 assembly (clang, -O0):
<c2bf_dump_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <c2bf_dump_indent+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <c2bf_dump_indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2bf_dump_indent>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <c2bf_dump_indent+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <c2bf_dump_indent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @c2bf_dump_indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void gsym_addr(t, a) {}


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

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

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

LLVM IR (-O2):
define void @gsym_addr(i32 %0, i32 %1) {
ret void
}
int f2fs_test_bit(unsigned int nr, const char *p) {
  int mask;
  char *addr = (char *)p;
  addr += (nr >> 3);
  mask = 1 << (7 - (nr & 0x07));
  return (mask & *addr) != 0;
}


x86 assembly (clang, -O0):
<f2fs_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2fs_test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%rax
movsbl (%rsi,%rax,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f2fs_test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %6
%8 = load i32, i32* %3
%9 = lshr i32 %8, 3
%10 = load i8*, i8** %6
%11 = zext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %6
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = sub i32 7, %14
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = and i32 %17, %20
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @f2fs_test_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = xor i32 %6, 7
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = lshr i32 %9, %7
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int runTestsDiagonal();
int testCountDiagonal();
int main(int argc, char **argv) {
  int failures;
  failures = runTestsDiagonal();
  printf("\n\n%d tests complete, %d failed\n", testCountDiagonal(), failures);
  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    $0x0,%al
call   1030 <runTestsDiagonal@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <testCountDiagonal@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <runTestsDiagonal@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <testCountDiagonal@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0A\0A%d tests complete, %d failed\0A\00"
@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 = call i32 (...) @runTestsDiagonal()
store i32 %7, i32* %6
%8 = call i32 (...) @testCountDiagonal()
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0A\0A%d tests complete, %d failed\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @runTestsDiagonal()
%4 = tail call i32 (...) @testCountDiagonal()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
void PKCS7_SIGN_ENVELOPE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_SIGN_ENVELOPE_new() {
ret void
}
int f3(int a, int b) {
  return ((((b) > (a) ? (b) : (a))) < (b) ? (((b) > (a) ? (b) : (a))) : (b));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1121 <f3+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <f3+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115b <f3+0x5b>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    114a <f3+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <f3+0x50>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <f3+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %4
br label %24
22: ; preds = %16
%23 = load i32, i32* %3
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
br label %28
26: ; preds = %12
%27 = load i32, i32* %4
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int hash_keymatch_string(const void *a, const void *b, void *data) {
  (void)data;
  return (strcmp((const char *)a, (const char *)b) == 0);
}


x86 assembly (clang, -O0):
<hash_keymatch_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_keymatch_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @hash_keymatch_string(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned long divide(long a) { return a / 512ul; }


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

x86 assembly (clang, -O2):
<divide>:
mov    %rdi,%rax
shr    $0x9,%rax
ret

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

LLVM IR (-O2):
define i64 @divide(i64 %0) {
%2 = lshr i64 %0, 9
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x97() {
  Assert_real((isalpha(151) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              760, ("isalpha should be 0 for 0x97"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x97\00"
define void @t_isalpha_0x97() {
%1 = call i64 @isalpha(i32 151)
%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 760, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x97\00"
define void @t_isalpha_0x97() {
%1 = tail call i64 @isalpha(i32 151)
%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 760, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int psync_fs_remount() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psync_fs_remount() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, double *, double *, double *);
int getDistance(FILE *inputDB, double distance[]) {
  int res;
  res = fscanf(inputDB, "%lf %lf %lf\n", &distance[0], &distance[1],
               &distance[2]);
  return (res == 3) ? 0 : 1;
}


x86 assembly (clang, -O0):
<getDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
mov    -0x10(%rbp),%r8
add    $0x10,%r8
lea    0xec1(%rip),%rsi
call   1030 <fscanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x3,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDistance>:
push   %rax
mov    %rsi,%rdx
lea    0x8(%rsi),%rcx
lea    0x10(%rsi),%r8
lea    0xedd(%rip),%rsi
call   1030 <fscanf@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%lf %lf %lf\0A\00"
define i32 @getDistance(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
%5 = alloca i32
store i32* %0, i32** %3
store double* %1, double** %4
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 2
%13 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double* %8, double* %10, double* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 3
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"%lf %lf %lf\0A\00"
define i32 @getDistance(i32* nocapture %0, double* %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = getelementptr inbounds double, double* %1, i64 2
%5 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double* %1, double* %3, double* %4)
%6 = icmp ne i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}
void port_suspend(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @port_suspend() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int read(int /*<<< orphan*/, unsigned char *, int);
int main(int argc, char *argv[]) {
  int len;
  unsigned char ch;
  while ((len = read(0, &ch, 1)) > 0) {
    printf("0x%02x ", ch);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1167 <main+0x47>
lea    0xea7(%rip),%rdi
movzbl -0x15(%rbp),%esi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <main+0x50>
lea    0xec0(%rip),%r14
lea    0x7(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x7(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02x \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i32 @read(i32 0, i8* %3, i32 1)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = load i8, i8* %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = call i32 @read(i32 0, i8* %3, i32 1)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
double cos(double);
double glmRandomNumberd(int /*<<< orphan*/, double);
double sin(double);
void glmGenerateRandomVector2d(double v[2]) {
  double a;
  a = glmRandomNumberd(0, 6.283185307179586476925286766559);
  v[0] = sin(a);
  v[1] = cos(a);
}


x86 assembly (clang, -O0):
<glmGenerateRandomVector2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
movsd  0xeba(%rip),%xmm0
call   1050 <glmRandomNumberd@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateRandomVector2d>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  0xec0(%rip),%xmm0
xor    %edi,%edi
call   1050 <glmRandomNumberd@plt>
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @glmGenerateRandomVector2d(double* nocapture writeonly %0) {
%2 = tail call double @glmRandomNumberd(i32 0, double 0x401921FB54442D18)
%3 = tail call double @sin(double %2)
store double %3, double* %0
%4 = tail call double @cos(double %2)
%5 = getelementptr inbounds double, double* %0, i64 1
store double %4, double* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgscale2();
int /*<<< orphan*/ commit();
int /*<<< orphan*/ gentext();
void genscale2(void) {
  gentext();
  commit();
  cgscale2();
}


x86 assembly (clang, -O0):
<genscale2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gentext@plt>
mov    $0x0,%al
call   1040 <commit@plt>
mov    $0x0,%al
call   1050 <cgscale2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genscale2>:
push   %rax
xor    %eax,%eax
call   1030 <gentext@plt>
xor    %eax,%eax
call   1040 <commit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgscale2@plt>

LLVM IR (-O0):
define void @genscale2() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @commit()
%3 = call i32 (...) @cgscale2()
ret void
}

LLVM IR (-O2):
define void @genscale2() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @commit()
%3 = tail call i32 (...) @cgscale2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char try[40];
  puts("Who is buried in Grant's tomb?");
  gets(try);
  while (try != "Grant") {
    puts("No, that's wrong. Try again.");
    gets(try);
  }
  puts("That's right!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    -0x30(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x30(%rbp),%rax
lea    0xed0(%rip),%rcx
cmp    %rcx,%rax
je     1172 <main+0x52>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    -0x30(%rbp),%rdi
call   1040 <gets@plt>
jmp    1144 <main+0x24>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0xeda(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <gets@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [31 x i8] c"Who is buried in Grant's tomb?\00"
@.str.1 = [6 x i8] c"Grant\00"
@.str.2 = [29 x i8] c"No, that's wrong. Try again.\00"
@.str.3 = [14 x i8] c"That's right!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
br label %6
6: ; preds = %9, %0
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%8 = icmp ne i8* %7, getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
br label %6
13: ; preds = %6
%14 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Who is buried in Grant's tomb?\00"
@.str.2 = [29 x i8] c"No, that's wrong. Try again.\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
br label %5
5: ; preds = %5, %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @gets(i8* %2)
br label %5
}
void mach_idle(void) { asm("wait"); }


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

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

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

LLVM IR (-O2):
define void @mach_idle() {
tail call void asm sideeffect "wait", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetBlockNum(unsigned short wNum) {
  VIM_HIF_SetReg8((0x0000 + 0x029), (unsigned char)wNum);
  VIM_HIF_SetReg8((0x0000 + 0x028), (unsigned char)(wNum >> 8));
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetBlockNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    $0x29,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    $0x28,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetBlockNum>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%esi
mov    $0x29,%edi
call   1030 <VIM_HIF_SetReg8@plt>
shr    $0x8,%ebx
mov    $0x28,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetBlockNum(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
%5 = call i32 @VIM_HIF_SetReg8(i32 41, i8 zeroext %4)
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = call i32 @VIM_HIF_SetReg8(i32 40, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetBlockNum(i16 zeroext %0) {
%2 = trunc i16 %0 to i8
%3 = tail call i32 @VIM_HIF_SetReg8(i32 41, i8 zeroext %2)
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = tail call i32 @VIM_HIF_SetReg8(i32 40, i8 zeroext %5)
ret void
}