xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sysctl_name;
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int /*<<< orphan*/ sysctl(int *, int, int *, size_t *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int getLogLevel() {
  int sysctl_name[] = {1, 23};
  int args[10];
  size_t len = sizeof(args);
  sysctl(sysctl_name, sizeof(sysctl_name) / sizeof(sysctl_name[0]), args, &len,
         0, 0);
  return args[0];
}


x86 assembly (clang, -O0):
<getLogLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movq   $0x28,-0x38(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x2,%esi
lea    -0x38(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <sysctl@plt>
mov    -0x30(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLogLevel>:
sub    $0x38,%rsp
movabs $0x1700000001,%rax
mov    %rax,0x8(%rsp)
movq   $0x28,(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x2,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <sysctl@plt>
mov    0x10(%rsp),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.getLogLevel.sysctl_name = [2 x i32] [i32 1, i32 23]
define i32 @getLogLevel() {
%1 = alloca [2 x i32]
%2 = alloca [10 x i32]
%3 = alloca i64
%4 = bitcast [2 x i32]* %1 to i8*
store i64 40, i64* %3
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @sysctl(i32* %5, i32 2, i32* %6, i64* %3, i32 0, i32 0)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getLogLevel() {
%1 = alloca i64
%2 = alloca [10 x i32]
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store i64 98784247809, i64* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast i64* %3 to i8*
store i64 40, i64* %3
%7 = bitcast i64* %1 to i32*
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @sysctl(i32* %7, i32 2, i32* %8, i64* %3, i32 0, i32 0)
%10 = load i32, i32* %8
ret i32 %10
}
void ThreadJoin(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @ThreadJoin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void dialsCB(int dial, int value) {
  printf("dialsCB: dial %d, value %d\n", dial, value);
}


x86 assembly (clang, -O0):
<dialsCB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dialsCB>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"dialsCB: dial %d, value %d\0A\00"
define void @dialsCB(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void debugging_output(const char *function, const char *file, int line,
                      const char *format, ...) {}


x86 assembly (clang, -O0):
<debugging_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @debugging_output(i8* %0, i8* %1, i32 %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @debugging_output(i8* nocapture %0, i8* nocapture %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
unsigned char nand_data(void) {
  return (*(volatile unsigned char *)0x4E000010);
}


x86 assembly (clang, -O0):
<nand_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000010,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_data>:
mov    0x4e000010,%al
ret

LLVM IR (-O0):
define zeroext i8 @nand_data() {
%1 = load volatile i8, i8* inttoptr (i64 1308622864 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @nand_data() {
%1 = load volatile i8, i8* inttoptr (i64 1308622864 to i8*)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ redecl2();
void use88() { redecl2(); }


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

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

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

LLVM IR (-O2):
define void @use88() {
%1 = tail call i32 (...) @redecl2()
ret void
}
double f4_sum_pre_double_float(double v0, float v) {
  return v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_double_float>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_float>:
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_float(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @f4_sum_pre_double_float(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fadd double %3, %0
ret double %4
}
int test_imm_9Dint64_lowword_reg(long long val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Dint64_lowword_reg>:
test   $0x9d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Dint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 157
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/, int /*<<< orphan*/, int);
int main() {
  foo(0, 0, 0, 0, 0, 0, -1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1)
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t get_curtime() {
  int64_t cur_time;
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  cur_time = (int64_t)tp.tv_sec * 1000000 + tp.tv_nsec / 1000;
  return cur_time;
}


x86 assembly (clang, -O0):
<get_curtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_curtime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_curtime() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_curtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ stringConvertedToBoardCoord(char *, int, int);
void validStringsConvertedToBoardCoord(void) {
  stringConvertedToBoardCoord("g6", 5, 6);
  stringConvertedToBoardCoord("G6", 5, 6);
  stringConvertedToBoardCoord("K16", 15, 9);
}


x86 assembly (clang, -O0):
<validStringsConvertedToBoardCoord>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <stringConvertedToBoardCoord@plt>
lea    0xed2(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <stringConvertedToBoardCoord@plt>
lea    0xebf(%rip),%rdi
mov    $0xf,%esi
mov    $0x9,%edx
call   1030 <stringConvertedToBoardCoord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<validStringsConvertedToBoardCoord>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <stringConvertedToBoardCoord@plt>
lea    0xed5(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <stringConvertedToBoardCoord@plt>
lea    0xec2(%rip),%rdi
mov    $0xf,%esi
mov    $0x9,%edx
pop    %rax
jmp    1030 <stringConvertedToBoardCoord@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"g6\00"
@.str.1 = [3 x i8] c"G6\00"
@.str.2 = [4 x i8] c"K16\00"
define void @validStringsConvertedToBoardCoord() {
%1 = call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
%2 = call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 6)
%3 = call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"g6\00"
@.str.1 = [3 x i8] c"G6\00"
@.str.2 = [4 x i8] c"K16\00"
define void @validStringsConvertedToBoardCoord() {
%1 = tail call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
%2 = tail call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 6)
%3 = tail call i32 @stringConvertedToBoardCoord(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 15, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int send(int, char *, int, int /*<<< orphan*/);
int strlen(char *);
void send_new(int fd, char *msg) {
  int len = strlen(msg);
  if (send(fd, msg, len, 0) == -1) {
    printf("Error in send\n");
  }
}


x86 assembly (clang, -O0):
<send_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    1171 <send_new+0x41>
lea    0xe94(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_new>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0xffffffff,%eax
je     115a <send_new+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [14 x i8] c"Error in send\00"
define void @send_new(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int string_atoi(char *);
int strlen(char *);
void main() {
  char str[] = "31241";
  int len = strlen(str);
  printf("ret = %d\n", string_atoi(str + len - 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    -0x6(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
add    $0xffffffffffffffff,%rdi
call   1050 <string_atoi@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x31,0x4(%rsp)
movl   $0x34323133,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0xffffffffffffffff,%rdi
call   1050 <string_atoi@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"31241\00"
@.str = [10 x i8] c"ret = %d\0A\00"
define void @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = call i32 @string_atoi(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
int fun988() { return 988; }


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

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

LLVM IR (-O0):
define i32 @fun988() {
ret i32 988
}

LLVM IR (-O2):
define i32 @fun988() {
ret i32 988
}
/* Variables and functions */
int /*<<< orphan*/ call_ext(char *, char *, char *);
void ext_mail(char *mail, char *mail2) { call_ext("xmail", mail, mail2); }


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

x86 assembly (clang, -O2):
<ext_mail>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <call_ext@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"xmail\00"
define void @ext_mail(i8* %0, i8* %1) {
%3 = tail call i32 @call_ext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct Class {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MyFree(struct Class *);
void FreeClass(struct Class *clptr) { MyFree(clptr); }


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

x86 assembly (clang, -O2):
<FreeClass>:
jmp    1030 <MyFree@plt>

LLVM IR (-O0):
%struct.Class = type { i32 }
define void @FreeClass(%struct.Class* %0) {
%2 = alloca %struct.Class*
store %struct.Class* %0, %struct.Class** %2
%3 = load %struct.Class*, %struct.Class** %2
%4 = call i32 @MyFree(%struct.Class* %3)
ret void
}

LLVM IR (-O2):
%struct.Class = type { i32 }
define void @FreeClass(%struct.Class* %0) {
%2 = tail call i32 @MyFree(%struct.Class* %0)
ret void
}
int __test() {
  int x = 0;
  return 1 / x;
}


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

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ Round400(void *, int);
void keccakP400NRounds(void *state, int rounds) {
  int i = 0;
  for (i = (20 - rounds); i < 20; i++) {
    Round400(state, i);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1155 <keccakP400NRounds+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <Round400@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <keccakP400NRounds+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1142 <keccakP400NRounds+0x32>
mov    %rdi,%rbx
mov    $0x14,%ebp
sub    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <Round400@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1130 <keccakP400NRounds+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @keccakP400NRounds(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = sub nsw i32 20, %1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @Round400(i8* %0, i32 %7)
%9 = add i32 %7, 1
%10 = icmp eq i32 %9, 20
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
int main() {
  int i = 6;
  int k = 8;
  int j = k + 4;
  return k;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glRotated(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
void Rotated(GLdouble phi, GLdouble x, GLdouble y, GLdouble z) {
  glRotated(phi, x, y, z);
}


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

x86 assembly (clang, -O2):
<Rotated>:
jmp    1030 <glRotated@plt>

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

LLVM IR (-O2):
define void @Rotated(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glRotated(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int bbm_bulk_write(void *, unsigned short, unsigned short, unsigned char *,
                   unsigned short);
int bbm_com_bulk_write(void *handle, unsigned short devid, unsigned short addr,
                       unsigned char *data, unsigned short size) {
  int res;
  res = bbm_bulk_write(handle, devid, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_bulk_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzwl %ax,%edx
movzwl -0x1a(%rbp),%r8d
call   1030 <bbm_bulk_write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_bulk_write>:
jmp    1030 <bbm_bulk_write@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_bulk_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = tail call i32 @bbm_bulk_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i16 zeroext %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
char *mdb_strerror(int);
int /*<<< orphan*/ stderr;
void print_error(int rc) { fprintf(stderr, "%d, %s\n", rc, mdb_strerror(rc)); }


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mdb_strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ebp
call   1030 <mdb_strerror@plt>
lea    0xec6(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%d, %s\0A\00"
define void @print_error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @mdb_strerror(i32 %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  unsigned int cmd = argc;
  printf("About to compare\n");
  if (cmd > 0x41) {
    printf("Message: It is greater than 0x41\n");
  } else {
    printf("Message: It is smaller or equal than 0x41\n");
  }
  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    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x41,-0x1c(%rbp)
jbe    1157 <main+0x47>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <main+0x53>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x42,%ebx
lea    0xf12(%rip),%rax
lea    0xee1(%rip),%rdi
cmovae %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"About to compare\0A\00"
@.str.1 = [34 x i8] c"Message: It is greater than 0x41\0A\00"
@.str.2 = [43 x i8] c"Message: It is smaller or equal than 0x41\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i32, i32* %5
store i32 %9, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %8
%12 = icmp ugt i32 %11, 65
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"About to compare\00"
@str.3 = [42 x i8] c"Message: It is smaller or equal than 0x41\00"
@str.4 = [33 x i8] c"Message: It is greater than 0x41\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = icmp ugt i32 %0, 65
%6 = select i1 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str.3, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void pri_funct_cv_end(void) { (void)fprintf(stdout, "\n"); }


x86 assembly (clang, -O0):
<pri_funct_cv_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pri_funct_cv_end>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @pri_funct_cv_end() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @pri_funct_cv_end() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int readchar(arg) void *arg;
{ return *(*(unsigned char **)arg)++; }


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl (%rax),%eax
ret

LLVM IR (-O0):
define i32 @readchar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %4
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @readchar(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %2
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
ret i32 %6
}
void os_numatop_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @os_numatop_unlock() {
ret void
}
/* Variables and functions */
unsigned int ones32(unsigned int);
unsigned int floor_log2(unsigned int x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return (ones32(x) - 1);
}


x86 assembly (clang, -O0):
<floor_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ones32@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor_log2>:
push   %rax
mov    %edi,%eax
shr    %eax
or     %eax,%edi
mov    %edi,%eax
shr    $0x2,%eax
or     %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
or     %eax,%edi
mov    %edi,%eax
shr    $0x8,%eax
or     %eax,%edi
mov    %edi,%eax
shr    $0x10,%eax
or     %eax,%edi
call   1030 <ones32@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @floor_log2(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = tail call i32 @ones32(i32 %11)
%13 = add i32 %12, -1
ret i32 %13
}
/* Variables and functions */
int __syscall(int, int, int, int);
int socket(int domain, int type, int proto) {
  return __syscall(41, domain, type, proto);
}


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

x86 assembly (clang, -O2):
<socket>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x29,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @socket(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @__syscall(i32 41, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 41, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int book_div16(int x) {
  int bias = (x >> 31) & 0xF;
  return (x + bias) >> 4;
}


x86 assembly (clang, -O0):
<book_div16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<book_div16>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xf,%eax
add    %edi,%eax
sar    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @book_div16(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 15, i32 0
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 4
ret i32 %5
}
int log2(int value) {
  unsigned int r = 0;
  __asm__ volatile("bsrl %1, %0\n\t"
                   "jnz 1f\n\t"
                   "movl $-1, %0\n\t"
                   "1:\n\t"
                   : "=r"(r)
                   : "r"(value));
  return r;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
jne    111f <log2+0x1f>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
bsr    %edi,%eax
jne    110a <log2+0xa>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "bsrl $1, $0\0A\09jnz 1f\0A\09movl $$-1, $0\0A\091:\0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @log2(i32 %0) {
%2 = tail call i32 asm sideeffect "bsrl $1, $0\0A\09jnz 1f\0A\09movl $$-1, $0\0A\091:\0A\09", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, x;
  scanf("%d", &N);
  x = check_prime(N);
  printf("%d", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <check_prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @check_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void NEOMOTE_1_I2C_0_Workaround(void) {}


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

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

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

LLVM IR (-O2):
define void @NEOMOTE_1_I2C_0_Workaround() {
ret void
}
/* Variables and functions */
int read_long_data(unsigned char *, unsigned char *);
int op_hmac_recv(unsigned char *packet, unsigned char *data) {
  return read_long_data(packet, data);
}


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

x86 assembly (clang, -O2):
<op_hmac_recv>:
jmp    1030 <read_long_data@plt>

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

LLVM IR (-O2):
define i32 @op_hmac_recv(i8* %0, i8* %1) {
%3 = tail call i32 @read_long_data(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
double density_temperature_c(double const, double const, double const);
double exner_c(double const);
double theta_rho_c(const double p0, const double T, const double qt,
                   const double qv) {
  return density_temperature_c(T, qt, qv) / exner_c(p0);
}


x86 assembly (clang, -O0):
<theta_rho_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <density_temperature_c@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exner_c@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theta_rho_c>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <density_temperature_c@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <exner_c@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @theta_rho_c(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* %6
%10 = load double, double* %7
%11 = load double, double* %8
%12 = call double @density_temperature_c(double %9, double %10, double %11)
%13 = load double, double* %5
%14 = call double @exner_c(double %13)
%15 = fdiv double %12, %14
ret double %15
}

LLVM IR (-O2):
define double @theta_rho_c(double %0, double %1, double %2, double %3) {
%5 = tail call double @density_temperature_c(double %1, double %2, double %3)
%6 = tail call double @exner_c(double %0)
%7 = fdiv double %5, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_store1_pd(double *, int /*<<< orphan*/);
void test_mm_store1_pd(double *x, __m128d y) { _mm_store1_pd(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_store1_pd>:
jmp    1030 <_mm_store1_pd@plt>

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

LLVM IR (-O2):
define void @test_mm_store1_pd(double* %0, i32 %1) {
%3 = tail call i32 @_mm_store1_pd(double* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rush(int, int);
int main() {
  rush(123, 45);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
mov    $0x2d,%esi
call   1030 <rush@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rush(i32 123, i32 45)
ret i32 0
}
void Cache_CheckLinks(void) {}


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

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

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

LLVM IR (-O2):
define void @Cache_CheckLinks() {
ret void
}
float do_fmax(float a, float b) { return __builtin_fmaxf(a, b); }


x86 assembly (clang, -O0):
<do_fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fmax>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @do_fmax(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 @llvm.maxnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @do_fmax(float %0, float %1) {
%3 = tail call float @llvm.maxnum.f32(float %0, float %1)
ret float %3
}
int setlogmask(int maskpri) {
  static int oldmask = 0;
  int ret = oldmask;
  oldmask = maskpri;
  return ret;
}


x86 assembly (clang, -O0):
<setlogmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f0b(%rip)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlogmask>:
mov    0x2f1e(%rip),%eax
mov    %edi,0x2f18(%rip)
ret

LLVM IR (-O0):
@setlogmask.oldmask = internal global i32 0
define i32 @setlogmask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @setlogmask.oldmask
store i32 %4, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* @setlogmask.oldmask
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@setlogmask.oldmask = internal unnamed_addr global i32 0
define i32 @setlogmask(i32 %0) {
%2 = load i32, i32* @setlogmask.oldmask
store i32 %0, i32* @setlogmask.oldmask
ret i32 %2
}
int main() {
  struct foo {
    int x;
  } foo;
  {
    struct foo {
      double d;
    };
    return foo.x;
  }
}


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

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

LLVM IR (-O0):
%struct.foo = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.foo
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.foo, %struct.foo* %2, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
int complement3bitshifted(int x) {
  if (x & 4)
    return ((x & 3) - 4) << 3;
  return x << 3;
}


x86 assembly (clang, -O0):
<complement3bitshifted>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     112a <complement3bitshifted+0x2a>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
sub    $0x4,%eax
shl    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <complement3bitshifted+0x33>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement3bitshifted>:
lea    0x0(,%rdi,8),%ecx
mov    %ecx,%eax
or     $0xffffffe0,%eax
test   $0x4,%dil
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @complement3bitshifted(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = shl i32 %0, 3
%5 = or i32 %4, -32
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}