xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ add(char const *, char *, char *);
int /*<<< orphan*/ unary_minus(char const *, char *);
void subtract(const char *b1, const char *b2, char *out) {
  char buf[16];
  unary_minus(b2, buf);
  add(b1, buf, out);
}


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

x86 assembly (clang, -O2):
<subtract>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1040 <unary_minus@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @subtract(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%10 = call i32 @unary_minus(i8* %8, i8* %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i32 @add(i8* %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @subtract(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @unary_minus(i8* %1, i8* %5)
%7 = call i32 @add(i8* %0, i8* %5, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  long int value1 = 200000;
  long int value2;
  long int *lPtr;
  lPtr = &value1;
  value2 = *lPtr;
  printf("%ld\n", value2);
  printf("%p\n", &value1);
  printf("%p\n", lPtr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x30d40,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x30d40,(%rsp)
lea    0xedd(%rip),%rdi
mov    $0x30d40,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 200000, i64* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 200000)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
ret i32 0
}
int wrap_main2(int a1, int a2, int a3, int a4, int a5, int a6) {
  return a1 * a2 * a3 * a4 * a5 * a6;
}


x86 assembly (clang, -O0):
<wrap_main2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_main2>:
mov    %r8d,%eax
imul   %esi,%edi
imul   %ecx,%edx
imul   %edi,%edx
imul   %r9d,%eax
imul   %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @wrap_main2(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %1, %0
%8 = mul nsw i32 %7, %2
%9 = mul nsw i32 %8, %3
%10 = mul nsw i32 %9, %4
%11 = mul nsw i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int make_server_socket_q(int, int);
int make_server_socket(int portnum) { return make_server_socket_q(portnum, 1); }


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

x86 assembly (clang, -O2):
<make_server_socket>:
mov    $0x1,%esi
jmp    1030 <make_server_socket_q@plt>

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

LLVM IR (-O2):
define i32 @make_server_socket(i32 %0) {
%2 = tail call i32 @make_server_socket_q(i32 %0, i32 1)
ret i32 %2
}
void ARGBSobel() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSobel() {
ret void
}
int typedef1() {
  int def;
  def = 1;
}


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

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

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

LLVM IR (-O2):
define i32 @typedef1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int);
void srnd(int num) { srandom(num); }


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

x86 assembly (clang, -O2):
<srnd>:
jmp    1030 <srandom@plt>

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

LLVM IR (-O2):
define void @srnd(i32 %0) {
%2 = tail call i32 @srandom(i32 %0)
ret void
}
double f4_cb_send_pre_int_int_int_int_int_int_double(double (*cb)(int, int, int,
                                                                  int, int, int,
                                                                  double)) {
  double r = 66.0;
  return cb(8, 9, 10, 11, 12, 13, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_int_int_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   *%rax
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_int_int_double>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   *%rax
addsd  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_int_int_double(double (i32, i32, i32, i32, i32, i32, double)* %0) {
%2 = alloca double (i32, i32, i32, i32, i32, i32, double)*
%3 = alloca double
store double (i32, i32, i32, i32, i32, i32, double)* %0, double (i32, i32, i32, i32, i32, i32, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (i32, i32, i32, i32, i32, i32, double)*, double (i32, i32, i32, i32, i32, i32, double)** %2
%5 = load double, double* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_int_int_double(double (i32, i32, i32, i32, i32, i32, double)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
long TellSizeMem(int hMem) {
  if (!hMem)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<TellSizeMem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <TellSizeMem+0x1e>
movq   $0x0,-0x8(%rbp)
jmp    1126 <TellSizeMem+0x26>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TellSizeMem>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i64 @TellSizeMem(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i64 0, i64* %2
br label %8
7: ; preds = %1
store i64 1, i64* %2
br label %8
8: ; preds = %7, %6
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @TellSizeMem(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
long internal__syscall6(long, long, long, long, long, long, long);
long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6) {
  return internal__syscall6(n, a1, a2, a3, a4, a5, a6);
}


x86 assembly (clang, -O0):
<__syscall6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <internal__syscall6@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall6>:
jmp    1030 <internal__syscall6@plt>

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

LLVM IR (-O2):
define i64 @__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 @internal__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
void array_out_of_bounds() {
  int x;
  int buffer[4];
  x = (-7 > 0) ? (buffer[-7]) : 0;
}


x86 assembly (clang, -O0):
<array_out_of_bounds>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @array_out_of_bounds() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
ret void
}

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

/* Variables and functions */
int code_cmp(const void *x1, const void *x2) {
  int32_t y1 = *(const int32_t *)x1;
  int32_t y2 = *(const int32_t *)x2;
  if (y1 < y2) {
    return -1;
  } else if (y1 > y2) {
    return +1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<code_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <code_cmp+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <code_cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <code_cmp+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <code_cmp+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @code_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
scalar_t__ SSL_write(int /*<<< orphan*/ *, void *, int);
int /*<<< orphan*/ exit(int);
void sslWrite(SSL *ssl, void *p, int cnt) {
  if (SSL_write(ssl, p, cnt) <= 0)
    exit(1);
}


x86 assembly (clang, -O0):
<sslWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SSL_write@plt>
cmp    $0x0,%rax
jg     1157 <sslWrite+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sslWrite>:
push   %rax
call   1030 <SSL_write@plt>
test   %rax,%rax
jle    112d <sslWrite+0xd>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @sslWrite(i32* %0, i8* %1, i32 %2) {
%4 = tail call i64 @SSL_write(i32* %0, i8* %1, i32 %2)
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret void
}
int aa_pro_ctr_a0c(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a0c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a0c>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a0c = [15 x i8] c"aa_pro_ctr_a0c\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a0c(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a0c, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a0c = [15 x i8] c"aa_pro_ctr_a0c\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a0c(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a0c, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
double M1z_y(double, double, double, double);
double M2z_x(double sign, double xi, double et, double qq) {
  return M1z_y(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<M2z_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <M1z_y@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M2z_x>:
jmp    1030 <M1z_y@plt>

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

LLVM IR (-O2):
define double @M2z_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @M1z_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ BigEndianWriteU32(int /*<<< orphan*/, int /*<<< orphan*/ *);
void BigEndianWriteF32(float value, uint8_t *bytes) {
  union {
    float f32;
    uint32_t u32;
  } u;
  u.f32 = value;
  BigEndianWriteU32(u.u32, bytes);
}


x86 assembly (clang, -O0):
<BigEndianWriteF32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <BigEndianWriteU32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigEndianWriteF32>:
mov    %rdi,%rsi
movd   %xmm0,%edi
jmp    1030 <BigEndianWriteU32@plt>

LLVM IR (-O0):
%union.anon = type { float }
define void @BigEndianWriteF32(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
%5 = alloca %union.anon
store float %0, float* %3
store i32* %1, i32** %4
%6 = load float, float* %3
%7 = bitcast %union.anon* %5 to float*
store float %6, float* %7
%8 = bitcast %union.anon* %5 to i32*
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = call i32 @BigEndianWriteU32(i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @BigEndianWriteF32(float %0, i32* %1) {
%3 = bitcast float %0 to i32
%4 = tail call i32 @BigEndianWriteU32(i32 %3, i32* %1)
ret void
}
void XtSetWarningHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtSetWarningHandler() {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IWOTH;
scalar_t__ stat(char const *, struct stat *);
int fsop_path_write_other(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return (st.st_mode & S_IWOTH);
}


x86 assembly (clang, -O0):
<fsop_path_write_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_write_other+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <fsop_path_write_other+0x3e>
mov    -0x18(%rbp),%eax
mov    0x2e8f(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_write_other>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IWOTH = global i32 0
define i32 @fsop_path_write_other(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IWOTH
%13 = and i32 %11, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IWOTH = global i32 0
define i32 @fsop_path_write_other(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IWOTH
%9 = and i32 %8, %7
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
float __nv_fadd_rd(float, float);
float __fadd_rd(float __a, float __b) { return __nv_fadd_rd(__a, __b); }


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

x86 assembly (clang, -O2):
<__fadd_rd>:
jmp    1030 <__nv_fadd_rd@plt>

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

LLVM IR (-O2):
define float @__fadd_rd(float %0, float %1) {
%3 = tail call float @__nv_fadd_rd(float %0, float %1)
ret float %3
}
int sign(int x) {
  int mask = ~(1 << 31);
  int posOrOther = ~~(x & mask);
  int mask2 = x >> 31;
  return (posOrOther | mask2);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
and    $0x7fffffff,%eax
sar    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 2147483647, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = xor i32 %8, -1
%10 = xor i32 %9, -1
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = ashr i32 %11, 31
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = and i32 %0, 2147483647
%3 = ashr i32 %0, 31
%4 = or i32 %2, %3
ret i32 %4
}
min(a, b) int a, b;
{
  if (a < b)
    return (a);
  return (b);
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void f1() {
  char buf[10];
  int i;
  for (i = 0; i < 10; i++)
    buf[i] = 1;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    112c <f1+0x2c>
movslq -0x10(%rbp),%rax
movb   $0x1,-0xa(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110b <f1+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca [10 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %8
store i8 1, i8* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
void autopilot(char *place) {}


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

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

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

LLVM IR (-O2):
define void @autopilot(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ unlink(char *);
void cleanup() {
  unlink("file-link");
  unlink("file");
  rmdir("folder");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed3(%rip),%rdi
call   1030 <unlink@plt>
lea    0xecc(%rip),%rdi
call   1040 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed6(%rip),%rdi
call   1030 <unlink@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <rmdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"file-link\00"
@.str.1 = [5 x i8] c"file\00"
@.str.2 = [7 x i8] c"folder\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"file-link\00"
@.str.1 = [5 x i8] c"file\00"
@.str.2 = [7 x i8] c"folder\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC0_DriverIRQHandler();
__attribute__((weak)) void ADC0_IRQHandler(void) { ADC0_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @ADC0_IRQHandler() {
%1 = tail call i32 (...) @ADC0_DriverIRQHandler()
ret void
}
__attribute__((section(".isr_handler"))) void nmi_isr_handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @nmi_isr_handler() section ".isr_handler" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @nmi_isr_handler() section ".isr_handler" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ se_write_read_bytes(char *, int, char *, int);
void se_softreset(void) {
  printf("Soft reset\n");
  char cmd = 0x1F;
  char in[16];
  se_write_read_bytes(&cmd, 1, in, 16);
}


x86 assembly (clang, -O0):
<se_softreset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movb   $0x1f,-0x1(%rbp)
lea    -0x20(%rbp),%rdx
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
mov    $0x10,%ecx
call   1040 <se_write_read_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_softreset>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
movb   $0x1f,0xf(%rsp)
lea    0xf(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    $0x1,%esi
mov    $0x10,%ecx
call   1040 <se_write_read_bytes@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Soft reset\0A\00"
define void @se_softreset() {
%1 = alloca i8
%2 = alloca [16 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8 31, i8* %1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @se_write_read_bytes(i8* %1, i32 1, i8* %4, i32 16)
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Soft reset\00"
define void @se_softreset() {
%1 = alloca i8
%2 = alloca [16 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
store i8 31, i8* %1
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @se_write_read_bytes(i8* %1, i32 1, i8* %4, i32 16)
ret void
}
/* Variables and functions */
char lower(char);
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char c;
  c = lower('A');
  printf("%c\n", c);
  c = lower('b');
  printf("%c\n", c);
  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    $0x41,%edi
call   1040 <lower@plt>
mov    %al,-0x11(%rbp)
lea    0xeb6(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
mov    $0x62,%edi
call   1040 <lower@plt>
mov    %al,-0x11(%rbp)
lea    0xe99(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x41,%edi
call   1040 <lower@plt>
movsbl %al,%esi
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x62,%edi
call   1040 <lower@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 @lower(i8 signext 65)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = tail call signext i8 @lower(i8 signext 98)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
void roadmap_help_menu(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_help_menu() {
ret void
}
int test_30(int a, int b) { return ((a >> 31) ^ (b >> 31)) & 1; }


x86 assembly (clang, -O0):
<test_30>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_30>:
mov    %edi,%eax
xor    %esi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test_30(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 31
%7 = load i32, i32* %4
%8 = ashr i32 %7, 31
%9 = xor i32 %6, %8
%10 = and i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_30(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = lshr i32 %3, 31
ret i32 %4
}
int hexval(int i) {
  if ((i >= '0') && (i <= '9'))
    return (i - '0');
  if ((i >= 'A') && (i <= 'F'))
    return (i - 'A' + 10);
  if ((i >= 'a') && (i <= 'f'))
    return (i - 'a' + 10);
  return (-1);
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hexval+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hexval+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <hexval+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <hexval+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <hexval+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <hexval+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hexval+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexval+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexval(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
void rev_str(char *start, char *end) {
  while (start < end) {
    char tmp = *start;
    *(start++) = *end;
    *(end--) = tmp;
  }
}


x86 assembly (clang, -O0):
<rev_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1153 <rev_str+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <rev_str+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_str>:
cmp    %rsi,%rdi
jae    112c <rev_str+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
add    $0x1,%rdi
mov    %al,0x1(%rsi)
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <rev_str+0x10>
ret

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

LLVM IR (-O2):
define void @rev_str(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %7, i8* %6
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void BZ2_bzWrite(void *b) {
  int *bzf = (int *)b;
  if (bzf == 0)
    return;
  while (1) {
    if (*bzf == 0)
      return;
  }
}


x86 assembly (clang, -O0):
<BZ2_bzWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <BZ2_bzWrite+0x20>
jmp    113c <BZ2_bzWrite+0x3c>
jmp    1125 <BZ2_bzWrite+0x25>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1137 <BZ2_bzWrite+0x37>
jmp    113c <BZ2_bzWrite+0x3c>
jmp    1125 <BZ2_bzWrite+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BZ2_bzWrite>:
test   %rdi,%rdi
je     1112 <BZ2_bzWrite+0x12>
cmpl   $0x0,(%rdi)
je     1112 <BZ2_bzWrite+0x12>
nopw   0x0(%rax,%rax,1)
jmp    1110 <BZ2_bzWrite+0x10>
ret

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

LLVM IR (-O2):
define void @BZ2_bzWrite(i8* nocapture %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %3, %7
br label %7
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
void check_reserved_bits(unsigned long flag) {
  if (flag & 0xFF80)
    assert("Reserved bits \n");
}


x86 assembly (clang, -O0):
<check_reserved_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff80,%rax
cmp    $0x0,%rax
je     113c <check_reserved_bits+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_reserved_bits>:
test   $0xff80,%edi
je     1124 <check_reserved_bits+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <assert@plt>
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Reserved bits \0A\00"
define void @check_reserved_bits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65408
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @assert(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Reserved bits \0A\00"
define void @check_reserved_bits(i64 %0) {
%2 = and i64 %0, 65408
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @assert(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int test_imm_B6uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xB6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B6uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11927552
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int do_firstline(cnt)
long cnt;
{ do_absolute(1L); }


x86 assembly (clang, -O0):
<do_firstline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <do_absolute@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_firstline>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <do_absolute@plt>

LLVM IR (-O0):
define i32 @do_firstline(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 (i64, ...) bitcast (i32 (...)* @do_absolute to i32 (i64, ...)*)(i64 1)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @do_firstline(i64 %0) {
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @do_absolute to i32 (i64, ...)*)(i64 1)
ret i32 undef
}
int msm_jtag_restore_register(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @msm_jtag_restore_register(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int utf8_to_utf32(int /*<<< orphan*/ *, int *);
int main() {
  char *u8 = "あ";
  int i = 0;
  uint32_t u32 = utf8_to_utf32((uint8_t *)u8, &i);
  printf("%X\n", u32);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <utf8_to_utf32@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\E3\81\82\00"
@.str.1 = [4 x i8] c"%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = call i32 @utf8_to_utf32(i32* %6, i32* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E3\81\82\00"
@.str.1 = [4 x i8] c"%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @utf8_to_utf32(i32* bitcast ([4 x i8]* @.str to i32*), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_time_state();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handler(int unused) {
  clear_time_state();
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clear_time_state@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
xor    %eax,%eax
call   1030 <clear_time_state@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clear_time_state()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 (...) @clear_time_state()
%3 = tail call i32 @exit(i32 0)
unreachable
}