xunge/DecIR huggingface dataset:
unsigned short int f54(unsigned short int x, long int y) {
  return (x << ((-y) & (8 * 2 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f54>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f54>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f54(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 15
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = ashr i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f54(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 15
%7 = shl nuw nsw i32 %3, %6
%8 = lshr i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
struct {
  struct {
  } a;
  struct {
    float a[1];
  } b;
} f25(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f25+0x9>
jmp    1109 <f25+0x9>

x86 assembly (clang, -O2):
<f25>:
jmp    1100 <f25>

LLVM IR (-O0):
define float @f25() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define float @f25() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ towlower(scalar_t__);
int iswupper(wint_t wc) { return towlower(wc) != wc; }


x86 assembly (clang, -O0):
<iswupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <towlower@plt>
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswupper>:
push   %rbx
mov    %rdi,%rbx
call   1030 <towlower@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iswupper(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @towlower(i64 %3)
%5 = load i64, i64* %2
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @iswupper(i64 %0) {
%2 = tail call i64 @towlower(i64 %0)
%3 = icmp ne i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
float deg_to_rad(float deg) { return (deg / 180) * 3.14159265359; }


x86 assembly (clang, -O0):
<deg_to_rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_to_rad>:
divss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @deg_to_rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 1.800000e+02
%5 = fpext float %4 to double
%6 = fmul double %5, 0x400921FB54442EEA
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @deg_to_rad(float %0) {
%2 = fdiv float %0, 1.800000e+02
%3 = fpext float %2 to double
%4 = fmul double %3, 0x400921FB54442EEA
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int __cxa_atexit(void (*)(void *), int /*<<< orphan*/ *, int /*<<< orphan*/);
int atexit(void (*func)(void)) {
  return __cxa_atexit((void (*)(void *))func, NULL, 0);
}


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

x86 assembly (clang, -O2):
<atexit>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__cxa_atexit@plt>

LLVM IR (-O0):
define i32 @atexit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (i8*)*
%5 = call i32 @__cxa_atexit(void (i8*)* %4, i32* null, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @atexit(void ()* %0) {
%2 = bitcast void ()* %0 to void (i8*)*
%3 = tail call i32 @__cxa_atexit(void (i8*)* %2, i32* null, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ INTMAX_MAX;
int /*<<< orphan*/ INTMAX_MIN;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
intmax_t xsd_intmax_value(const char *literal) {
  return (intmax_t)xsd_integer_value(literal, INTMAX_MIN, INTMAX_MAX);
}


x86 assembly (clang, -O0):
<xsd_intmax_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_intmax_value>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <xsd_integer_value@plt>

LLVM IR (-O0):
@INTMAX_MIN = global i32 0
@INTMAX_MAX = global i32 0
define i32 @xsd_intmax_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @INTMAX_MIN
%5 = load i32, i32* @INTMAX_MAX
%6 = call i32 @xsd_integer_value(i8* %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@INTMAX_MIN = global i32 0
@INTMAX_MAX = global i32 0
define i32 @xsd_intmax_value(i8* %0) {
%2 = load i32, i32* @INTMAX_MIN
%3 = load i32, i32* @INTMAX_MAX
%4 = tail call i32 @xsd_integer_value(i8* %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ std_matrix_mul(int *, int *, int *, int);
int *xmalloc_aligned(int, int);
void generate_result(int *input_matrixes[2], int **res, int matrix_size) {
  *res = xmalloc_aligned(matrix_size * matrix_size * sizeof(int), 4096);
  std_matrix_mul(input_matrixes[0], input_matrixes[1], *res, matrix_size);
}


x86 assembly (clang, -O0):
<generate_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
mov    $0x1000,%esi
call   1030 <xmalloc_aligned@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <std_matrix_mul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_result>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
imul   %edx,%edi
shl    $0x2,%edi
mov    $0x1000,%esi
call   1030 <xmalloc_aligned@plt>
mov    %rax,(%r14)
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
mov    %rax,%rdx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <std_matrix_mul@plt>

LLVM IR (-O0):
define void @generate_result(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* %6
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32* @xmalloc_aligned(i32 %12, i32 4096)
%14 = load i32**, i32*** %5
store i32* %13, i32** %14
%15 = load i32**, i32*** %4
%16 = getelementptr inbounds i32*, i32** %15, i64 0
%17 = load i32*, i32** %16
%18 = load i32**, i32*** %4
%19 = getelementptr inbounds i32*, i32** %18, i64 1
%20 = load i32*, i32** %19
%21 = load i32**, i32*** %5
%22 = load i32*, i32** %21
%23 = load i32, i32* %6
%24 = call i32 @std_matrix_mul(i32* %17, i32* %20, i32* %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @generate_result(i32** nocapture %0, i32** nocapture writeonly %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = mul i32 %4, %2
%6 = tail call i32* @xmalloc_aligned(i32 %5, i32 4096)
store i32* %6, i32** %1
%7 = load i32*, i32** %0
%8 = getelementptr inbounds i32*, i32** %0, i64 1
%9 = load i32*, i32** %8
%10 = tail call i32 @std_matrix_mul(i32* %7, i32* %9, i32* %6, i32 %2)
ret void
}
int x34_process_syn(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x34_process_syn(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x34_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_tmp_string(int /*<<< orphan*/);
int /*<<< orphan*/ yyerror(char *);
int /*<<< orphan*/ yylval_restore(int);
int jump(int jmp) {
  if (jmp <= 0) {
    yyerror("Error in jump");
    return 0;
  }
  yylval_restore(jmp);
  cleanup_tmp_string(0);
  return 1;
}


x86 assembly (clang, -O0):
<jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     115d <jump+0x2d>
lea    0xeb4(%rip),%rdi
call   1040 <yyerror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <jump+0x43>
mov    -0x8(%rbp),%edi
call   1030 <yylval_restore@plt>
xor    %edi,%edi
call   1050 <cleanup_tmp_string@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump>:
push   %rax
test   %edi,%edi
jle    1148 <jump+0x18>
call   1030 <yylval_restore@plt>
xor    %edi,%edi
call   1050 <cleanup_tmp_string@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1040 <yyerror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Error in jump\00"
define i32 @jump(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @yyerror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = tail call i32 @yylval_restore(i32 %0)
%7 = tail call i32 @cleanup_tmp_string(i32 0)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 0, %3 ], [ 1, %5 ]
ret i32 %9
}
void init_asig_section() {}


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

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

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

LLVM IR (-O2):
define void @init_asig_section() {
ret void
}
/* Variables and functions */
int b(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return b(0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <b@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @b(i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @b(i32 0, i32 0)
ret i32 %1
}
int fuzzCorrupt() { return 11; }


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

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

LLVM IR (-O0):
define i32 @fuzzCorrupt() {
ret i32 11
}

LLVM IR (-O2):
define i32 @fuzzCorrupt() {
ret i32 11
}
int save_state(char *fin, char *fout) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @save_state(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int truncf(double);
double trun5(double x) { return truncf(x * 1e5) / 1e5; }


x86 assembly (clang, -O0):
<trun5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <truncf@plt>
cvtsi2sd %eax,%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trun5>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <truncf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @trun5(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+05
%5 = call i32 @truncf(double %4)
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+05
ret double %7
}

LLVM IR (-O2):
define double @trun5(double %0) {
%2 = fmul double %0, 1.000000e+05
%3 = tail call i32 @truncf(double %2)
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+05
ret double %5
}
void UART3_RX_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART3_RX_intr() {
ret void
}
void gtk_size_group_mode_get_type() {}


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

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

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

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

/* Variables and functions */
void rgb32toRgb(uint32_t c, uint8_t dst[4]) {
  uint8_t a = (c >> 24) & 0xff;
  uint8_t r = (c >> 16) & 0xff;
  uint8_t g = (c >> 8) & 0xff;
  uint8_t b = c & 0xff;
  dst[0] = r;
  dst[1] = g;
  dst[2] = b;
  dst[3] = a;
}


x86 assembly (clang, -O0):
<rgb32toRgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb32toRgb>:
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%edi
shr    $0x18,%eax
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,(%rsi)
mov    %edx,0x4(%rsi)
mov    %edi,0x8(%rsi)
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @rgb32toRgb(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32, i32* %3
%10 = ashr i32 %9, 24
%11 = and i32 %10, 255
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 16
%14 = and i32 %13, 255
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
store i32 %17, i32* %7
%18 = load i32, i32* %3
%19 = and i32 %18, 255
store i32 %19, i32* %8
%20 = load i32, i32* %6
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 %20, i32* %22
%23 = load i32, i32* %7
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 1
store i32 %23, i32* %25
%26 = load i32, i32* %8
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 2
store i32 %26, i32* %28
%29 = load i32, i32* %5
%30 = load i32*, i32** %4
%31 = getelementptr inbounds i32, i32* %30, i64 3
store i32 %29, i32* %31
ret void
}

LLVM IR (-O2):
define void @rgb32toRgb(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = lshr i32 %0, 16
%5 = and i32 %4, 255
%6 = lshr i32 %0, 8
%7 = and i32 %6, 255
%8 = and i32 %0, 255
store i32 %5, i32* %1
%9 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %7, i32* %9
%10 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %10
%11 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %3, i32* %11
ret void
}
/* Variables and functions */
void qikswap(int *a, size_t i, size_t j) {
  int temp;
  temp = a[i];
  a[i] = a[j];
  a[j] = temp;
}


x86 assembly (clang, -O0):
<qikswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @qikswap(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i32, i32* %16, i64 %17
store i32 %15, i32* %18
%19 = load i32, i32* %7
%20 = load i32*, i32** %4
%21 = load i64, i64* %6
%22 = getelementptr inbounds i32, i32* %20, i64 %21
store i32 %19, i32* %22
ret void
}

LLVM IR (-O2):
define void @qikswap(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 %2
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
int /*<<< orphan*/ scanf(char *, char *, char *, char *);
int main() {
  char ch0, ch1, ch2;
  scanf("%c%c%c", &ch0, &ch1, &ch2);
  printf("[%c][%c][%c]\n", ch0, ch1, ch2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
lea    -0x2(%rbp),%rdx
lea    -0x3(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
lea    0xeba(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x3(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rdx
lea    0x5(%rsp),%rcx
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
movsbl 0x5(%rsp),%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [14 x i8] c"[%c][%c][%c]\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %6, i8 signext %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t swap(uint32_t val) { return ntohl(val); }


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

x86 assembly (clang, -O2):
<swap>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @swap(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
void g_scanner_input_text() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_input_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertEquals(int, int /*<<< orphan*/);
int /*<<< orphan*/ sumBelow(int);
int main() {
  assertEquals(0, sumBelow(3));
  assertEquals(3, sumBelow(4));
  assertEquals(8, sumBelow(6));
  assertEquals(23, sumBelow(10));
  assertEquals(23, sumBelow(1000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <sumBelow@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assertEquals@plt>
mov    $0x4,%edi
call   1040 <sumBelow@plt>
mov    %eax,%esi
mov    $0x3,%edi
call   1030 <assertEquals@plt>
mov    $0x6,%edi
call   1040 <sumBelow@plt>
mov    %eax,%esi
mov    $0x8,%edi
call   1030 <assertEquals@plt>
mov    $0xa,%edi
call   1040 <sumBelow@plt>
mov    %eax,%esi
mov    $0x17,%edi
call   1030 <assertEquals@plt>
mov    $0x3e8,%edi
call   1040 <sumBelow@plt>
mov    %eax,%esi
mov    $0x17,%edi
call   1030 <assertEquals@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <sumBelow@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x4,%edi
call   1040 <sumBelow@plt>
mov    $0x3,%edi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x6,%edi
call   1040 <sumBelow@plt>
mov    $0x8,%edi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0xa,%edi
call   1040 <sumBelow@plt>
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <assertEquals@plt>
mov    $0x3e8,%edi
call   1040 <sumBelow@plt>
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <assertEquals@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sumBelow(i32 3)
%3 = call i32 @assertEquals(i32 0, i32 %2)
%4 = call i32 @sumBelow(i32 4)
%5 = call i32 @assertEquals(i32 3, i32 %4)
%6 = call i32 @sumBelow(i32 6)
%7 = call i32 @assertEquals(i32 8, i32 %6)
%8 = call i32 @sumBelow(i32 10)
%9 = call i32 @assertEquals(i32 23, i32 %8)
%10 = call i32 @sumBelow(i32 1000)
%11 = call i32 @assertEquals(i32 23, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sumBelow(i32 3)
%2 = tail call i32 @assertEquals(i32 0, i32 %1)
%3 = tail call i32 @sumBelow(i32 4)
%4 = tail call i32 @assertEquals(i32 3, i32 %3)
%5 = tail call i32 @sumBelow(i32 6)
%6 = tail call i32 @assertEquals(i32 8, i32 %5)
%7 = tail call i32 @sumBelow(i32 10)
%8 = tail call i32 @assertEquals(i32 23, i32 %7)
%9 = tail call i32 @sumBelow(i32 1000)
%10 = tail call i32 @assertEquals(i32 23, i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsncmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninivar_wcsncmp(void) {
  wchar_t *ct;
  wchar_t *s;
  size_t n;
  (void)wcsncmp(ct, s, n);
}


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

x86 assembly (clang, -O2):
<uninivar_wcsncmp>:
jmp    1030 <wcsncmp@plt>

LLVM IR (-O0):
define void @uninivar_wcsncmp() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i64, i64* %3
%7 = call i32 @wcsncmp(i32* %4, i32* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcsncmp() {
%1 = tail call i32 @wcsncmp(i32* undef, i32* undef, i64 undef)
ret void
}
void dolook_interactive(str) char *str;
{
  dolook(str);
  (void)printf("\n-- Type space to continue --");
  (void)getchar();
}


x86 assembly (clang, -O0):
<dolook_interactive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <dolook@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dolook_interactive>:
push   %rax
xor    %eax,%eax
call   1040 <dolook@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A-- Type space to continue --\00"
define void @dolook_interactive(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @dolook to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A-- Type space to continue --\00"
define void @dolook_interactive(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @dolook to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_unmask_do(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 &= ~0x08;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_unmask_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_unmask_do+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffff7,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_unmask_do+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_unmask_do>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_unmask_do+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffff7,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_unmask_do() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -9
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_unmask_do() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -9
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
void foo726(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo726(i32 %0) {
ret void
}
/* Variables and functions */
int fabs(double);
int is_close(double a, double b) { return fabs(a - b) < 1e-5; }


x86 assembly (clang, -O0):
<is_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_close>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_close(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = sitofp i32 %8 to double
%10 = fcmp olt double %9, 1.000000e-05
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_close(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
int isup_check_status(unsigned char *sent_status, unsigned char *got_status,
                      int range) {
  int i;
  for (i = 0; i <= range; i++) {
    if (got_status[i] > sent_status[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isup_check_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1161 <isup_check_status+0x61>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jle    114e <isup_check_status+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isup_check_status+0x68>
jmp    1153 <isup_check_status+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <isup_check_status+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isup_check_status>:
test   %edx,%edx
js     1122 <isup_check_status+0x22>
add    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
cmp    (%rdi,%rax,1),%cl
ja     1125 <isup_check_status+0x25>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <isup_check_status+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isup_check_status(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = add nuw i32 %2, 1
%7 = zext i32 %6 to i64
br label %11
8: ; preds = %11
%9 = add nuw nsw i64 %12, 1
%10 = icmp eq i64 %9, %7
br i1 %10, label %18, label %11
11: ; preds = %5, %8
%12 = phi i64 [ 0, %5 ], [ %9, %8 ]
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %0, i64 %12
%16 = load i8, i8* %15
%17 = icmp ugt i8 %14, %16
br i1 %17, label %18, label %8
18: ; preds = %11, %8, %3
%19 = phi i32 [ 0, %3 ], [ 0, %8 ], [ 1, %11 ]
ret i32 %19
}
void addon_loop() {}


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

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

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

LLVM IR (-O2):
define void @addon_loop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("hello\n");
  ;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_standard_Laurent_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(792, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_standard_Laurent_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x318,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_standard_Laurent_homotopy>:
mov    $0x318,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @create_standard_Laurent_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 792, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_standard_Laurent_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 792, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
size_t html_tbl_len(size_t sz, void *arg) { return (sz); }


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

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

LLVM IR (-O0):
define i64 @html_tbl_len(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @html_tbl_len(i64 returned %0, i8* nocapture readnone %1) {
ret i64 %0
}
/* Type definitions */
typedef int useconds_t;
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void test_usleep(useconds_t usec) {
  struct timespec ts = {.tv_sec = 0, .tv_nsec = (1000 * (usec))};
  assert(nanosleep(&ts, NULL) == 0);
}


x86 assembly (clang, -O0):
<test_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_usleep>:
push   %rax
imul   $0x3e8,%edi,%eax
mov    %eax,(%rsp)
movl   $0x0,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @test_usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = mul nsw i32 1000, %5
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %7
%8 = call i64 @nanosleep(%struct.timespec* %3, i32* null)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @test_usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = mul nsw i32 %0, 1000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %6
%7 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ move2str(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
void dbg_print_move(uint32_t move) {
  char movestr[7];
  move2str(move, movestr);
  printf("%s\n", movestr);
}


x86 assembly (clang, -O0):
<dbg_print_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xb(%rbp),%rsi
call   1040 <move2str@plt>
lea    -0xb(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_print_move>:
push   %rbx
sub    $0x10,%rsp
lea    0x9(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <move2str@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @dbg_print_move(i32 %0) {
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%4 = call i32 @move2str(i32 %0, i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, char const *,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
__attribute__((visibility("hidden"))) void
__eprintf(const char *format, const char *assertion_expression,
          const char *line, const char *file) {
  fprintf(stderr, format, assertion_expression, line, file);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<__eprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1040 <fprintf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__eprintf>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2e9c(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define hidden void @__eprintf(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* %10, i8* %11, i8* %12, i8* %13)
%15 = load i32, i32* @stderr
%16 = call i32 @fflush(i32 %15)
%17 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define hidden void @__eprintf(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* %0, i8* %1, i8* %2, i8* %3)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *get_string_at_field(char *, int);
char *get_reward(char *line) { return get_string_at_field(line, 2); }


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

x86 assembly (clang, -O2):
<get_reward>:
mov    $0x2,%esi
jmp    1030 <get_string_at_field@plt>

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

LLVM IR (-O2):
define i8* @get_reward(i8* %0) {
%2 = tail call i8* @get_string_at_field(i8* %0, i32 2)
ret i8* %2
}
__attribute__((always_)) void inc_syscw(struct task_struct *tsk) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @inc_syscw(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @inc_syscw(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t QEIDirectionGet(uint32_t ui32Base) {
  ;
  return (((*((volatile uint32_t *)(ui32Base + 0x00000004))) & 0x00000002) ? -1
                                                                           : 1);
}


x86 assembly (clang, -O0):
<QEIDirectionGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%edx
and    $0x2,%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIDirectionGet>:
movslq %edi,%rax
mov    0x4(%rax),%eax
and    $0x2,%eax
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @QEIDirectionGet(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Variables and functions */
void *malloc(size_t);
void stub1(int, char *, int);
void *km_malloc_(size_t size, void (*onerr)(int, char *, int), char *file,
                 int line) {
  void *ret = malloc(size);
  if (ret == NULL) {
    (*onerr)(1, file, line);
    return NULL;
  } else {
    return ret;
  }
}


x86 assembly (clang, -O0):
<km_malloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    115e <km_malloc_+0x4e>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    $0x1,%edi
call   *%rax
movq   $0x0,-0x8(%rbp)
jmp    1166 <km_malloc_+0x56>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<km_malloc_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rsi,%r15
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113b <km_malloc_+0x2b>
mov    $0x1,%edi
mov    %rbp,%rsi
mov    %r14d,%edx
call   *%r15
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @km_malloc_(i64 %0, void (i32, i8*, i32)* nocapture %1, i8* %2, i32 %3) {
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %4
tail call void %1(i32 1, i8* %2, i32 %3)
br label %8
8: ; preds = %4, %7
ret i8* %5
}