xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FlightTelemetryStatsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightTelemetryStatsRequestUpdate() {
  UAVObjRequestUpdate(FlightTelemetryStatsHandle());
}


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

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

LLVM IR (-O0):
define void @FlightTelemetryStatsRequestUpdate() {
%1 = call i32 (...) @FlightTelemetryStatsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightTelemetryStatsRequestUpdate() {
%1 = tail call i32 (...) @FlightTelemetryStatsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x74() {
  Assert_real((ispunct(116) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              585, ("ispunct should be 0 for t"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for t\00"
define void @t_ispunct_0x74() {
%1 = call i64 @ispunct(i32 116)
%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 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for t\00"
define void @t_ispunct_0x74() {
%1 = tail call i64 @ispunct(i32 116)
%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 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RPI_AuxMiniUartWrite(char);
void dump_string(char *string) {
  char c;
  while ((c = *string++) != 0) {
    RPI_AuxMiniUartWrite(c);
  }
}


x86 assembly (clang, -O0):
<dump_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <dump_string+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
jmp    111c <dump_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <dump_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <RPI_AuxMiniUartWrite@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <dump_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @dump_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %3
%12 = call i32 @RPI_AuxMiniUartWrite(i8 signext %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @dump_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @RPI_AuxMiniUartWrite(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int __byte_decode_array(void const *, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/ *, int /*<<< orphan*/);
int __byte_decode_little_endian_array(const void *_buf, uint32_t offset,
                                      uint32_t maxlen, uint8_t *p,
                                      uint32_t elements) {
  return __byte_decode_array(_buf, offset, maxlen, p, elements);
}


x86 assembly (clang, -O0):
<__byte_decode_little_endian_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <__byte_decode_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_decode_little_endian_array>:
jmp    1030 <__byte_decode_array@plt>

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

LLVM IR (-O2):
define i32 @__byte_decode_little_endian_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i32 @__byte_decode_array(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4)
ret i32 %6
}
int is_leap_year(int year) {
  int leap = 0;
  if (year % 400 == 0)
    leap = 1;
  else if (year % 100 == 0)
    leap = 0;
  else if (year % 4 == 0)
    leap = 1;
  else
    leap = 0;
  return leap;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112e <is_leap_year+0x2e>
movl   $0x1,-0x8(%rbp)
jmp    117f <is_leap_year+0x7f>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114e <is_leap_year+0x4e>
movl   $0x0,-0x8(%rbp)
jmp    117a <is_leap_year+0x7a>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <is_leap_year+0x6e>
movl   $0x1,-0x8(%rbp)
jmp    1175 <is_leap_year+0x75>
movl   $0x0,-0x8(%rbp)
jmp    117a <is_leap_year+0x7a>
jmp    117f <is_leap_year+0x7f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap_year+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap_year+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int main();
int __wrap_main() { return main(); }


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

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

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

LLVM IR (-O2):
define i32 @__wrap_main() {
%1 = tail call i32 (...) @main()
ret i32 %1
}
/* Variables and functions */
float CG_DrawPickupItem(float);
void CG_DrawLowerLeft(void) {
  float y;
  y = 480 - 32;
  y = CG_DrawPickupItem(y);
}


x86 assembly (clang, -O0):
<CG_DrawLowerLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <CG_DrawPickupItem@plt>
movss  %xmm0,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawLowerLeft>:
movss  0xee8(%rip),%xmm0
jmp    1030 <CG_DrawPickupItem@plt>

LLVM IR (-O0):
define void @CG_DrawLowerLeft() {
%1 = alloca float
store float 4.480000e+02, float* %1
%2 = load float, float* %1
%3 = call float @CG_DrawPickupItem(float %2)
store float %3, float* %1
ret void
}

LLVM IR (-O2):
define void @CG_DrawLowerLeft() {
%1 = tail call float @CG_DrawPickupItem(float 4.480000e+02)
ret void
}
void swap(int *ptra, int *ptrb) {
  int temp;
  temp = *ptra;
  *ptra = *ptrb;
  *ptrb = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x1c() {
  Assert_real((iscntrl(28)),
              "/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_iscntrl.c",
              145, ("iscntrl should be 1 for 0x1c"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x1c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x91,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x91,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1c\00"
define void @t_iscntrl_0x1c() {
%1 = call i32 @iscntrl(i32 28)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x1c\00"
define void @t_iscntrl_0x1c() {
%1 = tail call i32 @iscntrl(i32 28)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void clear_index(long int *index) { index[0] = -1; }


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

x86 assembly (clang, -O2):
<clear_index>:
movq   $0xffffffffffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @clear_index(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
store i64 -1, i64* %4
ret void
}

LLVM IR (-O2):
define void @clear_index(i64* nocapture writeonly %0) {
store i64 -1, i64* %0
ret void
}
int compare_long(const void *l1, const void *l2) {
  long a, b;
  a = (long)l1;
  b = (long)l2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<compare_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_long>:
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdi
setg   %al
setl   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_long(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = icmp sgt i64 %11, %12
%14 = zext i1 %13 to i32
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = icmp slt i64 %15, %16
%18 = zext i1 %17 to i32
%19 = sub nsw i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @compare_long(i8* readnone %0, i8* readnone %1) {
%3 = icmp sgt i8* %0, %1
%4 = zext i1 %3 to i32
%5 = icmp slt i8* %0, %1
%6 = sext i1 %5 to i32
%7 = add nsw i32 %6, %4
ret i32 %7
}
short prog_q168sign(short A) { return (A >> 15) & 0x0001; }


x86 assembly (clang, -O0):
<prog_q168sign>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sar    $0xf,%eax
and    $0x1,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_q168sign>:
movzwl %di,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define signext i16 @prog_q168sign(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = ashr i32 %4, 15
%6 = and i32 %5, 1
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @prog_q168sign(i16 signext %0) {
%2 = lshr i16 %0, 15
ret i16 %2
}
/* Variables and functions */
char *memchr(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strchr(char *s, int c) { return memchr(s, c, strlen(s)); }


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memchr@plt>

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @memchr(i8* %0, i32 %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int last(int *current) {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  return a == *current && !b && !c;
}


x86 assembly (clang, -O0):
<last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <scanf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
mov    %al,-0x15(%rbp)
jne    1163 <last+0x53>
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jne    1163 <last+0x53>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <scanf@plt>
mov    0xc(%rsp),%ecx
xor    (%rbx),%ecx
or     0x8(%rsp),%ecx
xor    %eax,%eax
or     0x4(%rsp),%ecx
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @last(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %18
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br label %18
18: ; preds = %14, %11, %1
%19 = phi i1 [ false, %11 ], [ false, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @last(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %0
%11 = icmp eq i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
%14 = select i1 %11, i1 %13, i1 false
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 0
%17 = select i1 %14, i1 %16, i1 false
%18 = zext i1 %17 to i32
ret i32 %18
}
void stop_adpcm_encode(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @rv2rv_or_rv() {
ret void
}
/* Variables and functions */
int __snippet_block_count(char **blocks) {
  int count;
  char *block = NULL;
  for (count = 0, block = *blocks; block != NULL; count++, block = *++blocks)
    ;
  return count;
}


x86 assembly (clang, -O0):
<__snippet_block_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1157 <__snippet_block_count+0x57>
jmp    1132 <__snippet_block_count+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1122 <__snippet_block_count+0x22>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__snippet_block_count>:
cmpq   $0x0,(%rdi)
je     111d <__snippet_block_count+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <__snippet_block_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @__snippet_block_count(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int write_bytes(char **, char *, int /*<<< orphan*/ *, int);
int xdr_write_u32(u_int32_t **ptr, const u_int32_t *end, u_int32_t arg) {
  u_int32_t tmp;
  tmp = htonl(arg);
  return write_bytes((char **)ptr, (char *)end, &tmp, sizeof(tmp));
}


x86 assembly (clang, -O0):
<xdr_write_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <write_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_write_u32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%ecx
call   1040 <write_bytes@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @xdr_write_u32(i32** %0, i32* %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32** %0, i32*** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htonl(i32 %8)
store i32 %9, i32* %7
%10 = load i32**, i32*** %4
%11 = bitcast i32** %10 to i8**
%12 = load i32*, i32** %5
%13 = bitcast i32* %12 to i8*
%14 = call i32 @write_bytes(i8** %11, i8* %13, i32* %7, i32 4)
ret i32 %14
}

LLVM IR (-O2):
define i32 @xdr_write_u32(i32** %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htonl(i32 %2)
store i32 %6, i32* %4
%7 = bitcast i32** %0 to i8**
%8 = bitcast i32* %1 to i8*
%9 = call i32 @write_bytes(i8** %7, i8* %8, i32* %4, i32 4)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *glbValueToName(int, char *, int);
void rule_name(FILE *stream, int exp, int number) {
  fprintf(stream, "--------- %s ---------\n",
          glbValueToName(exp, "rule", number));
}


x86 assembly (clang, -O0):
<rule_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
lea    0xed1(%rip),%rsi
call   1040 <glbValueToName@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rule_name>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
lea    0xeeb(%rip),%rsi
mov    %eax,%edi
call   1040 <glbValueToName@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"--------- %s ---------\0A\00"
@.str.1 = [5 x i8] c"rule\00"
define void @rule_name(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i8* @glbValueToName(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"--------- %s ---------\0A\00"
@.str.1 = [5 x i8] c"rule\00"
define void @rule_name(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @glbValueToName(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t kForRound(int roundNum) {
  if (roundNum <= 19) {
    return 0x5a827999;
  } else if (roundNum <= 39) {
    return 0x6ed9eba1;
  } else if (roundNum <= 59) {
    return 0x8f1bbcdc;
  } else {
    return 0xca62c1d6;
  }
}


x86 assembly (clang, -O0):
<kForRound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x13,-0x8(%rbp)
jg     111d <kForRound+0x1d>
movl   $0x5a827999,-0x4(%rbp)
jmp    1150 <kForRound+0x50>
cmpl   $0x27,-0x8(%rbp)
jg     1133 <kForRound+0x33>
movl   $0x6ed9eba1,-0x4(%rbp)
jmp    1150 <kForRound+0x50>
cmpl   $0x3b,-0x8(%rbp)
jg     1149 <kForRound+0x49>
movl   $0x8f1bbcdc,-0x4(%rbp)
jmp    1150 <kForRound+0x50>
movl   $0xca62c1d6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kForRound>:
mov    $0x5a827999,%eax
cmp    $0x14,%edi
jl     1124 <kForRound+0x24>
mov    $0x6ed9eba1,%eax
cmp    $0x28,%edi
jb     1124 <kForRound+0x24>
cmp    $0x3c,%edi
mov    $0x8f1bbcdc,%ecx
mov    $0xca62c1d6,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @kForRound(i32 %0) {
%2 = icmp slt i32 %0, 20
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 40
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 60
%7 = select i1 %6, i32 -1894007588, i32 -899497514
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1518500249, %1 ], [ 1859775393, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read(int, int *, int);
int read_header_rest(int fd, uint8_t *header_buffer) {
  int r = read(fd, header_buffer + 9, header_buffer[8]);
  if (r < 0)
    return -1;
  if (r != header_buffer[8])
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<read_header_rest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x24,%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114f <read_header_rest+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <read_header_rest+0x62>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    0x20(%rcx),%eax
je     116b <read_header_rest+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <read_header_rest+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_header_rest>:
push   %rbx
mov    %rsi,%rbx
add    $0x24,%rsi
mov    0x20(%rbx),%edx
call   1030 <read@plt>
test   %eax,%eax
js     1130 <read_header_rest+0x20>
mov    %eax,%ecx
xor    %eax,%eax
cmp    0x20(%rbx),%ecx
sete   %al
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_header_rest(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 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 9
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 8
%12 = load i32, i32* %11
%13 = call i32 @read(i32 %7, i32* %9, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 -1, i32* %3
br label %25
17: ; preds = %2
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 8
%21 = load i32, i32* %20
%22 = icmp ne i32 %18, %21
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 0, i32* %3
br label %25
24: ; preds = %17
store i32 1, i32* %3
br label %25
25: ; preds = %24, %23, %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_header_rest(i32 %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 9
%4 = getelementptr inbounds i32, i32* %1, i64 8
%5 = load i32, i32* %4
%6 = tail call i32 @read(i32 %0, i32* %3, i32 %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %6, %9
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %2
%13 = phi i32 [ -1, %2 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int a;
  a = 45;
  if (a) {
    __print_int(1);
  }
  if (!a) {
    __print_int(0);
  }
  if (a) {
    __print_int(1);
  } else {
    __print_int(0);
  }
  if (!a) {
    __print_int(0);
  } else {
    __print_int(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2d,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113a <main+0x2a>
mov    $0x1,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
jne    114b <main+0x3b>
xor    %edi,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
je     1164 <main+0x54>
mov    $0x1,%edi
call   1030 <__print_int@plt>
jmp    116b <main+0x5b>
xor    %edi,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1181 <main+0x71>
xor    %edi,%edi
call   1030 <__print_int@plt>
jmp    118b <main+0x7b>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 45, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @__print_int(i32 1)
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @__print_int(i32 0)
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @__print_int(i32 1)
br label %19
17: ; preds = %12
%18 = call i32 @__print_int(i32 0)
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 @__print_int(i32 0)
br label %26
24: ; preds = %19
%25 = call i32 @__print_int(i32 1)
br label %26
26: ; preds = %24, %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 1)
%2 = tail call i32 @__print_int(i32 1)
%3 = tail call i32 @__print_int(i32 1)
ret i32 0
}
double hydra_signum(double d) {
  return (d > 0.0) ? 1.0 : ((d < 0.0) ? (-1.0) : 0.0);
}


x86 assembly (clang, -O0):
<hydra_signum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <hydra_signum+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1156 <hydra_signum+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hydra_signum>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @hydra_signum(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void strdupped_free(void *a) {
  char *b = *(char **)a;
  free(b);
}


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

x86 assembly (clang, -O2):
<strdupped_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @strdupped_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @strdupped_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void message2(const char *a, const char *b) { fprintf(stderr, "%s%s\n", a, b); }


x86 assembly (clang, -O0):
<message2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message2>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
define void @message2(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x44() {
  Assert_real((isupper(68)),
              "/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_isupper.c",
              345, ("isupper should be 1 for D"));
}


x86 assembly (clang, -O0):
<t_isupper_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x159,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x159,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for D\00"
define void @t_isupper_0x44() {
%1 = call i32 @isupper(i32 68)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for D\00"
define void @t_isupper_0x44() {
%1 = tail call i32 @isupper(i32 68)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;
typedef int /*<<< orphan*/ PATH_MAX;

/* Variables and functions */
char *getenv(char *);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ snprintf(char *, int /*<<< orphan*/, char *, char *, char *);
char *fname(void) {
  char *home = getenv("HOME");
  char *ret = malloc(((PATH_MAX)-8));
  memset(ret, '\0', sizeof(ret));
  snprintf(ret, ((PATH_MAX)-8), "%s/%s", home, ".dcdpid");
  return ret;
}


x86 assembly (clang, -O0):
<fname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    $0xfffffff8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xfffffff8,%esi
lea    0xe7b(%rip),%rdx
lea    0xe7a(%rip),%r8
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fname>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r14
mov    $0xfffffff8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xe8f(%rip),%rdx
lea    0xe8e(%rip),%r8
mov    %rbx,%rdi
mov    $0xfffffff8,%esi
mov    %r14,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [8 x i8] c".dcdpid\00"
define i8* @fname() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = call i8* @malloc(i32 -8)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 8)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %1
%9 = call i32 @snprintf(i8* %7, i32 -8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [8 x i8] c".dcdpid\00"
define i8* @fname() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(4294967288) i8* @malloc(i32 -8)
%3 = tail call i32 @memset(i8* %2, i8 signext 0, i32 8)
%4 = tail call i32 @snprintf(i8* %2, i32 -8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i8* %2
}
void stop_count(int sig) {
  extern int sigalarm;
  sigalarm = 1;
}


x86 assembly (clang, -O0):
<stop_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_count>:
mov    0x2ed9(%rip),%rax
movl   $0x1,(%rax)
ret

LLVM IR (-O0):
@sigalarm = external global i32
define void @stop_count(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* @sigalarm
ret void
}

LLVM IR (-O2):
@sigalarm = external global i32
define void @stop_count(i32 %0) {
store i32 1, i32* @sigalarm
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup(const char *s) {
  int64_t string_size;
  char *new_string = NULL;
  string_size = strlen(s);
  new_string = malloc(string_size + 1);
  if (new_string != NULL) {
    memcpy(new_string, s, string_size);
    new_string[string_size] = '\0';
  }
  return new_string;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1186 <strdup+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1166 <strdup+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ GyrosBiasHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GyrosBiasUpdated() { UAVObjUpdated(GyrosBiasHandle()); }


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

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

LLVM IR (-O0):
define void @GyrosBiasUpdated() {
%1 = call i32 (...) @GyrosBiasHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyrosBiasUpdated() {
%1 = tail call i32 (...) @GyrosBiasHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
long now();
long getMINTIME() {
  long t0 = 0, t1 = 0;
  t0 = t1 = now();
  while (t0 == t1) {
    t1 = now();
  }
  return (t1 - t0);
}


x86 assembly (clang, -O0):
<getMINTIME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <now@plt>
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1155 <getMINTIME+0x45>
mov    $0x0,%al
call   1030 <now@plt>
mov    %rax,-0x10(%rbp)
jmp    1137 <getMINTIME+0x27>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMINTIME>:
push   %rbx
xor    %eax,%eax
call   1030 <now@plt>
mov    %rax,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <now@plt>
sub    %rbx,%rax
je     1120 <getMINTIME+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getMINTIME() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
%3 = call i64 (...) @now()
store i64 %3, i64* %2
store i64 %3, i64* %1
br label %4
4: ; preds = %8, %0
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i64 (...) @now()
store i64 %9, i64* %2
br label %4
10: ; preds = %4
%11 = load i64, i64* %2
%12 = load i64, i64* %1
%13 = sub nsw i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @getMINTIME() {
%1 = tail call i64 (...) @now()
br label %2
2: ; preds = %0, %2
%3 = tail call i64 (...) @now()
%4 = icmp eq i64 %3, %1
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = sub nsw i64 %3, %1
ret i64 %6
}