xunge/DecIR huggingface dataset:
/* Variables and functions */
int countDigitOne(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("n = 13, countDigitOne = %d\n", countDigitOne(13));
  printf("n = 824883294, countDigitOne = %d\n", countDigitOne(824883294));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"n = 13, countDigitOne = %d\0A\00"
@.str.1 = [35 x i8] c"n = 824883294, countDigitOne = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @countDigitOne(i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @countDigitOne(i32 824883294)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int test_imm_53int16_reg(short val) {
  return ((val) & (-0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_53int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -83
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_53int16_reg(i16 signext %0) {
%2 = and i16 %0, -83
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int intel_ich_gpio_set(int, int);
int intel_ich_gpio25_raise(void) { return intel_ich_gpio_set(25, 1); }


x86 assembly (clang, -O0):
<intel_ich_gpio25_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
mov    $0x1,%esi
call   1030 <intel_ich_gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_ich_gpio25_raise>:
mov    $0x19,%edi
mov    $0x1,%esi
jmp    1030 <intel_ich_gpio_set@plt>

LLVM IR (-O0):
define i32 @intel_ich_gpio25_raise() {
%1 = call i32 @intel_ich_gpio_set(i32 25, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_ich_gpio25_raise() {
%1 = tail call i32 @intel_ich_gpio_set(i32 25, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_data_device_manager {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_data_device_manager_get_version(
    struct wl_data_device_manager *wl_data_device_manager) {
  return wl_proxy_get_version((struct wl_proxy *)wl_data_device_manager);
}


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

x86 assembly (clang, -O2):
<wl_data_device_manager_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_device_manager_get_version(%struct.wl_data_device_manager* %0) {
%2 = alloca %struct.wl_data_device_manager*
store %struct.wl_data_device_manager* %0, %struct.wl_data_device_manager** %2
%3 = load %struct.wl_data_device_manager*, %struct.wl_data_device_manager** %2
%4 = bitcast %struct.wl_data_device_manager* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_data_device_manager = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_device_manager_get_version(%struct.wl_data_device_manager* %0) {
%2 = bitcast %struct.wl_data_device_manager* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __atanl(long double x) {
  fputs("__atanl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atanl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"__atanl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [25 x i8] c"__atanl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__atanl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void bar(void) {
  foo();
  foo();
  foo();
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @foo()
%3 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ I2C_Send3(int /*<<< orphan*/, int, int, int);
void tempsensorstart(uint8_t slaveAddress) {
  I2C_Send3(slaveAddress, 0x02, 0x75, 0x00);
}


x86 assembly (clang, -O0):
<tempsensorstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x75,%edx
xor    %ecx,%ecx
call   1030 <I2C_Send3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempsensorstart>:
mov    $0x2,%esi
mov    $0x75,%edx
xor    %ecx,%ecx
jmp    1030 <I2C_Send3@plt>

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

LLVM IR (-O2):
define void @tempsensorstart(i32 %0) {
%2 = tail call i32 @I2C_Send3(i32 %0, i32 2, i32 117, i32 0)
ret void
}
unsigned short byteSwap(unsigned short data) {
  unsigned short tmp;
  tmp = (data << 8) | (data >> 8);
  return tmp;
}


x86 assembly (clang, -O0):
<byteSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteSwap>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @byteSwap(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i16, i16* %3
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @byteSwap(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ PIN_INIT(int /*<<< orphan*/);
void initialise_board() { PIN_INIT(0); }


x86 assembly (clang, -O0):
<initialise_board>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <PIN_INIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialise_board>:
xor    %edi,%edi
jmp    1030 <PIN_INIT@plt>

LLVM IR (-O0):
define void @initialise_board() {
%1 = call i32 @PIN_INIT(i32 0)
ret void
}

LLVM IR (-O2):
define void @initialise_board() {
%1 = tail call i32 @PIN_INIT(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void format_current_timestamp(char *c_timestamp) {
  char *format = "%a, %d %b %Y %H:%M:%S %Z";
  time_t now = time(0);
  struct tm timestamp;
  gmtime_r(&now, &timestamp);
  strftime(c_timestamp, 8192, format, &timestamp);
}


x86 assembly (clang, -O0):
<format_current_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gmtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2000,%esi
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_current_timestamp>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1030 <gmtime_r@plt>
lea    0xea2(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2000,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define void @format_current_timestamp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.tm
store i8* %0, i8** %2
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = call i32 @time(i32 0)
store i32 %6, i32* %4
%7 = call i32 @gmtime_r(i32* %4, %struct.tm* %5)
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @strftime(i8* %8, i32 8192, i8* %9, %struct.tm* %5)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define void @format_current_timestamp(i8* %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32 0)
store i32 %5, i32* %2
%6 = bitcast %struct.tm* %3 to i8*
%7 = call i32 @gmtime_r(i32* %2, %struct.tm* %3)
%8 = call i32 @strftime(i8* %0, i32 8192, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret void
}
/* Variables and functions */
int backup_region(char *, int, int);
int rom_backup() {
  int ok0 = backup_region("ML/LOGS/ROM0.BIN", 0xF0000000, 0x01000000);
  int ok1 = backup_region("ML/LOGS/ROM1.BIN", 0xF8000000, 0x01000000);
  return ok0 && ok1;
}


x86 assembly (clang, -O0):
<rom_backup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0xf0000000,%esi
mov    $0x1000000,%edx
call   1030 <backup_region@plt>
mov    %eax,-0x4(%rbp)
lea    0xed9(%rip),%rdi
mov    $0xf8000000,%esi
mov    $0x1000000,%edx
call   1030 <backup_region@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1163 <rom_backup+0x53>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rom_backup>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0xf0000000,%esi
mov    $0x1000000,%edx
call   1030 <backup_region@plt>
mov    %eax,%ebx
lea    0xee1(%rip),%rdi
mov    $0xf8000000,%esi
mov    $0x1000000,%edx
call   1030 <backup_region@plt>
test   %ebx,%ebx
setne  %cl
test   %eax,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ML/LOGS/ROM0.BIN\00"
@.str.1 = [17 x i8] c"ML/LOGS/ROM1.BIN\00"
define i32 @rom_backup() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @backup_region(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 -268435456, i32 16777216)
store i32 %3, i32* %1
%4 = call i32 @backup_region(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -134217728, i32 16777216)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"ML/LOGS/ROM0.BIN\00"
@.str.1 = [17 x i8] c"ML/LOGS/ROM1.BIN\00"
define i32 @rom_backup() {
%1 = tail call i32 @backup_region(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 -268435456, i32 16777216)
%2 = tail call i32 @backup_region(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -134217728, i32 16777216)
%3 = icmp ne i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
int between(double a, double b, double c) {
  double tmp;
  if (b > c) {
    tmp = c;
    c = b;
    b = tmp;
  }
  return a >= b && a <= c;
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1141 <between+0x41>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x21(%rbp)
jb     116a <between+0x6a>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
movapd %xmm1,%xmm3
maxsd  %xmm2,%xmm3
minsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
setae  %al
ucomisd %xmm0,%xmm3
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @between(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %7
%13 = load double, double* %5
store double %13, double* %6
%14 = load double, double* %7
store double %14, double* %5
br label %15
15: ; preds = %11, %3
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fcmp oge double %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load double, double* %4
%21 = load double, double* %6
%22 = fcmp ole double %20, %21
br label %23
23: ; preds = %19, %15
%24 = phi i1 [ false, %15 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @between(double %0, double %1, double %2) {
%4 = fcmp ogt double %1, %2
%5 = select i1 %4, double %1, double %2
%6 = select i1 %4, double %2, double %1
%7 = fcmp ole double %6, %0
%8 = fcmp oge double %5, %0
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void csv_wakeup_table_footer(__attribute__((unused)) void *report_data) {
  printf("\n\n");
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @csv_wakeup_table_footer(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_56() {
  Assert_real((isqrt(56) == 7),
              "/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/stdlib/isqrt.c",
              285, ("Integer square root of 56 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_56>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x11d,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_56>:
push   %rax
mov    $0x38,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x11d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 56 should be 7\00"
define void @t_sqrt_56() {
%1 = call i32 @isqrt(i32 56)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 56 should be 7\00"
define void @t_sqrt_56() {
%1 = tail call i32 @isqrt(i32 56)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uInt;

/* Variables and functions */
int gzreplace(char *, char *, char *, int /*<<< orphan*/ *,
              int /*<<< orphan*/ *);
int gzdelete(char *input_file, char *output_file, char *off_str,
             uInt *undismissed) {
  return gzreplace(input_file, output_file, off_str, undismissed, NULL);
}


x86 assembly (clang, -O0):
<gzdelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <gzreplace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gzdelete>:
xor    %r8d,%r8d
jmp    1030 <gzreplace@plt>

LLVM IR (-O0):
define i32 @gzdelete(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32*, i32** %8
%13 = call i32 @gzreplace(i8* %9, i8* %10, i8* %11, i32* %12, i32* null)
ret i32 %13
}

LLVM IR (-O2):
define i32 @gzdelete(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = tail call i32 @gzreplace(i8* %0, i8* %1, i8* %2, i32* %3, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ goo();
void foo() { goo(); }


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

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

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @goo()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @goo()
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int _rand_next(unsigned short *);
long nrand48(unsigned short state[3]) {
  uint64_t x = _rand_next(state);
  uint32_t y = (uint32_t)(x >> 16);
  return (long)(y & 0x7fffffff);
}


x86 assembly (clang, -O0):
<nrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_rand_next@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand48>:
push   %rax
call   1030 <_rand_next@plt>
sar    $0x10,%eax
and    $0x7fffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @nrand48(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
%4 = alloca i32
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call i32 @_rand_next(i16* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 16
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = and i32 %9, 2147483647
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @nrand48(i16* %0) {
%2 = tail call i32 @_rand_next(i16* %0)
%3 = ashr i32 %2, 16
%4 = and i32 %3, 2147483647
%5 = zext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ FixedWingPathFollowerStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FixedWingPathFollowerStatusRequestUpdate() {
  UAVObjRequestUpdate(FixedWingPathFollowerStatusHandle());
}


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

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

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

LLVM IR (-O2):
define void @FixedWingPathFollowerStatusRequestUpdate() {
%1 = tail call i32 (...) @FixedWingPathFollowerStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int do_702() { return 702; }


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

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

LLVM IR (-O0):
define i32 @do_702() {
ret i32 702
}

LLVM IR (-O2):
define i32 @do_702() {
ret i32 702
}
/* Variables and functions */
int /*<<< orphan*/ strtoul(char const *, char **, int);
bool json_is_number(const char *str) {
  char *end;
  strtoul(str, &end, 10);
  return !(*str == 0 || *end != 0);
}


x86 assembly (clang, -O0):
<json_is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1153 <json_is_number+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_is_number>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
cmpb   $0x0,(%rbx)
je     113b <json_is_number+0x2b>
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
jmp    113d <json_is_number+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @json_is_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strtoul(i8* %4, i8** %3, i32 10)
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %1
%16 = phi i1 [ true, %1 ], [ %14, %10 ]
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @json_is_number(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtoul(i8* %0, i8** %2, i32 10)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %1
%13 = phi i32 [ 0, %1 ], [ %11, %7 ]
ret i32 %13
}
void storeValue(unsigned char boardNumber, unsigned char rowNumber,
                unsigned char pinNumber, unsigned short value) {
  storeValueInternal((unsigned int)(boardNumber)*32 + rowNumber * 8 + pinNumber,
                     value);
}


x86 assembly (clang, -O0):
<storeValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %ax,-0x6(%rbp)
movzbl -0x1(%rbp),%edi
shl    $0x5,%edi
movzbl -0x2(%rbp),%eax
shl    $0x3,%eax
add    %eax,%edi
movzbl -0x3(%rbp),%eax
add    %eax,%edi
movzwl -0x6(%rbp),%esi
mov    $0x0,%al
call   1030 <storeValueInternal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<storeValue>:
shl    $0x5,%edi
lea    (%rdi,%rsi,8),%edi
add    %edx,%edi
mov    %ecx,%esi
xor    %eax,%eax
jmp    1030 <storeValueInternal@plt>

LLVM IR (-O0):
define void @storeValue(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i16
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = mul i32 %10, 32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = mul nsw i32 %13, 8
%15 = add i32 %11, %14
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add i32 %15, %17
%19 = load i16, i16* %8
%20 = zext i16 %19 to i32
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @storeValueInternal to i32 (i32, i32, ...)*)(i32 %18, i32 %20)
ret void
}

LLVM IR (-O2):
define void @storeValue(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = zext i8 %0 to i32
%6 = shl nuw nsw i32 %5, 5
%7 = zext i8 %1 to i32
%8 = shl nuw nsw i32 %7, 3
%9 = add nuw nsw i32 %8, %6
%10 = zext i8 %2 to i32
%11 = add nuw nsw i32 %9, %10
%12 = zext i16 %3 to i32
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @storeValueInternal to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
float div(float x, float y) {
  printf("%f %f\n", x, y);
  return x / y;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f %f\0A\00"
define float @div(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 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = fdiv float %8, %9
ret float %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define float @div(float %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %0, float %1)
%4 = fdiv float %0, %1
ret float %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
void set_XResizeRequestEvent_height(void *_p, int _v) {
  ((XResizeRequestEvent *)_p)->height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XResizeRequestEvent_height>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XResizeRequestEvent_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned hash_pjw(char *name) {
  unsigned val = 0;
  unsigned i = 0;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if ((i = val & ~0x7f))
      val = (val ^ (i >> 12)) & 0x7f;
  }
  return val;
}


x86 assembly (clang, -O0):
<hash_pjw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <hash_pjw+0x6e>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffff80,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1158 <hash_pjw+0x58>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
and    $0x7f,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <hash_pjw+0x5d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <hash_pjw+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_pjw>:
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <hash_pjw+0x35>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,4),%ecx
mov    %ecx,%eax
shr    $0xc,%eax
xor    %ecx,%eax
and    $0x7f,%eax
cmp    $0x80,%ecx
cmovb  %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_pjw+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_pjw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i32 [ %15, %4 ], [ 0, %1 ]
%7 = phi i8* [ %16, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 2
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = icmp ult i32 %10, 128
%12 = lshr i32 %10, 12
%13 = xor i32 %12, %10
%14 = and i32 %13, 127
%15 = select i1 %11, i32 %10, i32 %14
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i32 [ 0, %1 ], [ %15, %4 ]
ret i32 %20
}
void avcodec_get_frame_class() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_frame_class() {
ret void
}
/* Variables and functions */
char *malloc(int);
int main(int argc, char *argv[]) {
  char *pointer = 0;
  pointer = malloc(64);
  pointer++;
  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)
movq   $0x0,-0x18(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int five, nine;
  five = 5;
  nine = 9;
  printf("result of 5 / 9 is:%d\n", five / nine);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"result of 5 / 9 is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 9, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sdiv i32 %3, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"result of 5 / 9 is:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
char *piece_replace(char *, char, char *, int);
char *replace_piece(char *source_destination, char delimiter, char *new_data,
                    int piece_offset) {
  return piece_replace(source_destination, delimiter, new_data, piece_offset);
}


x86 assembly (clang, -O0):
<replace_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsbl %al,%esi
call   1030 <piece_replace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_piece>:
jmp    1030 <piece_replace@plt>

LLVM IR (-O0):
define i8* @replace_piece(i8* %0, i8 signext %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8, i8* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i8* @piece_replace(i8* %9, i8 signext %10, i8* %11, i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @replace_piece(i8* %0, i8 signext %1, i8* %2, i32 %3) {
%5 = tail call i8* @piece_replace(i8* %0, i8 signext %1, i8* %2, i32 %3)
ret i8* %5
}
int CRYPTO_secure_malloc_done(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_secure_malloc_done() {
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ merge_sort(int *, int *, int /*<<< orphan*/, int);
void sort(int array[], int len) {
  int *my;
  if (len < 2)
    return;
  else {
    my = malloc(len * sizeof(int));
    merge_sort(array, my, 0, len - 1);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    113e <sort+0x1e>
jmp    1166 <sort+0x46>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1040 <merge_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jge    1126 <sort+0x6>
ret
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1030 <malloc@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <merge_sort@plt>

LLVM IR (-O0):
define void @sort(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* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
store i32* %14, i32** %5
%15 = load i32*, i32** %3
%16 = load i32*, i32** %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = call i32 @merge_sort(i32* %15, i32* %16, i32 0, i32 %18)
br label %20
20: ; preds = %8, %9
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = tail call i32* @malloc(i32 %5)
%7 = add nsw i32 %1, -1
%8 = tail call i32 @merge_sort(i32* %0, i32* %6, i32 0, i32 %7)
br label %9
9: ; preds = %2, %4
ret void
}
float _finalize_for_summing(float total) { return (1.0 / total); }


x86 assembly (clang, -O0):
<_finalize_for_summing>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_finalize_for_summing>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_finalize_for_summing(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @_finalize_for_summing(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
int tegra_core_process_id(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_core_process_id() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ config_timer32(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ set_xo_timer(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
void operation_sleep_notimer(void) {
  set_wakeup_timer(0, 0, 0);
  set_xo_timer(0, 0, 0, 0);
  config_timer32(0, 0, 0, 0);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1060 <set_wakeup_timer@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <set_xo_timer@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <config_timer32@plt>
mov    $0x0,%al
call   1050 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <set_wakeup_timer@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <set_xo_timer@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <config_timer32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = call i32 @set_xo_timer(i32 0, i32 0, i32 0, i32 0)
%3 = call i32 @config_timer32(i32 0, i32 0, i32 0, i32 0)
%4 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = tail call i32 @set_xo_timer(i32 0, i32 0, i32 0, i32 0)
%3 = tail call i32 @config_timer32(i32 0, i32 0, i32 0, i32 0)
%4 = tail call i32 (...) @operation_sleep()
ret void
}
/* Variables and functions */
char *sysfsparser_cpufreq_get_driver(unsigned int);
char *cpufreq_get_driver(unsigned int cpu) {
  return sysfsparser_cpufreq_get_driver(cpu);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_driver>:
jmp    1030 <sysfsparser_cpufreq_get_driver@plt>

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

LLVM IR (-O2):
define i8* @cpufreq_get_driver(i32 %0) {
%2 = tail call i8* @sysfsparser_cpufreq_get_driver(i32 %0)
ret i8* %2
}
/* Variables and functions */
double pow(double, double);
double qNT(double NT) {
  if (NT > 100)
    return 1.0;
  return 98.34 * pow(NT, -0.2232 + -0.006457 * NT);
}


x86 assembly (clang, -O0):
<qNT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <qNT+0x36>
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1181 <qNT+0x71>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb4(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qNT>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <qNT+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
movsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xedf(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qNT(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.000000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double -6.457000e-03, double %9, double -2.232000e-01)
%11 = call double @pow(double %8, double %10)
%12 = fmul double 9.834000e+01, %11
store double %12, double* %2
br label %13
13: ; preds = %7, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @qNT(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double -6.457000e-03, double -2.232000e-01)
%5 = tail call double @pow(double %0, double %4)
%6 = fmul double %5, 9.834000e+01
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void put_boat(void) {
  puts("                            \n"
       "                ,\x1b[31m~\x1b[0m          \n"
       "                |\\         \n"
       "               /| \\        \n"
       "         \x1b[34m~ ^~ \x1b[0m/_|__\\\x1b[34m~^~    \x1b[0m\n"
       "      \x1b[34m~^~^ ~ \x1b[0m'======' \x1b[34m~^ ~^~  \x1b[0m\n"
       "    \x1b[34m~^  ^~ ~^ ~\x1b[0m_\x1b[34m~\x1b[0m_\x1b[34m~^~ "
       "~^~\x1b[0m_\x1b[34m ~^~  \x1b[0m\n"
       "   \x1b[34m~^~ \x1b[0m___\x1b[34m^\x1b[0m___|_| |___\x1b[34m~\x1b[0m_| "
       "| \x1b[34m ^~  \x1b[0m\n"
       "    \x1b[34m~ \x1b[0m|_ -| .'| | |_ -| . |\x1b[34m ~ \x1b[0m\n"
       "      |___|__,|_|_|___|___| \n");
}


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

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

LLVM IR (-O0):
@.str = [436 x i8] c" \0A ,\1B[31m~\1B[0m \0A |\\ \0A /| \\ \0A \1B[34m~ ^~ \1B[0m/_|__\\\1B[34m~^~ \1B[0m\0A \1B[34m~^~^ ~ \1B[0m'======' \1B[34m~^ ~^~ \1B[0m\0A \1B[34m~^ ^~ ~^ ~\1B[0m_\1B[34m~\1B[0m_\1B[34m~^~ ~^~\1B[0m_\1B[34m ~^~ \1B[0m\0A \1B[34m~^~ \1B[0m___\1B[34m^\1B[0m___|_| |___\1B[34m~\1B[0m_| | \1B[34m ^~ \1B[0m\0A \1B[34m~ \1B[0m|_ -| .'| | |_ -| . |\1B[34m ~ \1B[0m\0A |___|__,|_|_|___|___| \0A\00"
define void @put_boat() {
%1 = call i32 @puts(i8* getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [436 x i8] c" \0A ,\1B[31m~\1B[0m \0A |\\ \0A /| \\ \0A \1B[34m~ ^~ \1B[0m/_|__\\\1B[34m~^~ \1B[0m\0A \1B[34m~^~^ ~ \1B[0m'======' \1B[34m~^ ~^~ \1B[0m\0A \1B[34m~^ ^~ ~^ ~\1B[0m_\1B[34m~\1B[0m_\1B[34m~^~ ~^~\1B[0m_\1B[34m ~^~ \1B[0m\0A \1B[34m~^~ \1B[0m___\1B[34m^\1B[0m___|_| |___\1B[34m~\1B[0m_| | \1B[34m ^~ \1B[0m\0A \1B[34m~ \1B[0m|_ -| .'| | |_ -| . |\1B[34m ~ \1B[0m\0A |___|__,|_|_|___|___| \0A\00"
define void @put_boat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0))
ret void
}