xunge/DecIR huggingface dataset:
long int ASL(long int A, long int B) {
  int i = 0;
  int result = A;
  for (i = 0; i < B; i++) {
    result = result * 2;
  }
  return result;
}


x86 assembly (clang, -O0):
<ASL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1146 <ASL+0x46>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <ASL+0x21>
movslq -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASL>:
test   %rsi,%rsi
jle    1138 <ASL+0x38>
lea    -0x1(%rsi),%rcx
mov    %esi,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jb     1129 <ASL+0x29>
and    $0xfffffffffffffff8,%rsi
nopl   0x0(%rax,%rax,1)
shl    $0x8,%edi
add    $0xfffffffffffffff8,%rsi
jne    1120 <ASL+0x20>
test   %rax,%rax
je     1138 <ASL+0x38>
xchg   %ax,%ax
add    %edi,%edi
add    $0xffffffffffffffff,%rax
jne    1130 <ASL+0x30>
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @ASL(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
store i32 0, i32* %5
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
store i32 %8, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = load i64, i64* %4
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 2
store i32 %16, i32* %6
br label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
define i64 @ASL(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %27
5: ; preds = %2
%6 = add i64 %1, -1
%7 = and i64 %1, 7
%8 = icmp ult i64 %6, 7
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = and i64 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ %3, %9 ], [ %14, %11 ]
%13 = phi i64 [ 0, %9 ], [ %15, %11 ]
%14 = shl i32 %12, 8
%15 = add i64 %13, 8
%16 = icmp eq i64 %15, %10
br i1 %16, label %17, label %11
17: ; preds = %11, %5
%18 = phi i32 [ undef, %5 ], [ %14, %11 ]
%19 = phi i32 [ %3, %5 ], [ %14, %11 ]
%20 = icmp eq i64 %7, 0
br i1 %20, label %27, label %21
21: ; preds = %17, %21
%22 = phi i32 [ %24, %21 ], [ %19, %17 ]
%23 = phi i64 [ %25, %21 ], [ 0, %17 ]
%24 = shl nsw i32 %22, 1
%25 = add i64 %23, 1
%26 = icmp eq i64 %25, %7
br i1 %26, label %27, label %21
27: ; preds = %17, %21, %2
%28 = phi i32 [ %3, %2 ], [ %18, %17 ], [ %24, %21 ]
%29 = sext i32 %28 to i64
ret i64 %29
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float ntp32_to_ms(uint32_t time) {
  return (float)(((time & 0xFFFF0000) >> 16) +
                 ((time & 0x0000FFFF) << 16) / 4294967296.0);
}


x86 assembly (clang, -O0):
<ntp32_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeda(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntp32_to_ms>:
mov    %edi,%eax
shr    $0x10,%eax
cvtsi2sd %eax,%xmm0
shl    $0x10,%edi
cvtsi2sd %edi,%xmm1
mulsd  0xee8(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ntp32_to_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
%6 = uitofp i32 %5 to double
%7 = load i32, i32* %2
%8 = and i32 %7, 65535
%9 = shl i32 %8, 16
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 0x41F0000000000000
%12 = fadd double %6, %11
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @ntp32_to_ms(i32 %0) {
%2 = lshr i32 %0, 16
%3 = uitofp i32 %2 to double
%4 = shl i32 %0, 16
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x3DF0000000000000
%7 = fadd double %6, %3
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
float root(float, int);
float cbrt(float x) { return root(x, 3); }


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

x86 assembly (clang, -O2):
<cbrt>:
mov    $0x3,%edi
jmp    1030 <root@plt>

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

LLVM IR (-O2):
define float @cbrt(float %0) {
%2 = tail call float @root(float %0, i32 3)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ four1(float *, int, int);
int main(void) {
  float data[8] = {0., 0., 1., 0., 2., 0., 3., 0.};
  four1(data - 1, 4, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <four1@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    -0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <four1@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.data = [8 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00, float 0.000000e+00, float 3.000000e+00, float 0.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x float]
store i32 0, i32* %1
%3 = bitcast [8 x float]* %2 to i8*
%4 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%5 = getelementptr inbounds float, float* %4, i64 -1
%6 = call i32 @four1(float* %5, i32 4, i32 1)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [8 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00, float 0.000000e+00, float 3.000000e+00, float 0.000000e+00]
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 -1
%4 = call i32 @four1(float* %3, i32 4, i32 1)
ret i32 0
}
int iw_is_input_fmt_supported(int fmt) {
  switch (fmt) {
  case 5:
  case 7:
  case 3:
  case 8:
  case 12:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iw_is_input_fmt_supported>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3,%eax
je     1151 <iw_is_input_fmt_supported+0x51>
jmp    111b <iw_is_input_fmt_supported+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     1151 <iw_is_input_fmt_supported+0x51>
jmp    112c <iw_is_input_fmt_supported+0x2c>
mov    -0xc(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     1151 <iw_is_input_fmt_supported+0x51>
jmp    1140 <iw_is_input_fmt_supported+0x40>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
jne    115d <iw_is_input_fmt_supported+0x5d>
jmp    1151 <iw_is_input_fmt_supported+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1164 <iw_is_input_fmt_supported+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_is_input_fmt_supported>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     1117 <iw_is_input_fmt_supported+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @iw_is_input_fmt_supported(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 5, label %5
i32 7, label %5
i32 3, label %5
i32 8, label %5
i32 12, label %5
]
5: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.iw_is_input_fmt_supported = [10 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @iw_is_input_fmt_supported(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.iw_is_input_fmt_supported, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_destroy>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
double _orbita_potential_miyamoto_disk_Mt(const void *par) {
  return ((double *)par)[0];
}


x86 assembly (clang, -O0):
<_orbita_potential_miyamoto_disk_Mt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_potential_miyamoto_disk_Mt>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @_orbita_potential_miyamoto_disk_Mt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @_orbita_potential_miyamoto_disk_Mt(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Type definitions */
struct RNAdistance_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNAdistance_cmdline_parser_required(struct RNAdistance_args_info *args_info,
                                        const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNAdistance_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNAdistance_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAdistance_cmdline_parser_required(%struct.RNAdistance_args_info* %0, i8* %1) {
%3 = alloca %struct.RNAdistance_args_info*
%4 = alloca i8*
store %struct.RNAdistance_args_info* %0, %struct.RNAdistance_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNAdistance_args_info*, %struct.RNAdistance_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNAdistance_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAdistance_cmdline_parser_required(%struct.RNAdistance_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kybrd_ctrl_send_cmd(int);
int /*<<< orphan*/ kybrd_enc_send_cmd(int);
void kkybrd_reset_system() {
  kybrd_ctrl_send_cmd(0xD1);
  kybrd_enc_send_cmd(0xfe);
}


x86 assembly (clang, -O0):
<kkybrd_reset_system>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd1,%edi
call   1030 <kybrd_ctrl_send_cmd@plt>
mov    $0xfe,%edi
call   1040 <kybrd_enc_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kkybrd_reset_system>:
push   %rax
mov    $0xd1,%edi
call   1030 <kybrd_ctrl_send_cmd@plt>
mov    $0xfe,%edi
pop    %rax
jmp    1040 <kybrd_enc_send_cmd@plt>

LLVM IR (-O0):
define void @kkybrd_reset_system() {
%1 = call i32 @kybrd_ctrl_send_cmd(i32 209)
%2 = call i32 @kybrd_enc_send_cmd(i32 254)
ret void
}

LLVM IR (-O2):
define void @kkybrd_reset_system() {
%1 = tail call i32 @kybrd_ctrl_send_cmd(i32 209)
%2 = tail call i32 @kybrd_enc_send_cmd(i32 254)
ret void
}
int test_imm_90int16_reg(short val) {
  return ((val) & (-0x90 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_90int16_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, -144
%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_90int16_reg(i16 signext %0) {
%2 = and i16 %0, -144
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void INT_Excep_PERIB_INTB136(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB136() {
ret void
}
int f4(int x) { return x; }


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

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @f4(i32 returned %0) {
ret i32 %0
}
int tegra_dvfs_predict_millivolts(struct clk *c, unsigned long rate) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i32 @tegra_dvfs_predict_millivolts(%struct.clk* %0, i64 %1) {
%3 = alloca %struct.clk*
%4 = alloca i64
store %struct.clk* %0, %struct.clk** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @tegra_dvfs_predict_millivolts(%struct.clk* nocapture readnone %0, i64 %1) {
ret i32 0
}
void explode(char *buf, char **cmd, char **param) {
  printf("%s\n", param);
  return;
}


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

x86 assembly (clang, -O2):
<explode>:
mov    %rdx,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @explode(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = bitcast i8** %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_help(const char *explanation) {
  fprintf(stderr,
          "%s"
          "usage: hx [-hv] [-o octets_per_line] [-g grouping_bytes] filename\n"
          "\n"
          "Command options:\n"
          "    -h     Print this cruft and exits\n"
          "    -v     Version information\n"
          "    -o     Amount of octets per line\n"
          "    -g     Grouping of bytes in one line\n"
          "\n"
          "Currently, both these values are advised to be a multiple of 2\n"
          "to prevent garbled display :)\n"
          "\n"
          "Report bugs to <krpors at gmail.com> or see "
          "<http://github.com/krpors/hx>\n",
          explanation);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [403 x i8] c"%susage: hx [-hv] [-o octets_per_line] [-g grouping_bytes] filename\0A\0ACommand options:\0A -h Print this cruft and exits\0A -v Version information\0A -o Amount of octets per line\0A -g Grouping of bytes in one line\0A\0ACurrently, both these values are advised to be a multiple of 2\0Ato prevent garbled display :)\0A\0AReport bugs to <krpors at gmail.com> or see <http://github.com/krpors/hx>\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [403 x i8] c"%susage: hx [-hv] [-o octets_per_line] [-g grouping_bytes] filename\0A\0ACommand options:\0A -h Print this cruft and exits\0A -v Version information\0A -o Amount of octets per line\0A -g Grouping of bytes in one line\0A\0ACurrently, both these values are advised to be a multiple of 2\0Ato prevent garbled display :)\0A\0AReport bugs to <krpors at gmail.com> or see <http://github.com/krpors/hx>\0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_APPLETALK;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main() {
  if (socket(AF_APPLETALK, SOCK_DGRAM, 0) != -1) {
    fprintf(stderr, "Opening Appletalk socket worked, should be blocked\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
cmp    $0xffffffff,%eax
je     1172 <main+0x52>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1179 <main+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1040 <socket@plt>
cmp    $0xffffffff,%eax
je     115b <main+0x3b>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_APPLETALK = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [52 x i8] c"Opening Appletalk socket worked, should be blocked\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AF_APPLETALK
%3 = load i32, i32* @SOCK_DGRAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_APPLETALK = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [52 x i8] c"Opening Appletalk socket worked, should be blocked\0A\00"
define i32 @main() {
%1 = load i32, i32* @AF_APPLETALK
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ 1, %5 ], [ 0, %0 ]
ret i32 %9
}
unsigned int get_word(unsigned char *p) {
  unsigned int t;
  t = p[1];
  t = ((t << 8) | p[0]);
  return t;
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_word(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %9, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_word(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
int intercepted() { return 666; }


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

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

LLVM IR (-O0):
define i32 @intercepted() {
ret i32 666
}

LLVM IR (-O2):
define i32 @intercepted() {
ret i32 666
}
long double bar_long_double(void) {
  return creall(foo_long_double(2.0L - 2.5Li));
}


x86 assembly (clang, -O0):
<bar_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
flds   0xee2(%rip)
fstpt  -0x20(%rbp)
flds   0xedd(%rip)
fstpt  -0x10(%rbp)
movaps -0x20(%rbp),%xmm0
movaps -0x10(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
xor    %eax,%eax
call   1030 <foo_long_double@plt>
mov    %eax,-0x24(%rbp)
fildl  -0x24(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_long_double>:
sub    $0x58,%rsp
flds   0xee6(%rip)
fstpt  0x30(%rsp)
flds   0xee0(%rip)
fstpt  0x40(%rsp)
movaps 0x30(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <foo_long_double@plt>
mov    %eax,0x2c(%rsp)
fildl  0x2c(%rsp)
add    $0x58,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @bar_long_double() {
%1 = alloca { x86_fp80, x86_fp80 }
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 1
store x86_fp80 0xK40008000000000000000, x86_fp80* %2
store x86_fp80 0xKC000A000000000000000, x86_fp80* %3
%4 = call i32 ({ x86_fp80, x86_fp80 }*, ...) bitcast (i32 (...)* @foo_long_double to i32 ({ x86_fp80, x86_fp80 }*, ...)*)({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1)
%5 = sitofp i32 %4 to x86_fp80
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @bar_long_double() {
%1 = alloca { x86_fp80, x86_fp80 }
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 0
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 1
store x86_fp80 0xK40008000000000000000, x86_fp80* %2
store x86_fp80 0xKC000A000000000000000, x86_fp80* %3
%4 = tail call i32 ({ x86_fp80, x86_fp80 }*, ...) bitcast (i32 (...)* @foo_long_double to i32 ({ x86_fp80, x86_fp80 }*, ...)*)({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1)
%5 = sitofp i32 %4 to x86_fp80
ret x86_fp80 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void fat_uint16(uint8_t *dest, uint16_t value) {
  dest[0] = value;
  dest[1] = value >> 8;
}


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

x86 assembly (clang, -O2):
<fat_uint16>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @fat_uint16(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
long long cost(long n, long h, long l, long m, long k) {
  return (long long)m * m * m * n * k * (n - h) * k;
}


x86 assembly (clang, -O0):
<cost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
imul   -0x8(%rbp),%rax
imul   -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
imul   %rcx,%rax
imul   -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cost>:
mov    %rdi,%rax
sub    %rsi,%rax
imul   %rcx,%r8
imul   %rcx,%rdi
imul   %rdi,%rax
imul   %r8,%r8
imul   %r8,%rax
ret

LLVM IR (-O0):
define i64 @cost(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %9
%12 = load i64, i64* %9
%13 = mul nsw i64 %11, %12
%14 = load i64, i64* %9
%15 = mul nsw i64 %13, %14
%16 = load i64, i64* %6
%17 = mul nsw i64 %15, %16
%18 = load i64, i64* %10
%19 = mul nsw i64 %17, %18
%20 = load i64, i64* %6
%21 = load i64, i64* %7
%22 = sub nsw i64 %20, %21
%23 = mul nsw i64 %19, %22
%24 = load i64, i64* %10
%25 = mul nsw i64 %23, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @cost(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = sub nsw i64 %0, %1
%7 = mul i64 %4, %3
%8 = mul i64 %6, %0
%9 = mul i64 %8, %3
%10 = mul i64 %9, %7
%11 = mul i64 %10, %7
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int ENOENT;
int NSS_STATUS_NOTFOUND;
enum nss_status _nss_noenum_getpwuid_r(uid_t uid, struct passwd *result,
                                       char *buf, size_t buflen, int *errnop) {
  *errnop = ENOENT;
  return NSS_STATUS_NOTFOUND;
}


x86 assembly (clang, -O0):
<_nss_noenum_getpwuid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_getpwuid_r>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%r8)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getpwuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = load i32, i32* @ENOENT
%12 = load i32*, i32** %10
store i32 %11, i32* %12
%13 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %13
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_NOTFOUND = global i32 0
define i32 @_nss_noenum_getpwuid_r(i32 %0, %struct.passwd* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32* nocapture writeonly %4) {
%6 = load i32, i32* @ENOENT
store i32 %6, i32* %4
%7 = load i32, i32* @NSS_STATUS_NOTFOUND
ret i32 %7
}
/* Variables and functions */
unsigned char vx86_NBSB_Read8(int /*<<< orphan*/, unsigned char);
unsigned char nb_Read8(unsigned char offset) {
  return vx86_NBSB_Read8(0, offset);
}


x86 assembly (clang, -O0):
<nb_Read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_Read8>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <vx86_NBSB_Read8@plt>

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

LLVM IR (-O2):
define zeroext i8 @nb_Read8(i8 zeroext %0) {
%2 = tail call zeroext i8 @vx86_NBSB_Read8(i32 0, i8 zeroext %0)
ret i8 %2
}
const char *Stream_Brief(void) { return "File-like"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"File-like\00"
define i8* @Stream_Brief() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
int quant(int n, int m) {
  int i, neg;
  neg = 0;
  if (n < 0) {
    neg++;
    n = -n;
  }
  i = n / m;
  if (n - m * i > m / 2)
    i += 1;
  i *= m;
  if (neg)
    i = -i;
  return (i);
}


x86 assembly (clang, -O0):
<quant>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <quant+0x2c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1166 <quant+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1182 <quant+0x82>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quant>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cltd
idiv   %esi
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
xor    %r8d,%r8d
cmp    %ecx,%edx
setg   %r8b
add    %r8d,%eax
imul   %esi,%eax
mov    %eax,%ecx
neg    %ecx
test   %edi,%edi
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @quant(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sdiv i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul nsw i32 %19, %20
%22 = sub nsw i32 %18, %21
%23 = load i32, i32* %4
%24 = sdiv i32 %23, 2
%25 = icmp sgt i32 %22, %24
br i1 %25, label %26, label %29
26: ; preds = %14
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %29
29: ; preds = %26, %14
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, %30
store i32 %32, i32* %5
%33 = load i32, i32* %6
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = load i32, i32* %5
%37 = sub nsw i32 0, %36
store i32 %37, i32* %5
br label %38
38: ; preds = %35, %29
%39 = load i32, i32* %5
ret i32 %39
}

LLVM IR (-O2):
define i32 @quant(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub nsw i32 0, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = sdiv i32 %5, %1
%7 = mul nsw i32 %6, %1
%8 = srem i32 %5, %1
%9 = sdiv i32 %1, 2
%10 = icmp sgt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %6, %11
%13 = mul nsw i32 %12, %1
%14 = sub nsw i32 0, %13
%15 = select i1 %3, i32 %14, i32 %13
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("It works!\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"It works!\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"It works!\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
int tamMB(unsigned int nbloques) {
  int tamBitMap = nbloques / (1024 * 8);
  int aux = nbloques % (1024 * 8);
  if (aux != 0) {
    tamBitMap++;
  }
  return tamBitMap;
}


x86 assembly (clang, -O0):
<tamMB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xd,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112e <tamMB+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tamMB>:
mov    %edi,%eax
shr    $0xd,%eax
and    $0x1fff,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tamMB(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 8192
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = urem i32 %7, 8192
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @tamMB(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %0, 8191
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
ret i32 %6
}
int test_imm_FEint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xFE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FEint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xfe,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FEint64_midword_mem>:
testb  $0xfe,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FEint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 254
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_FEint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16646144
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int ENODEV;
int spi_eeprom_read(int busid, int chipid, int address, unsigned char *buf,
                    int len) {
  return -ENODEV;
}


x86 assembly (clang, -O0):
<spi_eeprom_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
mov    0x2ec2(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_eeprom_read>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @spi_eeprom_read(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENODEV
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @spi_eeprom_read(i32 %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENODEV
%7 = sub nsw i32 0, %6
ret i32 %7
}
void ff_hevc_put_hevc_bi_epel_h24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vp8_variance(unsigned char const *, int,
                                unsigned char const *, int, int, int,
                                unsigned int *, int *);
unsigned int vp8_mse16x16_c(const unsigned char *src_ptr, int source_stride,
                            const unsigned char *ref_ptr, int recon_stride,
                            unsigned int *sse) {
  unsigned int var;
  int avg;
  vp8_variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var,
               &avg);
  *sse = var;
  return var;
}


x86 assembly (clang, -O0):
<vp8_mse16x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r9d
lea    -0x2c(%rbp),%r10
lea    -0x30(%rbp),%rax
mov    %r9d,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vp8_variance@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_mse16x16_c>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
lea    0xc(%rsp),%rax
lea    0x8(%rsp),%r10
mov    $0x10,%r8d
mov    $0x10,%r9d
push   %rax
push   %r10
call   1030 <vp8_variance@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vp8_mse16x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %6 to i8*
%9 = bitcast i32* %7 to i8*
%10 = call i32 @vp8_variance(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 16, i32* %6, i32* %7)
%11 = load i32, i32* %6
store i32 %11, i32* %4
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ cache_gc(void *);
void *cachemgr_gc_thread(__attribute__((unused)) void *arg) {
  cache_gc(arg);
  return NULL;
}


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

x86 assembly (clang, -O2):
<cachemgr_gc_thread>:
push   %rax
call   1030 <cache_gc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @cachemgr_gc_thread(i8* %0) {
%2 = tail call i32 @cache_gc(i8* %0)
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_mair0(int /*<<< orphan*/);
void write_prrr(uint32_t prrr) { write_mair0(prrr); }


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

x86 assembly (clang, -O2):
<write_prrr>:
jmp    1030 <write_mair0@plt>

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

LLVM IR (-O2):
define void @write_prrr(i32 %0) {
%2 = tail call i32 @write_mair0(i32 %0)
ret void
}
/* Type definitions */
struct bitstream {
  int dummy;
};

/* Variables and functions */
int bits_get_unsigned_rice(struct bitstream *, int);
int bits_get_signed_rice(struct bitstream *bits, int k) {
  int v = bits_get_unsigned_rice(bits, k);
  return (v >> 1) ^ -(v & 1);
}


x86 assembly (clang, -O0):
<bits_get_signed_rice>:
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 <bits_get_unsigned_rice@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    -0x10(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_get_signed_rice>:
push   %rax
call   1030 <bits_get_unsigned_rice@plt>
mov    %eax,%ecx
sar    %ecx
and    $0x1,%eax
neg    %eax
xor    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bitstream = type { i32 }
define i32 @bits_get_signed_rice(%struct.bitstream* %0, i32 %1) {
%3 = alloca %struct.bitstream*
%4 = alloca i32
%5 = alloca i32
store %struct.bitstream* %0, %struct.bitstream** %3
store i32 %1, i32* %4
%6 = load %struct.bitstream*, %struct.bitstream** %3
%7 = load i32, i32* %4
%8 = call i32 @bits_get_unsigned_rice(%struct.bitstream* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = ashr i32 %9, 1
%11 = load i32, i32* %5
%12 = and i32 %11, 1
%13 = sub nsw i32 0, %12
%14 = xor i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
%struct.bitstream = type { i32 }
define i32 @bits_get_signed_rice(%struct.bitstream* %0, i32 %1) {
%3 = tail call i32 @bits_get_unsigned_rice(%struct.bitstream* %0, i32 %1)
%4 = ashr i32 %3, 1
%5 = and i32 %3, 1
%6 = sub nsw i32 0, %5
%7 = xor i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hexdump(unsigned char *data, int len) {
  int c;
  c = 0;
  while (c < len) {
    printf("%.2x", data[c++]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <hexdump+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <hexdump+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <hexdump+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r12
jne    1140 <hexdump+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2x\00"
define void @hexdump(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %8, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}