xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int tv_sec;
  size_t tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
size_t spx_resource_stats_cpu_time(void) {
  struct timespec ts;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
  return ((ts).tv_sec * 1000 * 1000 * 1000 + (ts).tv_nsec);
}


x86 assembly (clang, -O0):
<spx_resource_stats_cpu_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_resource_stats_cpu_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%eax
3b
cltq
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i64 @spx_resource_stats_cpu_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul i32 %6, 1000000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %10, %8
ret i64 %11
}
/* Type definitions */
struct oop_readable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_kill(struct oop_readable *);
int delete_tidy(struct oop_readable *ra) {
  delete_kill(ra);
  return 0;
}


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

x86 assembly (clang, -O2):
<delete_tidy>:
push   %rax
call   1030 <delete_kill@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.oop_readable = type { i32 }
define i32 @delete_tidy(%struct.oop_readable* %0) {
%2 = tail call i32 @delete_kill(%struct.oop_readable* %0)
ret i32 0
}
int do_011() { return 11; }


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

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

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

LLVM IR (-O2):
define i32 @do_011() {
ret i32 11
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void onintr() { done(1); }


x86 assembly (clang, -O0):
<onintr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<onintr>:
mov    $0x1,%edi
jmp    1030 <done@plt>

LLVM IR (-O0):
define void @onintr() {
%1 = call i32 @done(i32 1)
ret void
}

LLVM IR (-O2):
define void @onintr() {
%1 = tail call i32 @done(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void xC450143D143D0000(uint16_t *accusative, uint16_t *instrumental) {
  *accusative = (uint16_t)(*accusative - *instrumental);
}


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

x86 assembly (clang, -O2):
mov    (%rsi),%rax
sub    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @xC450143D143D0000(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = sub nsw i64 %6, %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @xC450143D143D0000(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = sub nsw i64 %3, %4
store i64 %5, i64* %0
ret void
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_size_t(size_t const k1, size_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_size_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_size_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_size_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_size_t(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int writeData(int fd, char *data) {
  0;
  return write(fd, data, strlen(data));
}


x86 assembly (clang, -O0):
<writeData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeData>:
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
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @writeData(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
double ipow(double, int);
double xyz(double x, double y, double z, int lx, int ly, int lz) {
  return ipow(x, lx) * ipow(y, ly) * ipow(z, lz);
}


x86 assembly (clang, -O0):
<xyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
call   1030 <ipow@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%edi
call   1030 <ipow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1030 <ipow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
call   1030 <ipow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mov    %ebp,%edi
call   1030 <ipow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %ebx,%edi
call   1030 <ipow@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @xyz(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
%13 = load double, double* %7
%14 = load i32, i32* %10
%15 = call double @ipow(double %13, i32 %14)
%16 = load double, double* %8
%17 = load i32, i32* %11
%18 = call double @ipow(double %16, i32 %17)
%19 = fmul double %15, %18
%20 = load double, double* %9
%21 = load i32, i32* %12
%22 = call double @ipow(double %20, i32 %21)
%23 = fmul double %19, %22
ret double %23
}

LLVM IR (-O2):
define double @xyz(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call double @ipow(double %0, i32 %3)
%8 = tail call double @ipow(double %1, i32 %4)
%9 = fmul double %7, %8
%10 = tail call double @ipow(double %2, i32 %5)
%11 = fmul double %9, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ mwte_fft_in_place_fft_test(int, double, double);
int main(void) {
  double sample_freq = 8.0;
  double signal_freq = 1.0;
  mwte_fft_in_place_fft_test(32, signal_freq, sample_freq);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x20,%edi
call   1030 <mwte_fft_in_place_fft_test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x20,%edi
call   1030 <mwte_fft_in_place_fft_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 8.000000e+00, double* %2
store double 1.000000e+00, double* %3
%4 = load double, double* %3
%5 = load double, double* %2
%6 = call i32 @mwte_fft_in_place_fft_test(i32 32, double %4, double %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mwte_fft_in_place_fft_test(i32 32, double 1.000000e+00, double 8.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ uint32Clear(int /*<<< orphan*/ *);
void uint32Destroy(uint32_t *data) {
  uint32Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<uint32Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <uint32Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uint32Destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @uint32Clear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @uint32Destroy(i32* %0) {
%2 = tail call i32 @uint32Clear(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
/* Type definitions */
struct HashTable {
  int dummy;
};
struct HashItrCons {
  int dummy;
};

/* Variables and functions */
scalar_t__ HashCreateItr(struct HashTable *);
struct HashItrCons *HashCreateItrCons(const struct HashTable *Hash) {
  return (struct HashItrCons *)HashCreateItr((struct HashTable *)Hash);
}


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

x86 assembly (clang, -O2):
<HashCreateItrCons>:
jmp    1030 <HashCreateItr@plt>

LLVM IR (-O0):
%struct.HashItrCons = type { i32 }
%struct.HashTable = type { i32 }
define %struct.HashItrCons* @HashCreateItrCons(%struct.HashTable* %0) {
%2 = alloca %struct.HashTable*
store %struct.HashTable* %0, %struct.HashTable** %2
%3 = load %struct.HashTable*, %struct.HashTable** %2
%4 = call i64 @HashCreateItr(%struct.HashTable* %3)
%5 = inttoptr i64 %4 to %struct.HashItrCons*
ret %struct.HashItrCons* %5
}

LLVM IR (-O2):
%struct.HashItrCons = type { i32 }
%struct.HashTable = type { i32 }
define %struct.HashItrCons* @HashCreateItrCons(%struct.HashTable* %0) {
%2 = tail call i64 @HashCreateItr(%struct.HashTable* %0)
%3 = inttoptr i64 %2 to %struct.HashItrCons*
ret %struct.HashItrCons* %3
}
int cy(long int n) {
  int l = 0;
  while (n != 1) {
    if (n % 2 == 1) {
      n = n * 3 + 1;
      l++;
    } else {
      n /= 2;
      l++;
    }
  }
  return l + 1;
}


x86 assembly (clang, -O0):
<cy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x1,-0x8(%rbp)
je     116d <cy+0x6d>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x1,%rdx
jne    114d <cy+0x4d>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <cy+0x68>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cy+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cy>:
mov    $0x1,%eax
cmp    $0x1,%rdi
jne    110c <cy+0xc>
ret
mov    $0x1,%eax
jmp    112f <cy+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
sar    %rcx
mov    %rcx,%rdi
add    $0x1,%eax
cmp    $0x1,%rdi
je     110b <cy+0xb>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
mov    %rcx,%rdx
and    $0xfffffffffffffffe,%rdx
mov    %rdi,%rsi
sub    %rdx,%rsi
cmp    $0x1,%rsi
jne    1120 <cy+0x20>
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
jmp    1126 <cy+0x26>

LLVM IR (-O0):
define i32 @cy(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 1
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i64, i64* %2
%9 = srem i64 %8, 2
%10 = icmp eq i64 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i64, i64* %2
%13 = mul nsw i64 %12, 3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %22
17: ; preds = %7
%18 = load i64, i64* %2
%19 = sdiv i64 %18, 2
store i64 %19, i64* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %22
22: ; preds = %17, %11
br label %4
23: ; preds = %4
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
ret i32 %25
}

LLVM IR (-O2):
define i32 @cy(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 1, %1 ]
%5 = phi i64 [ %11, %3 ], [ %0, %1 ]
%6 = srem i64 %5, 2
%7 = sdiv i64 %5, 2
%8 = icmp eq i64 %6, 1
%9 = mul nsw i64 %5, 3
%10 = add nsw i64 %9, 1
%11 = select i1 %8, i64 %10, i64 %7
%12 = add i32 %4, 1
%13 = icmp eq i64 %11, 1
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %12, %3 ]
ret i32 %15
}
int test_imm_58int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x58 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_58int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5767168
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct _stor_ftruncate_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_ftruncate_req *);
void stor_ftruncate_req_free(struct _stor_ftruncate_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_ftruncate_req_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct._stor_ftruncate_req = type { i32 }
define void @stor_ftruncate_req_free(%struct._stor_ftruncate_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_ftruncate_req* %0)
ret void
}
int _raise() { return 0; }


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

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

LLVM IR (-O0):
define i32 @_raise() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_raise() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t strnlen(const char *src, size_t max) {
  const uint8_t *src_bytes = ((const uint8_t *)src);
  size_t len = 0;
  while (max-- && *(src_bytes++))
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
je     1152 <strnlen+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1162 <strnlen+0x62>
jmp    1173 <strnlen+0x73>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <strnlen+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rax,4)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %10, %13 ], [ %1, %4 ]
%8 = phi i64 [ %15, %13 ], [ 0, %4 ]
%9 = phi i32* [ %14, %13 ], [ %5, %4 ]
%10 = add i64 %7, -1
%11 = load i32, i32* %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %6
%14 = getelementptr inbounds i32, i32* %9, i64 1
%15 = add nuw i64 %8, 1
%16 = icmp eq i64 %10, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %13, %2
%18 = phi i64 [ 0, %2 ], [ %1, %13 ], [ %8, %6 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ F_RDLCK;
int /*<<< orphan*/ gt_xflock_with_op(int, int /*<<< orphan*/);
void gt_xflock_shared(int fd) { gt_xflock_with_op(fd, F_RDLCK); }


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

x86 assembly (clang, -O2):
<gt_xflock_shared>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <gt_xflock_with_op@plt>

LLVM IR (-O0):
@F_RDLCK = global i32 0
define void @gt_xflock_shared(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_RDLCK
%5 = call i32 @gt_xflock_with_op(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@F_RDLCK = global i32 0
define void @gt_xflock_shared(i32 %0) {
%2 = load i32, i32* @F_RDLCK
%3 = tail call i32 @gt_xflock_with_op(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int string_equals(const char *s1, const char *s2) {
  return strcmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<string_equals>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equals>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equals(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_equals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CleanUp();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char const *);
int /*<<< orphan*/ stderr;
void Error(const unsigned char *pError) {
  fprintf(stderr, "Fatal Error: %s\n", pError);
  CleanUp();
  exit(1);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <CleanUp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <CleanUp@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
define void @Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @CleanUp()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal Error: %s\0A\00"
define void @Error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @CleanUp()
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int I2C_Read(int, int, unsigned char *);
int STC3115_ReadByte(int RegAddress) {
  int value;
  unsigned char data[2];
  int res;
  res = I2C_Read(1, RegAddress, data);
  if (res >= 0) {
    value = data[0];
  } else
    value = -1;
  return (value);
}


x86 assembly (clang, -O0):
<STC3115_ReadByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xa(%rbp),%rdx
mov    $0x1,%edi
call   1030 <I2C_Read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1145 <STC3115_ReadByte+0x35>
movzbl -0xa(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114c <STC3115_ReadByte+0x3c>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_ReadByte>:
push   %rax
mov    %edi,%esi
lea    0x6(%rsp),%rdx
mov    $0x1,%edi
call   1030 <I2C_Read@plt>
test   %eax,%eax
movzbl 0x6(%rsp),%ecx
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC3115_ReadByte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @I2C_Read(i32 1, i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %3
br label %16
15: ; preds = %1
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @STC3115_ReadByte(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @I2C_Read(i32 1, i32 %0, i8* %3)
%5 = icmp sgt i32 %4, -1
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
void *out_note_on() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @out_note_on() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @out_note_on() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ challenge_go_off();
int /*<<< orphan*/ challenge_run();
int main() {
  adainit();
  challenge_run();
  challenge_go_off();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <adainit@plt>
mov    $0x0,%al
call   1030 <challenge_run@plt>
mov    $0x0,%al
call   1040 <challenge_go_off@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <adainit@plt>
xor    %eax,%eax
call   1030 <challenge_run@plt>
xor    %eax,%eax
call   1040 <challenge_go_off@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @adainit()
%3 = call i32 (...) @challenge_run()
%4 = call i32 (...) @challenge_go_off()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @challenge_run()
%3 = tail call i32 (...) @challenge_go_off()
ret i32 0
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int const INT64_C(int);
int32_t aeron_add_wrap_i32(int32_t a, int32_t b) {
  const int64_t a_widened = a;
  const int64_t b_widened = b;
  const int64_t sum = a_widened + b_widened;
  return (int32_t)(sum & INT64_C(0xFFFFFFFF));
}


x86 assembly (clang, -O0):
<aeron_add_wrap_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_add_wrap_i32>:
push   %rbx
lea    (%rdi,%rsi,1),%ebx
mov    $0xffffffff,%edi
call   1030 <INT64_C@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @aeron_add_wrap_i32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @INT64_C(i32 -1)
%15 = and i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @aeron_add_wrap_i32(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @INT64_C(i32 -1)
%5 = and i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void die_oom(size_t size) {
  die("Out of memory, malloc failed for %u bytes\n", size);
}


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

x86 assembly (clang, -O2):
<die_oom>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Out of memory, malloc failed for %u bytes\0A\00"
define void @die_oom(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @die(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Out of memory, malloc failed for %u bytes\0A\00"
define void @die_oom(i64 %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
long NET_init() { return 0; }


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

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

LLVM IR (-O0):
define i64 @NET_init() {
ret i64 0
}

LLVM IR (-O2):
define i64 @NET_init() {
ret i64 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bcd2bin(uint8_t bcd_value) {
  uint8_t temp;
  temp = bcd_value;
  temp >>= 1;
  temp &= 0x78;
  return (temp + (temp >> 2) + (bcd_value & 0x0f));
}


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

x86 assembly (clang, -O2):
<bcd2bin>:
mov    %edi,%eax
shr    %eax
and    $0x78,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0xf,%edi
add    %edi,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bcd2bin(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 120
%4 = lshr exact i32 %3, 2
%5 = and i32 %0, 15
%6 = add nuw nsw i32 %3, %5
%7 = add nuw nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
struct disassemble_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fixfxe(struct disassemble_info *);
int fxefixer(struct disassemble_info *dd, char *b) {
  fixfxe(dd);
  return 0;
}


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

x86 assembly (clang, -O2):
<fxefixer>:
push   %rax
call   1030 <fixfxe@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.disassemble_info = type { i32 }
define i32 @fxefixer(%struct.disassemble_info* %0, i8* %1) {
%3 = alloca %struct.disassemble_info*
%4 = alloca i8*
store %struct.disassemble_info* %0, %struct.disassemble_info** %3
store i8* %1, i8** %4
%5 = load %struct.disassemble_info*, %struct.disassemble_info** %3
%6 = call i32 @fixfxe(%struct.disassemble_info* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.disassemble_info = type { i32 }
define i32 @fxefixer(%struct.disassemble_info* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @fixfxe(%struct.disassemble_info* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strcasecmp(char const *, char const *);
int strcasecmp_l(const char *l, const char *r, locale_t loc) {
  return strcasecmp(l, r);
}


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

x86 assembly (clang, -O2):
<strcasecmp_l>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @strcasecmp_l(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** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcasecmp(i8* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcasecmp_l(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %4
}
/* Type definitions */
struct xdg_shell {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)xdg_shell, user_data);
}


x86 assembly (clang, -O0):
<xdg_shell_set_user_data>:
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 <wl_proxy_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_shell_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_shell_set_user_data(%struct.xdg_shell* %0, i8* %1) {
%3 = alloca %struct.xdg_shell*
%4 = alloca i8*
store %struct.xdg_shell* %0, %struct.xdg_shell** %3
store i8* %1, i8** %4
%5 = load %struct.xdg_shell*, %struct.xdg_shell** %3
%6 = bitcast %struct.xdg_shell* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_shell_set_user_data(%struct.xdg_shell* %0, i8* %1) {
%3 = bitcast %struct.xdg_shell* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Type definitions */
struct histogram {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *path_common(struct histogram *, int);
char *string_format(char *, char *);
char *path_of_variables_script(struct histogram *h, int only_base_name) {
  char *common = path_common(h, only_base_name);
  char *path = string_format("%s_vars.gnuplot", common);
  free(common);
  return path;
}


x86 assembly (clang, -O0):
<path_of_variables_script>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <path_common@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <string_format@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_of_variables_script>:
push   %r14
push   %rbx
push   %rax
call   1050 <path_common@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    %rax,%rsi
call   1040 <string_format@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.histogram = type { i32 }
@.str = [16 x i8] c"%s_vars.gnuplot\00"
define i8* @path_of_variables_script(%struct.histogram* %0, i32 %1) {
%3 = alloca %struct.histogram*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store %struct.histogram* %0, %struct.histogram** %3
store i32 %1, i32* %4
%7 = load %struct.histogram*, %struct.histogram** %3
%8 = load i32, i32* %4
%9 = call i8* @path_common(%struct.histogram* %7, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i8* @string_format(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
%struct.histogram = type { i32 }
@.str = [16 x i8] c"%s_vars.gnuplot\00"
define i8* @path_of_variables_script(%struct.histogram* %0, i32 %1) {
%3 = tail call i8* @path_common(%struct.histogram* %0, i32 %1)
%4 = tail call i8* @string_format(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i8* %4
}
int test_s(signed int x) {
  return __builtin_abs(x) + __builtin_clz(x) + __builtin_ctz(x) +
         __builtin_ffs(x) + __builtin_parity(x) + __builtin_popcount(x);
}


x86 assembly (clang, -O0):
<test_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
mov    -0x4(%rbp),%ecx
bsr    %ecx,%ecx
xor    $0x1f,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
bsf    %ecx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%esi
bsf    %esi,%ecx
add    $0x1,%ecx
xor    %edx,%edx
cmp    $0x0,%esi
cmove  %edx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    %edx,%ecx
shr    %ecx
and    $0x55555555,%ecx
sub    %ecx,%edx
mov    %edx,%ecx
and    $0x33333333,%ecx
shr    $0x2,%edx
and    $0x33333333,%edx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %edx,%ecx
and    $0xf0f0f0f,%ecx
imul   $0x1010101,%ecx,%ecx
shr    $0x18,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    %edx,%ecx
shr    %ecx
and    $0x55555555,%ecx
sub    %ecx,%edx
mov    %edx,%ecx
and    $0x33333333,%ecx
shr    $0x2,%edx
and    $0x33333333,%edx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %edx,%ecx
and    $0xf0f0f0f,%ecx
imul   $0x1010101,%ecx,%ecx
shr    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_s>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
bsr    %edi,%eax
xor    $0x1f,%eax
add    %ecx,%eax
bsf    %edi,%edx
add    %edx,%eax
test   %edi,%edi
mov    $0xffffffff,%ecx
cmovne %edx,%ecx
mov    %edi,%edx
shr    %edx
and    $0x55555555,%edx
sub    %edx,%edi
mov    %edi,%edx
and    $0x33333333,%edx
shr    $0x2,%edi
and    $0x33333333,%edi
add    %edx,%edi
mov    %edi,%edx
shr    $0x4,%edx
add    %edi,%edx
and    $0xf0f0f0f,%edx
imul   $0x1010101,%edx,%edx
shr    $0x18,%edx
add    %edx,%eax
and    $0x1,%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 %4, i32 %3
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %2
%11 = call i32 @llvm.cttz.i32(i32 %10, i1 true)
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %2
%14 = call i32 @llvm.cttz.i32(i32 %13, i1 true)
%15 = add i32 %14, 1
%16 = icmp eq i32 %13, 0
%17 = select i1 %16, i32 0, i32 %15
%18 = add nsw i32 %12, %17
%19 = load i32, i32* %2
%20 = call i32 @llvm.ctpop.i32(i32 %19)
%21 = and i32 %20, 1
%22 = add nsw i32 %18, %21
%23 = load i32, i32* %2
%24 = call i32 @llvm.ctpop.i32(i32 %23)
%25 = add nsw i32 %22, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_s(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%4 = add nuw nsw i32 %2, %3
%5 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%6 = add nuw nsw i32 %4, %5
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 0, i32 %7
%10 = tail call i32 @llvm.ctpop.i32(i32 %0)
%11 = and i32 %10, 1
%12 = add nuw i32 %6, %10
%13 = add nuw i32 %12, %11
%14 = add nuw i32 %13, %9
ret i32 %14
}
unsigned geom_imax3f(const float v[3]) {
  unsigned i = 0;
  if (v[1] > v[i]) {
    i = 1;
  }
  if (v[2] > v[i]) {
    i = 2;
  }
  return i;
}


x86 assembly (clang, -O0):
<geom_imax3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
ucomiss (%rax,%rcx,4),%xmm0
jbe    1130 <geom_imax3f+0x30>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
ucomiss (%rax,%rcx,4),%xmm0
jbe    1151 <geom_imax3f+0x51>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_imax3f>:
movss  0x4(%rdi),%xmm0
xor    %ecx,%ecx
ucomiss (%rdi),%xmm0
seta   %cl
movss  0x8(%rdi),%xmm0
ucomiss (%rdi,%rcx,4),%xmm0
mov    $0x2,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @geom_imax3f(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
%4 = load float*, float** %2
%5 = getelementptr inbounds float, float* %4, i64 1
%6 = load float, float* %5
%7 = load float*, float** %2
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = load float, float* %10
%12 = fcmp ogt float %6, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %3
br label %14
14: ; preds = %13, %1
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %2
%19 = load i32, i32* %3
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
%23 = fcmp ogt float %17, %22
br i1 %23, label %24, label %25
24: ; preds = %14
store i32 2, i32* %3
br label %25
25: ; preds = %24, %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @geom_imax3f(float* nocapture %0) {
%2 = getelementptr inbounds float, float* %0, i64 1
%3 = load float, float* %2
%4 = load float, float* %0
%5 = fcmp ogt float %3, %4
%6 = zext i1 %5 to i32
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = zext i1 %5 to i64
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
%12 = fcmp ogt float %8, %11
%13 = select i1 %12, i32 2, i32 %6
ret i32 %13
}
int compute_square(int y) { return y + 3; }


x86 assembly (clang, -O0):
<compute_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_square>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @compute_square(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
scalar_t__ empty_or_dash(char const *);
const char *empty_or_dash_to_null(const char *p) {
  return empty_or_dash(p) ? NULL : p;
}


x86 assembly (clang, -O0):
<empty_or_dash_to_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <empty_or_dash@plt>
cmp    $0x0,%rax
je     113a <empty_or_dash_to_null+0x2a>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1142 <empty_or_dash_to_null+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_or_dash_to_null>:
push   %rbx
mov    %rdi,%rbx
call   1030 <empty_or_dash@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @empty_or_dash_to_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @empty_or_dash(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i8*, i8** %2
br label %9
9: ; preds = %7, %6
%10 = phi i8* [ null, %6 ], [ %8, %7 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @empty_or_dash_to_null(i8* %0) {
%2 = tail call i64 @empty_or_dash(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* %0, i8* null
ret i8* %4
}
void portab_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @portab_setup() {
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *get_1d_mem_int(int dim1) {
  int *array_1d;
  if (!(array_1d = (int *)calloc(dim1, sizeof(int)))) {
    printf("Cannot allocate memory in get_1d_mem_int\n");
    exit(1);
  }
  return array_1d;
}


x86 assembly (clang, -O0):
<get_1d_mem_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116c <get_1d_mem_int+0x3c>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_1d_mem_int>:
push   %rax
mov    $0x4,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1142 <get_1d_mem_int+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Cannot allocate memory in get_1d_mem_int\0A\00"
define i32* @get_1d_mem_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@str = [41 x i8] c"Cannot allocate memory in get_1d_mem_int\00"
define i32* @get_1d_mem_int(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i32*
ret i32* %8
}