xunge/DecIR huggingface dataset:
int isLeapyear(int annee) {
  int fevrier = 28;
  if ((annee % 4 == 0 && annee % 100 != 0) || (annee % 400 == 0)) {
    fevrier = 29;
  }
  return fevrier;
}


x86 assembly (clang, -O0):
<isLeapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1c,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1136 <isLeapyear+0x36>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114a <isLeapyear+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <isLeapyear+0x51>
movl   $0x1d,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapyear>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
or     $0x1c,%eax
ret

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

LLVM IR (-O2):
define i32 @isLeapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = select i1 %9, i32 29, i32 28
ret i32 %10
}
int warp(int i, int n) { return (i << n) + (2 << n) - 2; }


x86 assembly (clang, -O0):
<warp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0x2,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp>:
mov    %esi,%ecx
lea    0x2(%rdi),%eax
shl    %cl,%eax
add    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @warp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %4
%9 = shl i32 2, %8
%10 = add nsw i32 %7, %9
%11 = sub nsw i32 %10, 2
ret i32 %11
}

LLVM IR (-O2):
define i32 @warp(i32 %0, i32 %1) {
%3 = add i32 %0, 2
%4 = shl i32 %3, %1
%5 = add nsw i32 %4, -2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy6(int *x, int *y) { memcpy(x, y, 6); }


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

x86 assembly (clang, -O2):
<copy6>:
mov    $0x6,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @copy6(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 6)
ret void
}
int BSP_DLOAD_GetDloadType(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @BSP_DLOAD_GetDloadType() {
ret i32 1
}

LLVM IR (-O2):
define i32 @BSP_DLOAD_GetDloadType() {
ret i32 1
}
void foo_2_2_1_1_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_2_1_2() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool WatchdogLockState(uint32_t ui32Base) {
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x00000C00))) == 0x00000001)
              ? 1
              : 0);
}


x86 assembly (clang, -O0):
<WatchdogLockState>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLockState>:
mov    0xc00(%rdi),%rcx
xor    %eax,%eax
cmp    $0x1,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @WatchdogLockState(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 3072
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = icmp eq i64 %6, 1
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @WatchdogLockState(i64 %0) {
%2 = add nsw i64 %0, 3072
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = icmp eq i64 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ code(char *);
void comment(char *s) {
  code("/* ");
  code(s);
  code(" */");
}


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

x86 assembly (clang, -O2):
<comment>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <code@plt>
mov    %rbx,%rdi
call   1030 <code@plt>
lea    0xed5(%rip),%rdi
pop    %rbx
jmp    1030 <code@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"/* \00"
@.str.1 = [4 x i8] c" */\00"
define void @comment(i8* %0) {
%2 = tail call i32 @code(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @code(i8* %0)
%4 = tail call i32 @code(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _Parse_fde_instr(void) {}


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

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

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

LLVM IR (-O2):
define void @_Parse_fde_instr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
long sysconf(int /*<<< orphan*/);
long proc_stat_unit() { return sysconf(_SC_CLK_TCK); }


x86 assembly (clang, -O0):
<proc_stat_unit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_stat_unit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i64 @proc_stat_unit() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i64 @proc_stat_unit() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ RDP(char *);
int /*<<< orphan*/ RDP_E(char *);
void uc6_obj_rendermode() {
  RDP("uc6:obj_rendermode\n");
  RDP_E("uc6:obj_rendermode\n");
}


x86 assembly (clang, -O0):
<uc6_obj_rendermode>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <RDP@plt>
lea    0xec9(%rip),%rdi
call   1030 <RDP_E@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc6_obj_rendermode>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <RDP@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <RDP_E@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"uc6:obj_rendermode\0A\00"
define void @uc6_obj_rendermode() {
%1 = call i32 @RDP(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @RDP_E(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"uc6:obj_rendermode\0A\00"
define void @uc6_obj_rendermode() {
%1 = tail call i32 @RDP(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @RDP_E(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
int compareFloat(void *f1, void *f2) {
  float a = *((float *)f1);
  float b = *((float *)f2);
  if (a > b) {
    return 1;
  } else if (a < b) {
    return -1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<compareFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1141 <compareFloat+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1167 <compareFloat+0x67>
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1160 <compareFloat+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <compareFloat+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFloat>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareFloat(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %6
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load float, float* %6
%20 = load float, float* %7
%21 = fcmp olt float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compareFloat(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ const time_t;

/* Variables and functions */
time_t timespec_diff(const time_t after, const time_t before) {
  return after - before;
}


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

x86 assembly (clang, -O2):
<timespec_diff>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @timespec_diff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @timespec_diff(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
al_segment_vcs(int *is_first, int *last_bg, int position) {
  int ret = 1;
  if (ret == 0 || ret == 1) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<al_segment_vcs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     112a <al_segment_vcs+0x2a>
cmpl   $0x1,-0x20(%rbp)
jne    1136 <al_segment_vcs+0x36>
movl   $0x0,-0x4(%rbp)
jmp    113d <al_segment_vcs+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @al_segment_vcs(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int u_int16_t;

/* Variables and functions */
int calc_crc_ccitt(int /*<<< orphan*/ const *, int);
int check_crc_ccitt(const u_int8_t *buffer, int len) {
  u_int16_t crc = calc_crc_ccitt(buffer, len);
  return (crc & 0xffff) == 0x0f47;
}


x86 assembly (clang, -O0):
<check_crc_ccitt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <calc_crc_ccitt@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
cmp    $0xf47,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_crc_ccitt>:
push   %rax
call   1030 <calc_crc_ccitt@plt>
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0xf47,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_crc_ccitt(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* %4
%8 = call i32 @calc_crc_ccitt(i32* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 65535
%11 = icmp eq i32 %10, 3911
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @check_crc_ccitt(i32* %0, i32 %1) {
%3 = tail call i32 @calc_crc_ccitt(i32* %0, i32 %1)
%4 = and i32 %3, 65535
%5 = icmp eq i32 %4, 3911
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_host_serif_get_instance();
int /*<<< orphan*/
inv_host_serif_get_max_read_transaction_size(int /*<<< orphan*/);
uint32_t inv_host_serif_get_max_read_transaction_size_i(void) {
  return inv_host_serif_get_max_read_transaction_size(
      inv_host_serif_get_instance());
}


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

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

LLVM IR (-O0):
define i32 @inv_host_serif_get_max_read_transaction_size_i() {
%1 = call i32 (...) @inv_host_serif_get_instance()
%2 = call i32 @inv_host_serif_get_max_read_transaction_size(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @inv_host_serif_get_max_read_transaction_size_i() {
%1 = tail call i32 (...) @inv_host_serif_get_instance()
%2 = tail call i32 @inv_host_serif_get_max_read_transaction_size(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_lvector(long *v, long nl) { free((char *)(v + nl - 1)); }


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

x86 assembly (clang, -O2):
<free_lvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_lvector(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i64, i64* %5, i64 %6
%8 = getelementptr inbounds i64, i64* %7, i64 -1
%9 = bitcast i64* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_lvector(i64* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 %1
%4 = getelementptr inbounds i64, i64* %3, i64 -1
%5 = bitcast i64* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf7(int f, int n) { return (cbuf(f, n, 7)); }


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

x86 assembly (clang, -O2):
<cbuf7>:
mov    $0x7,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf7(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 7)
ret i32 %3
}
__attribute__((always_)) unsigned int jiffies_to_msecs(const unsigned long j) {
  return ((1000L) / 250) * j;
}


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

x86 assembly (clang, -O2):
<jiffies_to_msecs>:
lea    0x0(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @jiffies_to_msecs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 4, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @jiffies_to_msecs(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 2
ret i32 %3
}
void simple_arg(int g[100], int *h, int i) {
  __builtin_prefetch(g, 0, 0);
  __builtin_prefetch(h, 0, 0);
  __builtin_prefetch(&i, 0, 0);
}


x86 assembly (clang, -O0):
<simple_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
prefetchnta (%rax)
mov    -0x10(%rbp),%rax
prefetchnta (%rax)
lea    -0x14(%rbp),%rax
prefetchnta (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_arg>:
mov    %edx,-0x4(%rsp)
prefetchnta (%rdi)
prefetchnta (%rsi)
prefetchnta -0x4(%rsp)
ret

LLVM IR (-O0):
define void @simple_arg(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 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = bitcast i32* %6 to i8*
ret void
}

LLVM IR (-O2):
define void @simple_arg(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = bitcast i32* %0 to i8*
tail call void @llvm.prefetch.p0i8(i8* %5, i32 0, i32 0, i32 1)
%6 = bitcast i32* %1 to i8*
tail call void @llvm.prefetch.p0i8(i8* %6, i32 0, i32 0, i32 1)
%7 = bitcast i32* %4 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brakbta_(double *, int *, double *, int *, int *);
void brakbta(double aa, int *ia, double a[], int n, int l) {
  brakbta_(&aa, ia, a, &n, &l);
}


x86 assembly (clang, -O0):
<brakbta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <brakbta_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brakbta>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %rdi,%rsi
movsd  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %ecx,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rax,%rdx
call   1030 <brakbta_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @brakbta(double %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %6
store i32 %3, i32* %7
store i32 %4, i32* %8
%9 = call i32 @brakbta_(double* %6, i32* %1, double* %2, i32* %7, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _fdidfd(float, double, int, double, float, double);
void call_fdidfd() { _fdidfd(1.0f, 2.0, 3, 4.0, 5.0f, 6.0); }


x86 assembly (clang, -O0):
<call_fdidfd>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
mov    $0x3,%edi
movsd  0xedf(%rip),%xmm2
movss  0xecb(%rip),%xmm3
movsd  0xed7(%rip),%xmm4
call   1030 <_fdidfd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_fdidfd>:
movss  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
movss  0xed4(%rip),%xmm3
movsd  0xee0(%rip),%xmm4
mov    $0x3,%edi
jmp    1030 <_fdidfd@plt>

LLVM IR (-O0):
define void @call_fdidfd() {
%1 = call i32 @_fdidfd(float 1.000000e+00, double 2.000000e+00, i32 3, double 4.000000e+00, float 5.000000e+00, double 6.000000e+00)
ret void
}

LLVM IR (-O2):
define void @call_fdidfd() {
%1 = tail call i32 @_fdidfd(float 1.000000e+00, double 2.000000e+00, i32 3, double 4.000000e+00, float 5.000000e+00, double 6.000000e+00)
ret void
}
void dev_remove_param(struct device_d *dev, char *name) {}


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

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

LLVM IR (-O0):
%struct.device_d = type opaque
define void @dev_remove_param(%struct.device_d* %0, i8* %1) {
%3 = alloca %struct.device_d*
%4 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.device_d = type opaque
define void @dev_remove_param(%struct.device_d* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int WriteInt32(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
int WriteString(uint8_t *ptr, int ofs, const char *src, int len) {
  ofs = WriteInt32(ptr, ofs, len);
  memcpy(ptr + ofs, src, len);
  return (ofs + len);
}


x86 assembly (clang, -O0):
<WriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <WriteInt32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %ecx,%edx
call   1030 <WriteInt32@plt>
movslq %eax,%rbp
lea    (%rbx,%rbp,4),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
add    %r15d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteString(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = call i32 @WriteInt32(i32* %9, i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @memcpy(i32* %16, i8* %17, i32 %18)
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @WriteString(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @WriteInt32(i32* %0, i32 %1, i32 %3)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @memcpy(i32* %7, i8* %2, i32 %3)
%9 = add nsw i32 %5, %3
ret i32 %9
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int c(struct can_frame frame) { return frame.data[0] >> 0 & 0x1; }


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

x86 assembly (clang, -O2):
<c>:
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @c(i32* %0) {
%2 = alloca %struct.can_frame
%3 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
store i32* %0, i32** %3
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = ashr i32 %7, 0
%9 = and i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @c(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ imprimir(int *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  imprimir(a, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1050 <setlocale@plt>
lea    -0x30(%rbp),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <imprimir@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <setlocale@plt>
mov    0xef0(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <imprimir@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = load i32, i32* @LC_ALL
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @imprimir(i32* %6, i32 10)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [10 x i32]* %1 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @imprimir(i32* %5, i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void usage(const char *name, FILE *out) {
  fprintf(out, "usage: %s <file1.jpg> [<file2.jp2> ...]\n", name);
  fprintf(out, "  dumps the structure of a JPEG codestream for inspection.\n");
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeea(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: %s <file1.jpg> [<file2.jp2> ...]\0A\00"
@.str.1 = [60 x i8] c" dumps the structure of a JPEG codestream for inspection.\0A\00"
define void @usage(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 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"usage: %s <file1.jpg> [<file2.jp2> ...]\0A\00"
@.str.1 = [60 x i8] c" dumps the structure of a JPEG codestream for inspection.\0A\00"
define void @usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i64 59, i64 1, i32* %1)
ret void
}
int my_strcmp(char *s1, char *s2) {
  while (*s1 == *s2) {
    if (!(*s1))
      return (0);
    s1++;
    s2++;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1158 <my_strcmp+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <my_strcmp+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116b <my_strcmp+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%dl
cmp    %dl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%ecx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <my_strcmp+0x10>
movsbl %dl,%ecx
movsbl %al,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %19 to i32
%21 = sext i8 %18 to i32
%22 = sub nsw i32 %21, %20
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x5b() {
  Assert_real((isspace(91) == 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_isspace.c",
              460, ("isspace should be 0 for ["));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1cc,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for [\00"
define void @t_isspace_0x5b() {
%1 = call i64 @isspace(i32 91)
%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 460, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for [\00"
define void @t_isspace_0x5b() {
%1 = tail call i64 @isspace(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int print_help() {
  fprintf(
      stderr,
      "Usage: am2321 [-r] [-s]\n"
      "Get temperature and humidity measured with Aosong's AM2321 sensor.\n"
      "  -r    human readable output\n"
      "  -m    mackerel readable output\n"
      "  -s    not measure with AM2321, instead stub of 23.4[C] and 32.1[%]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [224 x i8] c"Usage: am2321 [-r] [-s]\0AGet temperature and humidity measured with Aosong's AM2321 sensor.\0A -r human readable output\0A -m mackerel readable output\0A -s not measure with AM2321, instead stub of 23.4[C] and 32.1[%]\0A\00"
define i32 @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [224 x i8] c"Usage: am2321 [-r] [-s]\0AGet temperature and humidity measured with Aosong's AM2321 sensor.\0A -r human readable output\0A -m mackerel readable output\0A -s not measure with AM2321, instead stub of 23.4[C] and 32.1[%]\0A\00"
define i32 @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ const INT8_MAX;
scalar_t__ const INT8_MIN;
int32_t __stdfix_sat_hr(const int32_t x) {
  if (x > INT8_MAX)
    return (INT8_MAX);
  if (x < INT8_MIN)
    return (INT8_MIN);
  return (x);
}


x86 assembly (clang, -O0):
<__stdfix_sat_hr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec5(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <__stdfix_sat_hr+0x2f>
mov    0x2eb5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <__stdfix_sat_hr+0x5e>
mov    -0x10(%rbp),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
jge    1156 <__stdfix_sat_hr+0x56>
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <__stdfix_sat_hr+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@INT8_MAX = constant i64 0
@INT8_MIN = constant i64 0
define i64 @__stdfix_sat_hr(i64 %0) {
ret i64 0
}
/* Variables and functions */
char toupper(char);
void upperstr(char *s) {
  for (; '\0' != *s; s++)
    *s = toupper(*s);
}


x86 assembly (clang, -O0):
<upperstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1152 <upperstr+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <upperstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @upperstr(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* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int g(double x) { return (int)x; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
void getString(unsigned int src, unsigned char *outstring, unsigned int count) {
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @getString(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
void *calloc(unsigned long, int);
int /*<<< orphan*/ free(void *);
void f3(int i) {
  unsigned long j;
  j = 10;
  i = -1;
  if (i < 0) {
    void *ptr = calloc(j, i);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
movl   $0xffffffff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115d <f3+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
mov    $0xa,%edi
mov    $0xffffffff,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f3(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
store i64 10, i64* %3
store i32 -1, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = call i8* @calloc(i64 %8, i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @f3(i32 %0) {
%2 = tail call i8* @calloc(i64 10, i32 -1)
%3 = tail call i32 @free(i8* %2)
ret void
}
void BIO_dump_cb(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_dump_cb() {
ret void
}
unsigned char bitsum0(unsigned char byte) {
  unsigned char ret;
  unsigned char i;
  for (i = 0, ret = 0; i < 8; i++)
    if (!(byte & 0x01 << i))
      ret++;
  return ret;
}


x86 assembly (clang, -O0):
<bitsum0>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x8,%eax
jge    1155 <bitsum0+0x55>
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1143 <bitsum0+0x43>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1148 <bitsum0+0x48>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    1112 <bitsum0+0x12>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitsum0>:
mov    %edi,%eax
not    %al
mov    %eax,%ecx
and    $0x1,%cl
mov    %edi,%edx
and    $0x2,%dl
cmp    $0x1,%dl
adc    $0x0,%cl
mov    %edi,%edx
and    $0x4,%dl
cmp    $0x1,%dl
adc    $0x0,%cl
mov    %edi,%edx
and    $0x8,%dl
cmp    $0x1,%dl
adc    $0x0,%cl
mov    %edi,%edx
and    $0x10,%dl
cmp    $0x1,%dl
adc    $0x0,%cl
mov    %edi,%edx
and    $0x20,%dl
cmp    $0x1,%dl
adc    $0x0,%cl
and    $0x40,%dil
cmp    $0x1,%dil
adc    $0x0,%cl
shr    $0x7,%al
add    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bitsum0(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i8 0, i8* %3
br label %5
5: ; preds = %21, %1
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %24
9: ; preds = %5
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = shl i32 1, %13
%15 = and i32 %11, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %9
%18 = load i8, i8* %3
%19 = add i8 %18, 1
store i8 %19, i8* %3
br label %20
20: ; preds = %17, %9
br label %21
21: ; preds = %20
%22 = load i8, i8* %4
%23 = add i8 %22, 1
store i8 %23, i8* %4
br label %5
24: ; preds = %5
%25 = load i8, i8* %3
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @bitsum0(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = xor i8 %2, 1
%4 = lshr i8 %0, 1
%5 = and i8 %4, 1
%6 = xor i8 %5, 1
%7 = add nuw nsw i8 %3, %6
%8 = lshr i8 %0, 2
%9 = and i8 %8, 1
%10 = xor i8 %9, 1
%11 = add nuw nsw i8 %7, %10
%12 = lshr i8 %0, 3
%13 = and i8 %12, 1
%14 = xor i8 %13, 1
%15 = add nuw nsw i8 %11, %14
%16 = lshr i8 %0, 4
%17 = and i8 %16, 1
%18 = xor i8 %17, 1
%19 = add nuw nsw i8 %15, %18
%20 = lshr i8 %0, 5
%21 = and i8 %20, 1
%22 = xor i8 %21, 1
%23 = add nuw nsw i8 %19, %22
%24 = lshr i8 %0, 6
%25 = and i8 %24, 1
%26 = xor i8 %25, 1
%27 = add i8 %23, %26
%28 = xor i8 %0, -1
%29 = lshr i8 %28, 7
%30 = add i8 %27, %29
ret i8 %30
}