xunge/DecIR huggingface dataset:
/* Variables and functions */
int listen(int, int);
int listenSocket(int sockfd, int backlog) { return (listen(sockfd, backlog)); }


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

x86 assembly (clang, -O2):
<listenSocket>:
jmp    1030 <listen@plt>

LLVM IR (-O0):
define i32 @listenSocket(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 @listen(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @listenSocket(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
void adp_ind_init() {}


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

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

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

LLVM IR (-O2):
define void @adp_ind_init() {
ret void
}
void jExec(char *file) {}


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

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

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

LLVM IR (-O2):
define void @jExec(i8* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned int __bswap_32(unsigned int);
unsigned short get_current_value(unsigned char *buff, int bufpos,
                                 int bufbitpos) {
  unsigned int current_value = *((unsigned int *)(buff + bufpos));
  current_value = __bswap_32(current_value);
  current_value = current_value << bufbitpos;
  current_value = current_value >> 16;
  return current_value;
}


x86 assembly (clang, -O0):
<get_current_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <__bswap_32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_value>:
push   %rbx
mov    %edx,%ebx
movslq %esi,%rax
mov    (%rdi,%rax,1),%edi
call   1030 <__bswap_32@plt>
mov    %ebx,%ecx
shl    %cl,%eax
shr    $0x10,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @get_current_value(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @__bswap_32(i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = shl i32 %16, %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = lshr i32 %19, 16
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @get_current_value(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @__bswap_32(i32 %7)
%9 = shl i32 %8, %2
%10 = lshr i32 %9, 16
%11 = trunc i32 %10 to i16
ret i16 %11
}
void fdd(void) { return; }


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

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

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

LLVM IR (-O2):
define void @fdd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
int TorqueEnable(int Id) {
  int Torque;
  Torque = dxl_read_byte(Id, 24);
  PrintErrorCode();
  return Torque;
}


x86 assembly (clang, -O0):
<TorqueEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x18,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TorqueEnable>:
push   %rbx
mov    $0x18,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <PrintErrorCode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @TorqueEnable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 24)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @TorqueEnable(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 24)
%3 = tail call i32 (...) @PrintErrorCode()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap16(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint16_t U16_AT(const void *p) {
  uint16_t x;
  memcpy(&x, p, sizeof(x));
  return bswap16(x);
}


x86 assembly (clang, -O0):
<U16_AT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <bswap16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U16_AT>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <bswap16@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @U16_AT(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @bswap16(i32 %5)
ret i32 %6
}
int swap(int *first, int *second, int *third) {
  if (!first || !second || !third)
    return -1;
  int buffer;
  buffer = *first;
  *first = *third;
  *third = *second;
  *second = buffer;
  return 0;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1131 <swap+0x31>
cmpq   $0x0,-0x18(%rbp)
je     1131 <swap+0x31>
cmpq   $0x0,-0x20(%rbp)
jne    113d <swap+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <swap+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1122 <swap+0x22>
test   %rsi,%rsi
je     1122 <swap+0x22>
test   %rdx,%rdx
je     1122 <swap+0x22>
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @swap(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%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
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32*, i32** %6
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32*, i32** %7
%16 = icmp ne i32* %15, null
br i1 %16, label %18, label %17
17: ; preds = %14, %11, %3
store i32 -1, i32* %4
br label %29
18: ; preds = %14
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
store i32 %20, i32* %8
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = load i32*, i32** %5
store i32 %22, i32* %23
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = load i32*, i32** %7
store i32 %25, i32* %26
%27 = load i32, i32* %8
%28 = load i32*, i32** %6
store i32 %27, i32* %28
store i32 0, i32* %4
br label %29
29: ; preds = %18, %17
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @swap(i32* %0, i32* %1, i32* %2) {
%4 = icmp ne i32* %0, null
%5 = icmp ne i32* %1, null
%6 = and i1 %4, %5
%7 = icmp ne i32* %2, null
%8 = and i1 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %0
%11 = load i32, i32* %2
store i32 %11, i32* %0
%12 = load i32, i32* %1
store i32 %12, i32* %2
store i32 %10, i32* %1
br label %13
13: ; preds = %3, %9
%14 = phi i32 [ 0, %9 ], [ -1, %3 ]
ret i32 %14
}
/* Variables and functions */
size_t strlen(const char *s) {
  int i;
  for (i = 0; s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <strlen+0x34>
jmp    1126 <strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void reverse(char s[]) {
  if (s[0] == '\0') {
    return;
  } else {
    reverse(&s[1]);
    putchar(s[0]);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <reverse+0x21>
jmp    115a <reverse+0x3a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113b <reverse+0x1b>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <reverse@plt>
movsbl (%rbx),%edi
pop    %rbx
jmp    1040 <putchar@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @reverse(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @putchar(i8 signext %7)
br label %4
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t av_gettime(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<av_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @av_gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @av_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int atanl(long double);
int sqrtl(int);
long double asinl(long double x) {
  return 2. * atanl(x / (1. + sqrtl(1. - x * x)));
}


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x38(%rbp)
fmul   %st,%st(0)
fld1
fsubp  %st,%st(1)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <sqrtl@plt>
fldt   -0x38(%rbp)
cvtsi2sd %eax,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <atanl@plt>
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
fldl   -0x28(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fmul   %st,%st(0)
fld1
fsubp  %st,%st(1)
fnstcw 0x10(%rsp)
movzwl 0x10(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x12(%rsp)
fldcw  0x12(%rsp)
fistpl 0x14(%rsp)
fldcw  0x10(%rsp)
mov    0x14(%rsp),%edi
call   1040 <sqrtl@plt>
cvtsi2sd %eax,%xmm0
addsd  0xe98(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
fldt   0x2c(%rsp)
fdivl  0x20(%rsp)
fstpt  (%rsp)
call   1030 <atanl@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
fldl   0x18(%rsp)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
%6 = fneg x86_fp80 %4
%7 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %6, x86_fp80 %5, x86_fp80 0xK3FFF8000000000000000)
%8 = fptosi x86_fp80 %7 to i32
%9 = call i32 @sqrtl(i32 %8)
%10 = sitofp i32 %9 to double
%11 = fadd double 1.000000e+00, %10
%12 = fpext double %11 to x86_fp80
%13 = fdiv x86_fp80 %3, %12
%14 = call i32 @atanl(x86_fp80 %13)
%15 = sitofp i32 %14 to double
%16 = fmul double 2.000000e+00, %15
%17 = fpext double %16 to x86_fp80
ret x86_fp80 %17
}

LLVM IR (-O2):
define x86_fp80 @asinl(x86_fp80 %0) {
%2 = fneg x86_fp80 %0
%3 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %2, x86_fp80 %0, x86_fp80 0xK3FFF8000000000000000)
%4 = fptosi x86_fp80 %3 to i32
%5 = tail call i32 @sqrtl(i32 %4)
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fpext double %7 to x86_fp80
%9 = fdiv x86_fp80 %0, %8
%10 = tail call i32 @atanl(x86_fp80 %9)
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 2.000000e+00
%13 = fpext double %12 to x86_fp80
ret x86_fp80 %13
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int elapsed_usecs(struct timeval *t0, struct timeval *t1) {
  int elapsed = (t1->tv_sec - t0->tv_sec) * 1000000;
  elapsed += (t1->tv_usec - t0->tv_usec);
  return elapsed;
}


x86 assembly (clang, -O0):
<elapsed_usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
sub    0x8(%rax),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_usecs>:
mov    (%rsi),%ecx
mov    0x8(%rsi),%eax
sub    (%rdi),%ecx
imul   $0xf4240,%ecx,%ecx
sub    0x8(%rdi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @elapsed_usecs(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
%13 = mul nsw i32 %12, 1000000
store i32 %13, i32* %5
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @elapsed_usecs(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%12 = load i64, i64* %11
%13 = sub nsw i64 %10, %12
%14 = trunc i64 %13 to i32
%15 = add i32 %8, %14
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long subwindow;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_subwindow(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xbutton.subwindow = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xbutton_subwindow>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xbutton_subwindow(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xbutton_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, size_t);
char *sizeu2(size_t num) {
  static char sizeu2_buf[28];
  sprintf(sizeu2_buf,
          "%"
          "zu",
          num);
  return sizeu2_buf;
}


x86 assembly (clang, -O0):
<sizeu2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeu2>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@sizeu2.sizeu2_buf = internal global [28 x i8] zeroinitializer
@.str = [4 x i8] c"%zu\00"
define i8* @sizeu2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu2.sizeu2_buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu2.sizeu2_buf, i64 0, i64 0)
}

LLVM IR (-O2):
@sizeu2.sizeu2_buf = internal global [28 x i8] zeroinitializer
@.str = [4 x i8] c"%zu\00"
define i8* @sizeu2(i64 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu2.sizeu2_buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu2.sizeu2_buf, i64 0, i64 0)
}
/* Variables and functions */
char *f1(char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *s, *unclean;
  unclean = getenv("PATH");
  s = f1(unclean);
  printf(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <f1@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1050 <f1@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @f1(i8* %1)
%3 = tail call i32 @printf(i8* dereferenceable(1) %2)
ret i32 0
}
/* Variables and functions */
int *calloc(int, int);
int *calloc_zero(int n) { return calloc(n, sizeof(int)); }


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

x86 assembly (clang, -O2):
<calloc_zero>:
mov    $0x4,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i32* @calloc_zero(i32 %0) {
%2 = tail call i32* @calloc(i32 %0, i32 4)
ret i32* %2
}
/* Type definitions */
struct sembuf {
  unsigned short sem_num;
  short sem_op;
  int sem_flg;
};

/* Variables and functions */
struct sembuf semop_adj(unsigned short sem_num, short sem_adj) {
  struct sembuf sembuf = {.sem_num = sem_num, .sem_op = sem_adj, .sem_flg = -1};
  return sembuf;
}


x86 assembly (clang, -O0):
<semop_adj>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0xa(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0xc(%rbp),%ax
mov    %ax,-0x6(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<semop_adj>:
shl    $0x10,%esi
lea    (%rsi,%rdi,1),%ecx
movabs $0xffffffff00000000,%rax
ff ff ff
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.sembuf = type { i16, i16, i32 }
define i64 @semop_adj(i16 zeroext %0, i16 signext %1) {
%3 = alloca %struct.sembuf
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
%7 = load i16, i16* %4
store i16 %7, i16* %6
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
%9 = load i16, i16* %5
store i16 %9, i16* %8
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i32 -1, i32* %10
%11 = bitcast %struct.sembuf* %3 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @semop_adj(i16 zeroext %0, i16 signext %1) {
%3 = zext i16 %1 to i64
%4 = shl nuw nsw i64 %3, 16
%5 = zext i16 %0 to i64
%6 = or i64 %4, %5
%7 = or i64 %6, -4294967296
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ randomized_quicksort_algo(int *, int /*<<< orphan*/, int);
void randomized_quicksort(int *array, int size) {
  randomized_quicksort_algo(array, 0, size - 1);
  return;
}


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

x86 assembly (clang, -O2):
<randomized_quicksort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <randomized_quicksort_algo@plt>

LLVM IR (-O0):
define void @randomized_quicksort(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 = sub nsw i32 %6, 1
%8 = call i32 @randomized_quicksort_algo(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @randomized_quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @randomized_quicksort_algo(i32* %0, i32 0, i32 %3)
ret void
}
void pinmux_unhog_maps(struct pinctrl_dev *pctldev) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl_dev = type opaque
define void @pinmux_unhog_maps(%struct.pinctrl_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int disp24();
int disp20() { return disp24() & 0x000fffff; }


x86 assembly (clang, -O0):
<disp20>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <disp24@plt>
and    $0xfffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp20>:
push   %rax
xor    %eax,%eax
call   1030 <disp24@plt>
and    $0xfffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @disp20() {
%1 = call i32 (...) @disp24()
%2 = and i32 %1, 1048575
ret i32 %2
}

LLVM IR (-O2):
define i32 @disp20() {
%1 = tail call i32 (...) @disp24()
%2 = and i32 %1, 1048575
ret i32 %2
}
/* Variables and functions */
int f372(int *);
int f373(int *p) { return f372(p); }


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

x86 assembly (clang, -O2):
<f373>:
jmp    1030 <f372@plt>

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

LLVM IR (-O2):
define i32 @f373(i32* %0) {
%2 = tail call i32 @f372(i32* %0)
ret i32 %2
}
void tap_result_start_run(struct test_result *result) {}


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

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

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

LLVM IR (-O2):
%struct.test_result = type opaque
define void @tap_result_start_run(%struct.test_result* nocapture %0) {
ret void
}
/* Variables and functions */
double nextafterf_custom(double, double);
double nextUp_d(float d) {
  double result = d;
  if (result > d)
    return result;
  return nextafterf_custom(result, result + 1000000);
}


x86 assembly (clang, -O0):
<nextUp_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <nextUp_d+0x42>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116e <nextUp_d+0x5e>
movsd  -0x18(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
call   1030 <nextafterf_custom@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextUp_d>:
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
addsd  %xmm0,%xmm1
jmp    1030 <nextafterf_custom@plt>

LLVM IR (-O0):
define double @nextUp_d(float %0) {
%2 = alloca double
%3 = alloca float
%4 = alloca double
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
store double %6, double* %4
%7 = load double, double* %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp ogt double %7, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load double, double* %4
store double %12, double* %2
br label %18
13: ; preds = %1
%14 = load double, double* %4
%15 = load double, double* %4
%16 = fadd double %15, 1.000000e+06
%17 = call double @nextafterf_custom(double %14, double %16)
store double %17, double* %2
br label %18
18: ; preds = %13, %11
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @nextUp_d(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 1.000000e+06
%4 = tail call double @nextafterf_custom(double %2, double %3)
ret double %4
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int /*<<< orphan*/, int, int, int);
int play_attack_defend_n(int, int, int, int, int);
int autohelperowl_attackpat50(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, 1, move, transformation);
  return play_attack_defend_n((1 + 2 - (color)), 1, 1, move, a);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x3,%edi
sub    -0x14(%rbp),%edi
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <play_attack_defend_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat50>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    $0x3,%edi
sub    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <play_attack_defend_n@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat50(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %9
%19 = sub nsw i32 3, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %11
%22 = call i32 @play_attack_defend_n(i32 %19, i32 1, i32 1, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat50(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 1, i32 %2, i32 %1)
%7 = sub nsw i32 3, %3
%8 = tail call i32 @play_attack_defend_n(i32 %7, i32 1, i32 1, i32 %2, i32 %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int x = 077;
  int y = 0x77;
  int z = 0xABC;
  printf("x is %d, y is %d, z is %d.\n", x, y, z);
  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)
movl   $0x3f,-0x14(%rbp)
movl   $0x77,-0x18(%rbp)
movl   $0xabc,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3f,%esi
mov    $0x77,%edx
mov    $0xabc,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [28 x i8] c"x is %d, y is %d, z is %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 63, i32 119, i32 2748)
ret i32 0
}
/* Variables and functions */
int biscDriveDistance(int, int, int);
int biscDriveDistanceStraight(int velocity, int distanceMM) {
  return biscDriveDistance(velocity, 0x7FFF, distanceMM);
}


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

x86 assembly (clang, -O2):
<biscDriveDistanceStraight>:
mov    %esi,%edx
mov    $0x7fff,%esi
jmp    1030 <biscDriveDistance@plt>

LLVM IR (-O0):
define i32 @biscDriveDistanceStraight(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 @biscDriveDistance(i32 %5, i32 32767, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @biscDriveDistanceStraight(i32 %0, i32 %1) {
%3 = tail call i32 @biscDriveDistance(i32 %0, i32 32767, i32 %1)
ret i32 %3
}
void __pthread_unregister_cancel_2(struct __ptcb *__cb) {
  __asm__ __volatile__("call __pthread_unregister_cancel" : : "a"(__cb));
}


x86 assembly (clang, -O0):
<__pthread_unregister_cancel_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   1030 <__pthread_unregister_cancel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_unregister_cancel_2>:
mov    %rdi,%rax
call   1030 <__pthread_unregister_cancel@plt>
ret

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

LLVM IR (-O2):
%struct.__ptcb = type opaque
define void @__pthread_unregister_cancel_2(%struct.__ptcb* %0) {
tail call void asm sideeffect "call __pthread_unregister_cancel", "{ax},~{dirflag},~{fpsr},~{flags}"(%struct.__ptcb* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ script_action_run_install(int);
int script_action_installnext_timer_cb(const void *pointer, void *data,
                                       int remaining_calls) {
  (void)data;
  (void)remaining_calls;
  script_action_run_install((pointer) ? 1 : 0);
  return 0;
}


x86 assembly (clang, -O0):
<script_action_installnext_timer_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%rcx
cmovne %eax,%edi
call   1030 <script_action_run_install@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_action_installnext_timer_cb>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <script_action_run_install@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @script_action_installnext_timer_cb(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
%13 = call i32 @script_action_run_install(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @script_action_installnext_timer_cb(i8* readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @script_action_run_install(i32 %5)
ret i32 0
}
void dgemm_opt_omp(double *a, double *b, double *c, int n, int m, int q) {}


x86 assembly (clang, -O0):
<dgemm_opt_omp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dgemm_opt_omp(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @dgemm_opt_omp(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3, i32 %4, i32 %5) {
ret void
}
char *test_func_00(char *p, int c) {
  *--p = (char)c;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %sil,-0x1(%rdi)
lea    -0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @test_func_00(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 -1
store i8 %3, i8* %4
ret i8* %4
}
int mac(int x, int y) { return x > y ? x : y; }


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

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

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

LLVM IR (-O2):
define i32 @mac(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int mod(int i, int j) {
  ++i;
  if (i == 7)
    return (j ? 7 : 8);
  if (i > 13)
    return (j ? 1 : 0);
  return (i);
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    1138 <mod+0x38>
mov    -0xc(%rbp),%edx
mov    $0x8,%eax
mov    $0x7,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <mod+0x60>
cmpl   $0xd,-0x8(%rbp)
jle    115a <mod+0x5a>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <mod+0x60>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
lea    0x1(%rdi),%eax
cmp    $0x7,%eax
jne    1114 <mod+0x14>
cmp    $0x1,%esi
mov    $0x7,%eax
adc    $0x0,%eax
ret
cmp    $0xd,%edi
jl     1120 <mod+0x20>
xor    %eax,%eax
test   %esi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @mod(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 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 7
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 7, i32 8
store i32 %14, i32* %3
br label %25
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 13
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
store i32 %22, i32* %3
br label %25
23: ; preds = %15
%24 = load i32, i32* %4
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %18, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = icmp eq i32 %3, 7
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i32 8, i32 7
br label %13
8: ; preds = %2
%9 = icmp sgt i32 %0, 12
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = icmp ne i32 %1, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %10, %5
%14 = phi i32 [ %7, %5 ], [ %12, %10 ], [ %3, %8 ]
ret i32 %14
}
int bptCountLevels(int maxBlockSize, int itemCount) {
  int levels = 1;
  while (itemCount > maxBlockSize) {
    itemCount = (itemCount + maxBlockSize - 1) / maxBlockSize;
    levels += 1;
  }
  return levels;
}


x86 assembly (clang, -O0):
<bptCountLevels>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    113b <bptCountLevels+0x3b>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <bptCountLevels+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bptCountLevels>:
mov    $0x1,%ecx
cmp    %edi,%esi
jle    112c <bptCountLevels+0x2c>
mov    %esi,%eax
lea    -0x1(%rdi),%esi
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %esi,%eax
cltd
idiv   %edi
add    $0x1,%ecx
cmp    %edi,%eax
jg     1120 <bptCountLevels+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bptCountLevels(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = add i32 %0, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 1, %4 ], [ %11, %6 ]
%8 = phi i32 [ %1, %4 ], [ %10, %6 ]
%9 = add i32 %5, %8
%10 = sdiv i32 %9, %0
%11 = add nuw nsw i32 %7, 1
%12 = icmp sgt i32 %10, %0
br i1 %12, label %6, label %13
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ %11, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int uint64_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t asu_hash(const uint64_t x, const uint64_t *k) {
  uint64_t t = k[0] + k[1] * (uint32_t)x + k[2] * (uint32_t)(x >> 32);
  return (uint32_t)(t >> 32);
}


x86 assembly (clang, -O0):
<asu_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    -0x18(%rbp),%ecx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @asu_hash(i32 %0, i32* nocapture readnone %1) {
ret i32 poison
}