xunge/DecIR huggingface dataset:
void c_vector3_multiply_scalar(float *vector, float scalar) {
  vector[0] *= scalar;
  vector[1] *= scalar;
  vector[2] *= scalar;
}


x86 assembly (clang, -O0):
<c_vector3_multiply_scalar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_vector3_multiply_scalar>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @c_vector3_multiply_scalar(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
int gpio_cansleep(unsigned gpio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_cansleep(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Insira um número: \n");
  scanf("%i", &num);
  printf("O número informado foi %i \n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Insira um n\C3\BAmero: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [29 x i8] c"O n\C3\BAmero informado foi %i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [29 x i8] c"O n\C3\BAmero informado foi %i \0A\00"
@str = [20 x i8] c"Insira um n\C3\BAmero: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void test_alignof(int param) {
  __emit_expression_range(0, __alignof__(int) + param);
  __emit_expression_range(0, param + __alignof__(int));
  __emit_expression_range(0, __alignof__(param) + param);
  __emit_expression_range(0, param + __alignof__(param));
}


x86 assembly (clang, -O0):
<test_alignof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
add    $0x4,%rsi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
movslq -0x4(%rbp),%rsi
add    $0x4,%rsi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
movslq -0x4(%rbp),%rsi
add    $0x4,%rsi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
movslq -0x4(%rbp),%rsi
add    $0x4,%rsi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alignof>:
push   %rbx
movslq %edi,%rbx
add    $0x4,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_alignof(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 4, %4
%6 = call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %5)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add i64 %8, 4
%10 = call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %9)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = add i64 4, %12
%14 = call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %13)
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = add i64 %16, 4
%18 = call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %17)
ret void
}

LLVM IR (-O2):
define void @test_alignof(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 4
%4 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %3)
%5 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %3)
%6 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %3)
%7 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i64, ...)*)(i32 0, i64 %3)
ret void
}
int Operand_frr_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_frr_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void usage(FILE *stream, int argc, char *argv[]) {
  fprintf(stream, "Usage: %s VALUE\n", argv[0]);
  fprintf(stream, "\tVALUE is a number between 0 (screen dark) and 976 "
                  "(maximum brightness)\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: %s VALUE\0A\00"
@.str.1 = [73 x i8] c"\09VALUE is a number between 0 (screen dark) and 976 (maximum brightness)\0A\00"
define void @usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %4
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: %s VALUE\0A\00"
@.str.1 = [73 x i8] c"\09VALUE is a number between 0 (screen dark) and 976 (maximum brightness)\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i64 72, i64 1, i32* %0)
ret void
}
void build_so_user_list() {}


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

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

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

LLVM IR (-O2):
define void @build_so_user_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__7__IO__clr();
void Msp430GpioC__14__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__7__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__14__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__7__IO__clr()
ret void
}
/* Variables and functions */
double fmaxf(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <fmaxf+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmaxf+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmaxf(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmaxf(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/);
int /*<<< orphan*/ SSLv23_server_method();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ stderr;
SSL_CTX *InitServerCTX(void) {
  SSL_CTX *ctx;
  ctx = SSL_CTX_new(SSLv23_server_method());
  if (ctx == NULL) {
    ERR_print_errors_fp(stderr);
    abort();
  }
  return ctx;
}


x86 assembly (clang, -O0):
<InitServerCTX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <SSLv23_server_method@plt>
mov    %eax,%edi
call   1050 <SSL_CTX_new@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117a <InitServerCTX+0x3a>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitServerCTX>:
push   %rax
xor    %eax,%eax
call   1040 <SSLv23_server_method@plt>
mov    %eax,%edi
call   1050 <SSL_CTX_new@plt>
test   %rax,%rax
je     1156 <InitServerCTX+0x16>
pop    %rcx
ret
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1060 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32* @InitServerCTX() {
%1 = alloca i32*
%2 = call i32 (...) @SSLv23_server_method()
%3 = call i32* @SSL_CTX_new(i32 %2)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @ERR_print_errors_fp(i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = load i32*, i32** %1
ret i32* %11
}

LLVM IR (-O2):
@stderr = global i32 0
define i32* @InitServerCTX() {
%1 = tail call i32 (...) @SSLv23_server_method()
%2 = tail call i32* @SSL_CTX_new(i32 %1)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = tail call i32 @ERR_print_errors_fp(i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ module_exit();
scalar_t__ module_init();
int main(void) {
  if (module_init() != 0)
    goto module_exit;
  module_exit();
module_exit:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <module_init@plt>
cmp    $0x0,%rax
je     1145 <main+0x25>
jmp    114c <main+0x2c>
mov    $0x0,%al
call   1030 <module_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <module_init@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
call   1030 <module_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @module_init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %7
5: ; preds = %0
%6 = call i32 (...) @module_exit()
br label %7
7: ; preds = %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @module_init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @module_exit()
br label %5
5: ; preds = %0, %3
ret i32 0
}
void process() {
  int i;
  while (1) {
    printf_k("1");
    for (i = 0; i < 5000000; i++)
      asm("nop");
  }
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf_k@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x4c4b40,-0x4(%rbp)
jge    1149 <process+0x39>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <process+0x1d>
jmp    1118 <process+0x8>

x86 assembly (clang, -O2):
<process>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf_k@plt>
mov    $0x4c4b40,%eax
nop
nop
add    $0xffffffff,%eax
jne    1130 <process+0x20>
jmp    1120 <process+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
define void @process() {
%1 = alloca i32
br label %2
2: ; preds = %0, %11
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @printf_k to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %4
4: ; preds = %8, %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5000000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
define void @process() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printf_k to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %5, %3 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nuw nsw i32 %4, 1
%6 = icmp eq i32 %5, 5000000
br i1 %6, label %1, label %3
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_Type_Library() {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0xBD;
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<ZW_Type_Library>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movb   $0x0,-0x100(%rbp)
movb   $0xbd,-0xff(%rbp)
lea    -0x100(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_Type_Library>:
sub    $0x108,%rsp
movw   $0xbd00,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_Type_Library() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 -67, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @SerialAPI_request(i8* %4, i32 2)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ZW_Type_Library() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 -67, i8* %3
%4 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %4
}
int test_imm_2Duint8_mem(unsigned char *val) {
  return ((*val) & (0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Duint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 45
%7 = icmp ne i32 %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_2Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 45
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int ind(unsigned short _port) {
  unsigned int data;
  __asm__ __volatile__("inl %%dx, %%eax" : "=a"(data) : "dN"(_port));
  return data;
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @ind(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl %dx, %eax", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @ind(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl %dx, %eax", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
/* Variables and functions */
int __connmanctl_input_init(int, char **);
int main(int argc, char *argv[]) { return __connmanctl_input_init(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <__connmanctl_input_init@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @__connmanctl_input_init(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/ *);
void hiscore_reset(void) {
  FILE *fd = fopen(".snhs", "w");
  freopen(".sbhs", "w", fd);
  fclose(fd);
}


x86 assembly (clang, -O0):
<hiscore_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xeae(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1040 <freopen@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiscore_reset>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xec4(%rip),%r14
mov    %r14,%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb4(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <freopen@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c".snhs\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [6 x i8] c".sbhs\00"
define void @hiscore_reset() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  int a[10];
  for (i = 10 - 1; i >= 0; i--) {
    a[i] = i;
  }
  printf("%d\n", a[i + 1]);
  printf("%d\n", a[10 - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x9,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1150 <main+0x40>
mov    -0x14(%rbp),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
float _atanhf(float);
float atanhf(float x) { return _atanhf(x); }


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

x86 assembly (clang, -O2):
<atanhf>:
jmp    1030 <_atanhf@plt>

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

LLVM IR (-O2):
define float @atanhf(float %0) {
%2 = tail call float @_atanhf(float %0)
ret float %2
}
long parsechar(char *srcptr, char **nextptr) {
  long t = *++srcptr;
  if (nextptr && t) {
    srcptr++;
    if (*srcptr == '\'')
      srcptr++;
    *nextptr = srcptr;
  }
  return t;
}


x86 assembly (clang, -O0):
<parsechar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq 0x1(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <parsechar+0x6d>
cmpq   $0x0,-0x18(%rbp)
je     116d <parsechar+0x6d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    1162 <parsechar+0x62>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsechar>:
mov    0x1(%rdi),%cl
movsbq %cl,%rax
test   %rsi,%rsi
je     1123 <parsechar+0x23>
test   %cl,%cl
je     1123 <parsechar+0x23>
lea    0x2(%rdi),%rcx
cmpb   $0x27,0x2(%rdi)
lea    0x3(%rdi),%rdx
cmove  %rdx,%rcx
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i64 @parsechar(i8* %0, i8** writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = icmp ne i8** %1, null
%6 = icmp ne i8 %4, 0
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 39
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = select i1 %11, i8* %12, i8* %9
store i8* %13, i8** %1
br label %14
14: ; preds = %8, %2
%15 = sext i8 %4 to i64
ret i64 %15
}
int length(char *str) {
  int j = 0;
  int count = 0;
  while (*(str + j) != '\0') {
    count++;
    j++;
  }
  return count;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <length+0x42>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <length+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
cmpb   $0x0,(%rdi)
je     111c <length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ RamRead32A(int, unsigned long *);
unsigned char RdStatus(unsigned char UcStBitChk) {
  unsigned long UlReadVal;
  RamRead32A(0xF100, &UlReadVal);
  if (UcStBitChk) {
    UlReadVal &= 0x01000000;
  }
  if (!UlReadVal) {
    return (0x00);
  } else {
    return (0x01);
  }
}


x86 assembly (clang, -O0):
<RdStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    $0xf100,%edi
lea    -0x10(%rbp),%rsi
call   1030 <RamRead32A@plt>
cmpb   $0x0,-0x2(%rbp)
je     1144 <RdStatus+0x34>
mov    -0x10(%rbp),%rax
and    $0x1000000,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <RdStatus+0x48>
movb   $0x0,-0x1(%rbp)
jmp    115c <RdStatus+0x4c>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdStatus>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rsi
mov    $0xf100,%edi
call   1030 <RamRead32A@plt>
mov    0x8(%rsp),%rax
mov    %eax,%ecx
and    $0x1000000,%ecx
test   %ebx,%ebx
cmove  %rax,%rcx
test   %rcx,%rcx
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @RdStatus(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
%5 = call i32 @RamRead32A(i32 61696, i64* %4)
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %4
%10 = and i64 %9, 16777216
store i64 %10, i64* %4
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11
store i8 0, i8* %2
br label %16
15: ; preds = %11
store i8 1, i8* %2
br label %16
16: ; preds = %15, %14
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @RdStatus(i8 zeroext %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @RamRead32A(i32 61696, i64* %2)
%5 = icmp eq i8 %0, 0
%6 = load i64, i64* %2
%7 = and i64 %6, 16777216
%8 = select i1 %5, i64 %6, i64 %7
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i8
ret i8 %10
}
void foo336() {}


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

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

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

LLVM IR (-O2):
define void @foo336() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void func(int key) {
  char overflowme[32];
  printf("overflow me : ");
  gets(overflowme);
  if (key == 0xcafebabe) {
    system("/bin/sh");
  } else {
    printf("Nah..\n");
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
cmpl   $0xcafebabe,-0x4(%rbp)
jne    116e <func+0x3e>
lea    0xeab(%rip),%rdi
call   1030 <system@plt>
jmp    117a <func+0x4a>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
cmp    $0xcafebabe,%ebx
jne    1171 <func+0x31>
lea    0xea5(%rip),%rdi
call   1040 <system@plt>
jmp    117d <func+0x3d>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"overflow me : \00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [7 x i8] c"Nah..\0A\00"
define void @func(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -889275714
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"overflow me : \00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [6 x i8] c"Nah..\00"
define void @func(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @gets(i8* %3)
%6 = icmp eq i32 %0, -889275714
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}
int set_sta_enable(int radio, int enable) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_sta_enable(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int charToBoardColumn(char);
void bothCasedCharsConvertedToColumnIndex(void) {
  assert(charToBoardColumn('a') == 0);
  assert(charToBoardColumn('t') == 18);
  assert(charToBoardColumn('A') == 0);
  assert(charToBoardColumn('T') == 18);
}


x86 assembly (clang, -O0):
<bothCasedCharsConvertedToColumnIndex>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1040 <charToBoardColumn@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x74,%edi
call   1040 <charToBoardColumn@plt>
cmp    $0x12,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x41,%edi
call   1040 <charToBoardColumn@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x54,%edi
call   1040 <charToBoardColumn@plt>
cmp    $0x12,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bothCasedCharsConvertedToColumnIndex>:
push   %rax
mov    $0x61,%edi
call   1040 <charToBoardColumn@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x74,%edi
call   1040 <charToBoardColumn@plt>
xor    %edi,%edi
cmp    $0x12,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x41,%edi
call   1040 <charToBoardColumn@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x54,%edi
call   1040 <charToBoardColumn@plt>
xor    %edi,%edi
cmp    $0x12,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @bothCasedCharsConvertedToColumnIndex() {
%1 = call i32 @charToBoardColumn(i8 signext 97)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @charToBoardColumn(i8 signext 116)
%6 = icmp eq i32 %5, 18
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @charToBoardColumn(i8 signext 65)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @charToBoardColumn(i8 signext 84)
%14 = icmp eq i32 %13, 18
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @bothCasedCharsConvertedToColumnIndex() {
%1 = tail call i32 @charToBoardColumn(i8 signext 97)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @charToBoardColumn(i8 signext 116)
%6 = icmp eq i32 %5, 18
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @charToBoardColumn(i8 signext 65)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @charToBoardColumn(i8 signext 84)
%14 = icmp eq i32 %13, 18
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
extern char *env_findeq(s)
char *s;
{
  for (; *s; ++s)
    if (*s == '=')
      return s;
  return 0;
}


x86 assembly (clang, -O0):
<env_findeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <env_findeq+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1132 <env_findeq+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <env_findeq+0x50>
jmp    1137 <env_findeq+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <env_findeq+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_findeq>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <env_findeq+0x22>
cmp    $0x3d,%cl
je     1124 <env_findeq+0x24>
add    $0x1,%rax
jmp    1110 <env_findeq+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @env_findeq(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) {
}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
%struct.sk_buff = type opaque
define void @rt2x00debug_dump_frame(%struct.rt2x00_dev* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_dobldobl_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(253, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_start_system_to_container>:
mov    $0xfd,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_start_system_to_container() {
%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_c2phc(i32 253, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 253, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int hex_to_int(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int hex;
  hex = hex_to_int(argv[1]);
  printf("%d\n", hex);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <hex_to_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @hex_to_int(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int ei_open_arg(char arg, char *optarg) { return 1; }


x86 assembly (clang, -O0):
<ei_open_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ei_open_arg(i8 signext %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ino(int);
int /*<<< orphan*/ pinMode(int, int);
void pinModeX(int x, int pin, int mode) {
  ino(x);
  pinMode(pin, mode);
}


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

x86 assembly (clang, -O2):
<pinModeX>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <ino@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <pinMode@plt>

LLVM IR (-O0):
define void @pinModeX(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @ino(i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @pinMode(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @pinModeX(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ino(i32 %0)
%5 = tail call i32 @pinMode(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM4_1_DriverIRQHandler();
__attribute__((weak)) void PWM4_1_IRQHandler(void) {
  PWM4_1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM4_1_IRQHandler() {
%1 = call i32 (...) @PWM4_1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM4_1_IRQHandler() {
%1 = tail call i32 (...) @PWM4_1_DriverIRQHandler()
ret void
}
void wpas_p2p_indicate_state_change(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_indicate_state_change(%struct.wpa_supplicant* nocapture %0) {
ret void
}