xunge/DecIR huggingface dataset:
double ratio(int R, int C) {
  int no_cheese_radius = R - C;
  return ((double)(no_cheese_radius * no_cheese_radius * 100)) / (R * R);
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   $0x64,%eax,%eax
cvtsi2sd %eax,%xmm0
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
mov    %edi,%eax
sub    %esi,%eax
imul   %eax,%eax
imul   $0x64,%eax,%eax
cvtsi2sd %eax,%xmm0
imul   %edi,%edi
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ratio(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* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
%12 = mul nsw i32 %11, 100
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = mul nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = fdiv double %13, %17
ret double %18
}

LLVM IR (-O2):
define double @ratio(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = mul i32 %3, 100
%5 = mul i32 %4, %3
%6 = sitofp i32 %5 to double
%7 = mul nsw i32 %0, %0
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
ret double %9
}
/* Variables and functions */
int O_NONBLOCK;
int O_WRONLY;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char const *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void func(const char *file_name) {
  int fd;
  char *buf;
  fd = open(file_name, O_NONBLOCK | O_WRONLY);
  if (fd == -1) {
    printf("Could not open named pipe for writing\n");
    exit(0);
  }
  system("ls -la > fifo_in_same_dir");
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2e70(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1187 <func+0x47>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe99(%rip),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2e81(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     116a <func+0x2a>
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@O_NONBLOCK = global i32 0
@O_WRONLY = global i32 0
@.str = [39 x i8] c"Could not open named pipe for writing\0A\00"
@.str.1 = [26 x i8] c"ls -la > fifo_in_same_dir\00"
define void @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_NONBLOCK
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %1
%16 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
@O_WRONLY = global i32 0
@.str.1 = [26 x i8] c"ls -la > fifo_in_same_dir\00"
@str = [38 x i8] c"Could not open named pipe for writing\00"
define void @func(i8* nocapture %0) {
%2 = load i32, i32* @O_NONBLOCK
%3 = load i32, i32* @O_WRONLY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %1
%11 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world 0.0.1\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Hello world 0.0.1\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Hello world 0.0.1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ warning(char *);
int caps_can_ptrace() {
  static int warned = 0;
  if (!warned) {
    warning("Warning: Capability checking is disabled. Assuming that we "
            "have all possible permissions.");
    warned = 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<caps_can_ptrace>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1137 <caps_can_ptrace+0x27>
lea    0xed8(%rip),%rdi
call   1030 <warning@plt>
movl   $0x1,0x2ef5(%rip)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caps_can_ptrace>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    112d <caps_can_ptrace+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <warning@plt>
movb   $0x1,0x2eff(%rip)
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@caps_can_ptrace.warned = internal global i32 0
@.str = [90 x i8] c"Warning: Capability checking is disabled. Assuming that we have all possible permissions.\00"
define i32 @caps_can_ptrace() {
%1 = load i32, i32* @caps_can_ptrace.warned
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @warning(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* @caps_can_ptrace.warned
br label %5
5: ; preds = %3, %0
ret i32 1
}

LLVM IR (-O2):
@caps_can_ptrace.warned = internal unnamed_addr global i1 false
@.str = [90 x i8] c"Warning: Capability checking is disabled. Assuming that we have all possible permissions.\00"
define i32 @caps_can_ptrace() {
%1 = load i1, i1* @caps_can_ptrace.warned
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 @warning(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
store i1 true, i1* @caps_can_ptrace.warned
br label %4
4: ; preds = %2, %0
ret i32 1
}
/* Variables and functions */
int M_PI;
double exp(double);
double sqrt(int);
double normpdf(double x, double mu, double sigma) {
  double dx = x - mu;
  return exp(-dx * dx / (2 * sigma * sigma)) / (sqrt(2 * M_PI) * sigma);
}


x86 assembly (clang, -O0):
<normpdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normpdf>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
subsd  %xmm1,%xmm0
movapd 0xeca(%rip),%xmm1
xorpd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1040 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @normpdf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
store double %10, double* %7
%11 = load double, double* %7
%12 = fneg double %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* %6
%16 = fmul double 2.000000e+00, %15
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = fdiv double %14, %18
%20 = call double @exp(double %19)
%21 = load i32, i32* @M_PI
%22 = mul nsw i32 2, %21
%23 = call double @sqrt(i32 %22)
%24 = load double, double* %6
%25 = fmul double %23, %24
%26 = fdiv double %20, %25
ret double %26
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @normpdf(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fneg double %4
%6 = fmul double %4, %5
%7 = fmul double %2, 2.000000e+00
%8 = fmul double %7, %2
%9 = fdiv double %6, %8
%10 = tail call double @exp(double %9)
%11 = load i32, i32* @M_PI
%12 = shl nsw i32 %11, 1
%13 = tail call double @sqrt(i32 %12)
%14 = fmul double %13, %2
%15 = fdiv double %10, %14
ret double %15
}
void SPI4_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @SPI4_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
scalar_t__ __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  if (__VERIFIER_nondet_int()) {
    x = 0;
    y = 1;
  } else {
    x = 1;
  }
  z = 1;
  __VERIFIER_assert(x == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1153 <main+0x33>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    115a <main+0x3a>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %2
store i32 1, i32* %3
br label %9
8: ; preds = %0
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
store i32 1, i32* %4
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assertEq(int, int);
int /*<<< orphan*/ endTest();
int main() {
  int a = 10;
  int *b = &a;
  int c = *b;
  *b = 20;
  assertEq(c, 10);
  assertEq(a, 20);
  endTest();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x14(%rbp),%edi
mov    $0xa,%esi
call   1040 <assertEq@plt>
mov    -0x4(%rbp),%edi
mov    $0x14,%esi
call   1040 <assertEq@plt>
mov    $0x0,%al
call   1030 <endTest@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <assertEq@plt>
mov    $0x14,%edi
mov    $0x14,%esi
call   1040 <assertEq@plt>
xor    %eax,%eax
call   1030 <endTest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 10, i32* %1
store i32* %1, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32*, i32** %2
store i32 20, i32* %6
%7 = load i32, i32* %3
%8 = call i32 @assertEq(i32 %7, i32 10)
%9 = load i32, i32* %1
%10 = call i32 @assertEq(i32 %9, i32 20)
%11 = call i32 (...) @endTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assertEq(i32 10, i32 10)
%2 = tail call i32 @assertEq(i32 20, i32 20)
%3 = tail call i32 (...) @endTest()
ret i32 0
}
/* Variables and functions */
int _func_xpath_operators(char *, void *, int, int);
int _func_xpath_operator_diff(char *chunk, void *data) {
  return _func_xpath_operators(chunk, data, 7, 7);
}


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

x86 assembly (clang, -O2):
<_func_xpath_operator_diff>:
mov    $0x7,%edx
mov    $0x7,%ecx
jmp    1030 <_func_xpath_operators@plt>

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

LLVM IR (-O2):
define i32 @_func_xpath_operator_diff(i8* %0, i8* %1) {
%3 = tail call i32 @_func_xpath_operators(i8* %0, i8* %1, i32 7, i32 7)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_command_complete_get_num_hci_command_packets(const uint8_t *event) {
  return event[2];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_command_complete_get_num_hci_command_packets(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_command_complete_get_num_hci_command_packets(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int q1();
int f1(void) { return q1() + 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <q1@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
xor    %eax,%eax
call   1030 <q1@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f1() {
%1 = call i32 (...) @q1()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @f1() {
%1 = tail call i32 (...) @q1()
%2 = add nsw i32 %1, 1
ret i32 %2
}
int longestIncreasingPath(int **matrix, int matrixRowSize, int matrixColSize) {}


x86 assembly (clang, -O0):
<longestIncreasingPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @longestIncreasingPath(i32** nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("cleanup: arg = %s\n", (char *)arg); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"cleanup: arg = %s\0A\00"
define void @cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"cleanup: arg = %s\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __nr_to_section(unsigned long);
int present_section(int /*<<< orphan*/);
__attribute__((always_)) int present_section_nr(unsigned long nr) {
  return present_section(__nr_to_section(nr));
}


x86 assembly (clang, -O0):
<present_section_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__nr_to_section@plt>
mov    %eax,%edi
call   1040 <present_section@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<present_section_nr>:
push   %rax
call   1030 <__nr_to_section@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <present_section@plt>

LLVM IR (-O0):
define i32 @present_section_nr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__nr_to_section(i64 %3)
%5 = call i32 @present_section(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @present_section_nr(i64 %0) {
%2 = tail call i32 @__nr_to_section(i64 %0)
%3 = tail call i32 @present_section(i32 %2)
ret i32 %3
}
int count_char(const char *string, char chr) {
  const char *p;
  int count = 0;
  for (p = string; *p; p++)
    if (*p == chr)
      ++count;
  return count;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <count_char+0x5c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <count_char+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <count_char+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <count_char+0x1d>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
unsigned f(unsigned x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ E2PRegRead(unsigned char, unsigned char, unsigned char *);
void E2PRegReadA(unsigned short RegAddr, unsigned char *RegData) {
  unsigned char RegAddrH = RegAddr >> 8;
  unsigned char RegAddrL = RegAddr & 0xFF;
  E2PRegRead(RegAddrH, RegAddrL, (unsigned char *)RegData);
}


x86 assembly (clang, -O0):
<E2PRegReadA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x11(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x12(%rbp),%al
mov    -0x10(%rbp),%rdx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <E2PRegRead@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E2PRegReadA>:
mov    %rsi,%rdx
movzbl %dil,%esi
shr    $0x8,%edi
jmp    1030 <E2PRegRead@plt>

LLVM IR (-O0):
define void @E2PRegReadA(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i16 %0, i16* %3
store i8* %1, i8** %4
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i8, i8* %5
%16 = load i8, i8* %6
%17 = load i8*, i8** %4
%18 = call i32 @E2PRegRead(i8 zeroext %15, i8 zeroext %16, i8* %17)
ret void
}

LLVM IR (-O2):
define void @E2PRegReadA(i16 zeroext %0, i8* %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %0 to i8
%6 = tail call i32 @E2PRegRead(i8 zeroext %4, i8 zeroext %5, i8* %1)
ret void
}
/* Variables and functions */
int PAPI_flops(float *, float *, long long *, float *);
void papif_flops(float *real_time, float *proc_time, long long *flpops,
                 float *mflops, int *check) {
  *check = PAPI_flops(real_time, proc_time, flpops, mflops);
}


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

x86 assembly (clang, -O2):
<papif_flops>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flops@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_flops(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flops(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_flops(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flops(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_data_with_mask(int, int);
void operation_i2c_stop() {
  gpio_write_data_with_mask((1 << 1) | (1 << 0), (0 << 1) | (1 << 0));
  gpio_write_data_with_mask((1 << 1) | (1 << 0), (1 << 1) | (1 << 0));
}


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

x86 assembly (clang, -O2):
<operation_i2c_stop>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <gpio_write_data_with_mask@plt>
mov    $0x3,%edi
mov    $0x3,%esi
pop    %rax
jmp    1030 <gpio_write_data_with_mask@plt>

LLVM IR (-O0):
define void @operation_i2c_stop() {
%1 = call i32 @gpio_write_data_with_mask(i32 3, i32 1)
%2 = call i32 @gpio_write_data_with_mask(i32 3, i32 3)
ret void
}

LLVM IR (-O2):
define void @operation_i2c_stop() {
%1 = tail call i32 @gpio_write_data_with_mask(i32 3, i32 1)
%2 = tail call i32 @gpio_write_data_with_mask(i32 3, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least8_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_uint_least8_t(uint_least8_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_uint_least8_t(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int /*<<< orphan*/ daemon_poll_addfd(int, int /*<<< orphan*/);
void daemon_poll_addfd_read(int fd) { daemon_poll_addfd(fd, POLLIN); }


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

x86 assembly (clang, -O2):
<daemon_poll_addfd_read>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <daemon_poll_addfd@plt>

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

LLVM IR (-O2):
@POLLIN = global i32 0
define void @daemon_poll_addfd_read(i32 %0) {
%2 = load i32, i32* @POLLIN
%3 = tail call i32 @daemon_poll_addfd(i32 %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int fill_timestamp(char *buf, int buf_size) {
  time_t t = time(NULL);
  struct tm tm = {0};
  localtime_r(&t, &tm);
  return (strftime(buf, buf_size, "%F %T", &tm));
}


x86 assembly (clang, -O0):
<fill_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xe7a(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1060 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_timestamp>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <localtime_r@plt>
lea    0xe97(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i32 @fill_timestamp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = bitcast %struct.tm* %6 to i8*
%9 = call i32 @localtime_r(i32* %5, %struct.tm* %6)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @strftime(i8* %10, i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i32 %12
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i32 @fill_timestamp(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = bitcast %struct.tm* %4 to i8*
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
store i32 0, i32* %8
%9 = call i32 @localtime_r(i32* %3, %struct.tm* %4)
%10 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i32 %10
}
int av_ffwd(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_ffwd() {
ret i32 0
}
/* Variables and functions */
int close(int);
int timer_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<timer_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @timer_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int __svgalib_rendition_inmisc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__svgalib_rendition_inmisc() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void disconnect(int socketFd) { close(socketFd); }


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

x86 assembly (clang, -O2):
<disconnect>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @disconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
void ri_parallel_bcast(void *src, size_t size) {
  (void)src;
  (void)size;
}


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

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

LLVM IR (-O0):
define void @ri_parallel_bcast(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @ri_parallel_bcast(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ has_int_tag(void *);
uint32_t untag_u32(void *p) {
  assert(has_int_tag(p));
  return ((uint32_t)((uintptr_t)p)) >> 1;
}


x86 assembly (clang, -O0):
<untag_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <has_int_tag@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
sar    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<untag_u32>:
push   %rbx
mov    %rdi,%rbx
call   1030 <has_int_tag@plt>
mov    %eax,%edi
call   1040 <assert@plt>
sar    %ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @untag_u32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @has_int_tag(i8* %3)
%5 = call i32 @assert(i32 %4)
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
%9 = ashr i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @untag_u32(i8* %0) {
%2 = tail call i32 @has_int_tag(i8* %0)
%3 = tail call i32 @assert(i32 %2)
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 1
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void write_halfword(uint16_t val, uint8_t *buf, int offset) {
  buf[offset + 0] = val & 0xff;
  buf[offset + 1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<write_halfword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_halfword>:
mov    %edi,%eax
movzbl %al,%ecx
movslq %edx,%rdx
mov    %ecx,(%rsi,%rdx,4)
movzbl %ah,%eax
mov    %eax,0x4(%rsi,%rdx,4)
ret

LLVM IR (-O0):
define void @write_halfword(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 0
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
store i32 %8, i32* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
store i32 %16, i32* %21
ret void
}

LLVM IR (-O2):
define void @write_halfword(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = and i32 %0, 255
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %4, i32* %6
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
%9 = add nsw i32 %2, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
store i32 %8, i32* %11
ret void
}
void UnlockOSThread(void) {}


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

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

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

LLVM IR (-O2):
define void @UnlockOSThread() {
ret void
}
/* Variables and functions */
size_t aptx_get_buffer_size(void *codec_data) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @aptx_get_buffer_size(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int ecdh_hash_function_custom(unsigned char *output, const unsigned char *x,
                              const unsigned char *y, void *data) {
  (void)data;
  output[0] = 0x04;
  memcpy(output + 1, x, 32);
  memcpy(output + 33, y, 32);
  return 1;
}


x86 assembly (clang, -O0):
<ecdh_hash_function_custom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x4,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x21,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecdh_hash_function_custom>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
movb   $0x4,(%rdi)
add    $0x1,%rdi
mov    $0x20,%edx
call   1030 <memcpy@plt>
add    $0x21,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ecdh_hash_function_custom(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 4, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %6
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 32)
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 33
%18 = load i8*, i8** %7
%19 = call i32 @memcpy(i8* %17, i8* %18, i32 32)
ret i32 1
}

LLVM IR (-O2):
define i32 @ecdh_hash_function_custom(i8* %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
store i8 4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i32 32)
%7 = getelementptr inbounds i8, i8* %0, i64 33
%8 = tail call i32 @memcpy(i8* %7, i8* %2, i32 32)
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
void print_line_double(uint32_t i, uint32_t j, double v, int magma) {
  if (magma)
    printf("A[%u,%u]:=%f;\n", i, j, v);
  else
    printf("%u %u %f\n", i, j, v);
}


x86 assembly (clang, -O0):
<print_line_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114c <print_line_double+0x3c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movsd  -0x10(%rbp),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <print_line_double+0x53>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movsd  -0x10(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line_double>:
mov    %esi,%eax
mov    %edi,%esi
test   %edx,%edx
lea    0xef2(%rip),%rcx
lea    0xedc(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"A[%u,%u]:=%f;\0A\00"
@.str.1 = [10 x i8] c"%u %u %f\0A\00"
define void @print_line_double(i32 %0, i32 %1, double %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load double, double* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, double %14)
br label %21
16: ; preds = %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load double, double* %7
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18, double %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"A[%u,%u]:=%f;\0A\00"
@.str.1 = [10 x i8] c"%u %u %f\0A\00"
define void @print_line_double(i32 %0, i32 %1, double %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0, i32 %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help_show_version(void) {
  printf("scrot"
         " version "
         "0.9.0"
         "\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<help_show_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_show_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"scrot version 0.9.0\0A\00"
@EXIT_SUCCESS = global i32 0
define void @help_show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [20 x i8] c"scrot version 0.9.0\00"
define void @help_show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int param1) {
  int g1;
  g1 = -2 - (-2 - param1 &
             -1 - (param1 >> 31) + ((unsigned int)-2 < (unsigned int)param1));
  printf("MinMax result %d\n",
         (g1 - 3 & (g1 >> 31) - ((unsigned int)g1 < 3)) + 3);
  return;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffe,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sar    $0x1f,%edx
mov    $0xffffffff,%eax
sub    %edx,%eax
mov    $0xfffffffe,%edx
cmp    -0x4(%rbp),%edx
setb   %dl
and    $0x1,%dl
movzbl %dl,%edx
add    %edx,%eax
and    %eax,%ecx
mov    $0xfffffffe,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x3,%esi
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
cmpl   $0x3,-0x8(%rbp)
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
and    %eax,%esi
add    $0x3,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xfffffffe,%eax
mov    $0xfffffffe,%ecx
sub    %edi,%ecx
mov    %edi,%edx
shr    $0x1f,%edx
xor    %esi,%esi
cmp    $0xffffffff,%edi
sete   %sil
add    %esi,%edx
add    $0xffffffff,%edx
and    %ecx,%edx
sub    %edx,%eax
mov    $0xfffffffb,%ecx
sub    %edx,%ecx
mov    %eax,%esi
sar    $0x1f,%esi
cmp    $0x3,%eax
sbb    $0x0,%esi
and    %ecx,%esi
add    $0x3,%esi
lea    0xeaf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"MinMax result %d\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 -2, %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
%8 = sub nsw i32 -1, %7
%9 = load i32, i32* %2
%10 = icmp ult i32 -2, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %8, %11
%13 = and i32 %5, %12
%14 = sub nsw i32 -2, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 3
%17 = load i32, i32* %3
%18 = ashr i32 %17, 31
%19 = load i32, i32* %3
%20 = icmp ult i32 %19, 3
%21 = zext i1 %20 to i32
%22 = sub nsw i32 %18, %21
%23 = and i32 %16, %22
%24 = add nsw i32 %23, 3
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"MinMax result %d\0A\00"
define void @test(i32 %0) {
%2 = sub nsw i32 -2, %0
%3 = lshr i32 %0, 31
%4 = add nsw i32 %3, -1
%5 = icmp eq i32 %0, -1
%6 = zext i1 %5 to i32
%7 = add nsw i32 %4, %6
%8 = and i32 %7, %2
%9 = sub nsw i32 -2, %8
%10 = sub i32 -5, %8
%11 = ashr i32 %9, 31
%12 = icmp ult i32 %9, 3
%13 = sext i1 %12 to i32
%14 = add nsw i32 %11, %13
%15 = and i32 %14, %10
%16 = add nsw i32 %15, 3
%17 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}
void view_batch_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @view_batch_fini() {
ret void
}
int read16(unsigned char *buf) { return (buf[0] << 8) | buf[1]; }


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read16(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 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @read16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ELOOP;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *file = fopen("/sandbox/subdir1/loop1", "r");
  assert(file == NULL);
  assert(errno == ELOOP);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1040 <fopen@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e95(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/sandbox/subdir1/loop1\00"
@.str.1 = [2 x i8] c"r\00"
@errno = global i64 0
@ELOOP = global i64 0
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* @errno
%8 = load i64, i64* @ELOOP
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sandbox/subdir1/loop1\00"
@.str.1 = [2 x i8] c"r\00"
@errno = global i64 0
@ELOOP = global i64 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ELOOP
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}