xunge/DecIR huggingface dataset:
int several_traces(int a, int b, unsigned char addOrMul) {
  if (addOrMul)
    return a + b;
  else
    return a * b;
}


x86 assembly (clang, -O0):
<several_traces>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
cmpb   $0x0,-0xd(%rbp)
je     1127 <several_traces+0x27>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <several_traces+0x31>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<several_traces>:
lea    (%rsi,%rdi,1),%eax
imul   %edi,%esi
test   %edx,%edx
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @several_traces(i32 %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
%5 = add nsw i32 %1, %0
%6 = mul nsw i32 %1, %0
%7 = select i1 %4, i32 %6, i32 %5
ret i32 %7
}
/* Variables and functions */
int func_3(int, int, int);
int func_int(int a, int b, int c, int d) {
  int aa, bb, cc;
  int ret = func_3(aa, bb, cc);
  return (a + b + c + d + ret);
}


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

x86 assembly (clang, -O2):
<func_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <func_3@plt>
add    %ebx,%ebp
add    %r15d,%ebp
add    %r14d,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @func_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @func_3(i32 undef, i32 undef, i32 undef)
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %6, %2
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
void *malloc(size_t);
int /*<<< orphan*/ secure_memset(void *, char, size_t);
void *secure_malloc(size_t len) {
  void *ptr;
  assert(len);
  if (!(ptr = malloc(len)))
    return NULL;
  secure_memset(ptr, '\0', len);
  return ptr;
}


x86 assembly (clang, -O0):
<secure_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1169 <secure_malloc+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1180 <secure_malloc+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1050 <secure_memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <assert@plt>
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1159 <secure_malloc+0x29>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <secure_memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @secure_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i32 @assert(i64 %5)
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* null, i8** %2
br label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @secure_memset(i8* %12, i8 signext 0, i64 %13)
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @secure_malloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @secure_memset(i8* %3, i8 signext 0, i64 %0)
br label %7
7: ; preds = %1, %5
ret i8* %3
}
/* Type definitions */
struct libkeccak_state {
  int dummy;
};
struct libkeccak_spec {
  int dummy;
};

/* Variables and functions */
int libkeccak_generalised_sum_fd(int, struct libkeccak_state *,
                                 struct libkeccak_spec const *,
                                 int /*<<< orphan*/ *, void *);
__attribute__((__nonnull__(2, 3), __artificial__)) int
libkeccak_keccaksum_fd(int fd, struct libkeccak_state *restrict state,
                       const struct libkeccak_spec *restrict spec,
                       void *restrict hashsum) {
  return libkeccak_generalised_sum_fd(fd, state, spec, NULL, hashsum);
}


x86 assembly (clang, -O0):
<libkeccak_keccaksum_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <libkeccak_generalised_sum_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libkeccak_keccaksum_fd>:
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <libkeccak_generalised_sum_fd@plt>

LLVM IR (-O0):
%struct.libkeccak_state = type { i32 }
%struct.libkeccak_spec = type { i32 }
define i32 @libkeccak_keccaksum_fd(i32 %0, %struct.libkeccak_state* noalias %1, %struct.libkeccak_spec* noalias %2, i8* noalias %3) {
%5 = alloca i32
%6 = alloca %struct.libkeccak_state*
%7 = alloca %struct.libkeccak_spec*
%8 = alloca i8*
store i32 %0, i32* %5
store %struct.libkeccak_state* %1, %struct.libkeccak_state** %6
store %struct.libkeccak_spec* %2, %struct.libkeccak_spec** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load %struct.libkeccak_state*, %struct.libkeccak_state** %6
%11 = load %struct.libkeccak_spec*, %struct.libkeccak_spec** %7
%12 = load i8*, i8** %8
%13 = call i32 @libkeccak_generalised_sum_fd(i32 %9, %struct.libkeccak_state* %10, %struct.libkeccak_spec* %11, i32* null, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.libkeccak_state = type { i32 }
%struct.libkeccak_spec = type { i32 }
define i32 @libkeccak_keccaksum_fd(i32 %0, %struct.libkeccak_state* noalias %1, %struct.libkeccak_spec* noalias %2, i8* noalias %3) {
%5 = tail call i32 @libkeccak_generalised_sum_fd(i32 %0, %struct.libkeccak_state* %1, %struct.libkeccak_spec* %2, i32* null, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exerciseA();
int /*<<< orphan*/ exerciseB();
int /*<<< orphan*/ exerciseC();
int /*<<< orphan*/ exerciseD();
int /*<<< orphan*/ exerciseE();
int main() {
  exerciseA();
  exerciseB();
  exerciseC();
  exerciseD();
  exerciseE();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <exerciseA@plt>
mov    $0x0,%al
call   1060 <exerciseB@plt>
mov    $0x0,%al
call   1040 <exerciseC@plt>
mov    $0x0,%al
call   1070 <exerciseD@plt>
mov    $0x0,%al
call   1030 <exerciseE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <exerciseA@plt>
xor    %eax,%eax
call   1060 <exerciseB@plt>
xor    %eax,%eax
call   1040 <exerciseC@plt>
xor    %eax,%eax
call   1070 <exerciseD@plt>
xor    %eax,%eax
call   1030 <exerciseE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @exerciseA()
%3 = call i32 (...) @exerciseB()
%4 = call i32 (...) @exerciseC()
%5 = call i32 (...) @exerciseD()
%6 = call i32 (...) @exerciseE()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @exerciseA()
%2 = tail call i32 (...) @exerciseB()
%3 = tail call i32 (...) @exerciseC()
%4 = tail call i32 (...) @exerciseD()
%5 = tail call i32 (...) @exerciseE()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ killClawCompensation();
int /*<<< orphan*/ setClawMotors(int);
void manualCompensation() {
  killClawCompensation();
  setClawMotors(15);
}


x86 assembly (clang, -O0):
<manualCompensation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <killClawCompensation@plt>
mov    $0xf,%edi
call   1030 <setClawMotors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<manualCompensation>:
push   %rax
xor    %eax,%eax
call   1040 <killClawCompensation@plt>
mov    $0xf,%edi
pop    %rax
jmp    1030 <setClawMotors@plt>

LLVM IR (-O0):
define void @manualCompensation() {
%1 = call i32 (...) @killClawCompensation()
%2 = call i32 @setClawMotors(i32 15)
ret void
}

LLVM IR (-O2):
define void @manualCompensation() {
%1 = tail call i32 (...) @killClawCompensation()
%2 = tail call i32 @setClawMotors(i32 15)
ret void
}
/* Variables and functions */
float ANTweenTimingFunctionCubicInOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionCubicInOut(float time, float duration) {
  return ANTweenTimingFunctionCubicInOut(time, 0, 1, duration);
}


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

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionCubicInOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionCubicInOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionCubicInOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionCubicInOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void save_cursor() { fprintf(stdout, "\33[s"); }


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

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

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"\1B[s\00"
define void @save_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int help() {
  puts("Options:\n"
       "    -i             Set input file\n"
       "    -o             Set output file\n"
       "    -h / --help    Display 'help' text\n"
       "    --about        Display 'about' text\n"
       "    -d / --debug   Set debug mode\n");
  return 1;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [192 x i8] c"Options:\0A -i Set input file\0A -o Set output file\0A -h / --help Display 'help' text\0A --about Display 'about' text\0A -d / --debug Set debug mode\0A\00"
define i32 @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [192 x i8] c"Options:\0A -i Set input file\0A -o Set output file\0A -h / --help Display 'help' text\0A --about Display 'about' text\0A -d / --debug Set debug mode\0A\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void coda(void) {
  printf("/*\n");
  printf(" *  END OF FILE\n");
  printf(" */\n");
}


x86 assembly (clang, -O0):
<coda>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coda>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"/*\0A\00"
@.str.1 = [17 x i8] c" * END OF FILE\0A\00"
@.str.2 = [5 x i8] c" */\0A\00"
define void @coda() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"/*\00"
@str.3 = [16 x i8] c" * END OF FILE\00"
@str.4 = [4 x i8] c" */\00"
define void @coda() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ lock();
int main() {
  lock();
  f();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lock@plt>
mov    $0x0,%al
call   1040 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @lock()
%2 = call i32 (...) @f()
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmeanlipw(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmeanlipw(N, x, stride);
  printf("mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_dmeanlipw@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dmeanlipw@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmeanlipw(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmeanlipw(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
struct csa {
  int dummy;
};

/* Variables and functions */
double randy(struct csa *);
int uniform(struct csa *csa, double a[2]) {
  return (int)((a[1] - a[0]) * randy(csa) + a[0] + 0.5);
}


x86 assembly (clang, -O0):
<uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <randy@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  0x8(%rsi),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <randy@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rbx),%xmm0
addsd  0xec2(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.csa = type { i32 }
define i32 @uniform(%struct.csa* %0, double* %1) {
%3 = alloca %struct.csa*
%4 = alloca double*
store %struct.csa* %0, %struct.csa** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.csa*, %struct.csa** %3
%13 = call double @randy(%struct.csa* %12)
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = call double @llvm.fmuladd.f64(double %11, double %13, double %16)
%18 = fadd double %17, 5.000000e-01
%19 = fptosi double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.csa = type { i32 }
define i32 @uniform(%struct.csa* %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = load double, double* %1
%6 = fsub double %4, %5
%7 = tail call double @randy(%struct.csa* %0)
%8 = load double, double* %1
%9 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %8)
%10 = fadd double %9, 5.000000e-01
%11 = fptosi double %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int);
scalar_t__ ricevi_opzione(int, char *);
void program_exit(int id_connessione) {
  char risultato;
  if (ricevi_opzione(id_connessione, &risultato))
    fatal_error(id_connessione);
}


x86 assembly (clang, -O0):
<program_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
call   1030 <ricevi_opzione@plt>
cmp    $0x0,%rax
je     1149 <program_exit+0x29>
mov    -0x4(%rbp),%edi
call   1040 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_exit>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
call   1030 <ricevi_opzione@plt>
test   %rax,%rax
je     113d <program_exit+0x1d>
mov    %ebx,%edi
call   1040 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @program_exit(i32 %0) {
%2 = alloca i8
%3 = call i64 @ricevi_opzione(i32 %0, i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @fatal_error(i32 %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear32(int, int);
int /*<<< orphan*/ set32(int, int);
int /*<<< orphan*/ udelay(int);
void powerpc_hang(void) {
  clear32((0xd800000 + 0x194), 0x30);
  udelay(100);
  set32((0xd800000 + 0x194), 0x20);
  udelay(100);
}


x86 assembly (clang, -O0):
<powerpc_hang>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1050 <clear32@plt>
mov    $0x64,%edi
call   1040 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1030 <set32@plt>
mov    $0x64,%edi
call   1040 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerpc_hang>:
push   %rax
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1050 <clear32@plt>
mov    $0x64,%edi
call   1040 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1030 <set32@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <udelay@plt>

LLVM IR (-O0):
define void @powerpc_hang() {
%1 = call i32 @clear32(i32 226492820, i32 48)
%2 = call i32 @udelay(i32 100)
%3 = call i32 @set32(i32 226492820, i32 32)
%4 = call i32 @udelay(i32 100)
ret void
}

LLVM IR (-O2):
define void @powerpc_hang() {
%1 = tail call i32 @clear32(i32 226492820, i32 48)
%2 = tail call i32 @udelay(i32 100)
%3 = tail call i32 @set32(i32 226492820, i32 32)
%4 = tail call i32 @udelay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x59() {
  Assert_real((isupper(89)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              450, ("isupper should be 1 for Y"));
}


x86 assembly (clang, -O0):
<t_isupper_0x59>:
push   %rbp
mov    %rsp,%rbp
mov    $0x59,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1c2,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x59>:
push   %rax
mov    $0x59,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1c2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for Y\00"
define void @t_isupper_0x59() {
%1 = call i32 @isupper(i32 89)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for Y\00"
define void @t_isupper_0x59() {
%1 = tail call i32 @isupper(i32 89)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t is_double_delim_escaped(const char *cur, const char *end) {
  return ((cur + 1) < end) && *(cur + 1) == *cur;
}


x86 assembly (clang, -O0):
<is_double_delim_escaped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jae    113a <is_double_delim_escaped+0x3a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_double_delim_escaped>:
lea    0x1(%rdi),%rax
cmp    %rsi,%rax
jae    1114 <is_double_delim_escaped+0x14>
mov    0x1(%rdi),%cl
xor    %eax,%eax
cmp    (%rdi),%cl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @is_double_delim_escaped(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 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8*, i8** %4
%8 = icmp ult i8* %6, %7
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
%21 = sext i32 %20 to i64
ret i64 %21
}

LLVM IR (-O2):
define i64 @is_double_delim_escaped(i8* %0, i8* readnone %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = icmp ult i8* %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i8, i8* %3
%7 = load i8, i8* %0
%8 = icmp eq i8 %6, %7
%9 = zext i1 %8 to i64
br label %10
10: ; preds = %5, %2
%11 = phi i64 [ 0, %2 ], [ %9, %5 ]
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_unlock(int /*<<< orphan*/ *);
void unlock_or_die(pthread_mutex_t *mtx) {
  if (pthread_mutex_unlock(mtx)) {
    perror("Couldn't unlock held mutex.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<unlock_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
cmp    $0x0,%rax
je     1169 <unlock_or_die+0x39>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock_or_die>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %rax,%rax
jne    113d <unlock_or_die+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Couldn't unlock held mutex.\0A\00"
@EXIT_FAILURE = global i32 0
define void @unlock_or_die(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_unlock(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Couldn't unlock held mutex.\0A\00"
@EXIT_FAILURE = global i32 0
define void @unlock_or_die(i32* %0) {
%2 = tail call i64 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vanleer_ppa_a(double *);
int /*<<< orphan*/ vanleer_ppa_b(double, double *, double *, double *);
void vanleer_ppa(double dt, double *q, double *qs, double *vxt) {
  vanleer_ppa_a(q);
  vanleer_ppa_b(dt, q, qs, vxt);
  return;
}


x86 assembly (clang, -O0):
<vanleer_ppa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <vanleer_ppa_a@plt>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <vanleer_ppa_b@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vanleer_ppa>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1040 <vanleer_ppa_a@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <vanleer_ppa_b@plt>

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

LLVM IR (-O2):
define void @vanleer_ppa(double %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @vanleer_ppa_a(double* %1)
%6 = tail call i32 @vanleer_ppa_b(double %0, double* %1, double* %2, double* %3)
ret void
}
double decode_heading(unsigned char h) { return ((double)h * 360.0 / 255.0); }


x86 assembly (clang, -O0):
<decode_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_heading>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @decode_heading(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = uitofp i8 %3 to double
%5 = fmul double %4, 3.600000e+02
%6 = fdiv double %5, 2.550000e+02
ret double %6
}

LLVM IR (-O2):
define double @decode_heading(i8 zeroext %0) {
%2 = uitofp i8 %0 to double
%3 = fmul double %2, 3.600000e+02
%4 = fdiv double %3, 2.550000e+02
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ engine_get_color(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int);
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, char, char, char, char, char,
                           char, char, char);
void window_normal_borders(WINDOW *win) {
  wattrset(win, engine_get_color(COLOR_BLACK, COLOR_BLACK, true));
  wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
}


x86 assembly (clang, -O0):
<window_normal_borders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1050 <engine_get_color@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7c,%edx
mov    $0x2d,%r8d
mov    $0x2b,%r9d
mov    %edx,%esi
mov    %r8d,%ecx
movl   $0x2b,(%rsp)
movl   $0x2b,0x8(%rsp)
movl   $0x2b,0x10(%rsp)
call   1040 <wborder@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_normal_borders>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    %edi,%esi
mov    $0x1,%edx
call   1050 <engine_get_color@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <wattrset@plt>
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    $0x7c,%esi
mov    $0x7c,%edx
mov    $0x2d,%ecx
mov    $0x2d,%r8d
mov    $0x2b,%r9d
push   $0x2b
push   $0x2b
push   $0x2b
call   1040 <wborder@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@COLOR_BLACK = global i32 0
define void @window_normal_borders(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @COLOR_BLACK
%5 = load i32, i32* @COLOR_BLACK
%6 = call i32 @engine_get_color(i32 %4, i32 %5, i32 1)
%7 = call i32 @wattrset(i32* %3, i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 @wborder(i32* %8, i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
ret void
}

LLVM IR (-O2):
@COLOR_BLACK = global i32 0
define void @window_normal_borders(i32* %0) {
%2 = load i32, i32* @COLOR_BLACK
%3 = tail call i32 @engine_get_color(i32 %2, i32 %2, i32 1)
%4 = tail call i32 @wattrset(i32* %0, i32 %3)
%5 = tail call i32 @wborder(i32* %0, i8 signext 124, i8 signext 124, i8 signext 45, i8 signext 45, i8 signext 43, i8 signext 43, i8 signext 43, i8 signext 43)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getshstr(int *, int *, char **, size_t *, int /*<<< orphan*/ *, int, int,
             int, int /*<<< orphan*/);
int getshdelim(char **lineptr, size_t *n, int delimiter, int delimiter_quote,
               int commentor, FILE *stream) {
  int firstline, lastline;
  return getshstr(&firstline, &lastline, lineptr, n, stream, delimiter,
                  delimiter_quote, commentor, 0);
}


x86 assembly (clang, -O0):
<getshdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x1c(%rbp),%eax
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %r11d,%r11d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <getshstr@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshdelim>:
push   %rax
mov    %r8d,%r11d
mov    %ecx,%r10d
mov    %edx,%eax
mov    %rsi,%rcx
mov    %rdi,%rdx
sub    $0x8,%rsp
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %r9,%r8
mov    %eax,%r9d
push   $0x0
push   %r11
push   %r10
call   1030 <getshstr@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getshdelim(i8** %0, i64* %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = bitcast i32* %8 to i8*
%11 = call i32 @getshstr(i32* %7, i32* %8, i8** %0, i64* %1, i32* %5, i32 %2, i32 %3, i32 %4, i32 0)
ret i32 %11
}
/* Variables and functions */
scalar_t__ simple_fabs(float const);
float simple_floor(scalar_t__);
float simple_rint(const float x) {
  float t = simple_floor(simple_fabs(x) + 0.5);
  return (x < 0.0) ? -t : t;
}


x86 assembly (clang, -O0):
<simple_rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <simple_fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <simple_floor@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1189 <simple_rint+0x69>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1193 <simple_rint+0x73>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_rint>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
call   1030 <simple_fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xec3(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <simple_floor@plt>
movapd 0xec1(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps (%rsp),%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @simple_rint(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i64 @simple_fabs(float %4)
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = call float @simple_floor(i64 %8)
store float %9, float* %3
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load float, float* %3
%15 = fneg float %14
br label %18
16: ; preds = %1
%17 = load float, float* %3
br label %18
18: ; preds = %16, %13
%19 = phi float [ %15, %13 ], [ %17, %16 ]
ret float %19
}

LLVM IR (-O2):
define float @simple_rint(float %0) {
%2 = tail call i64 @simple_fabs(float %0)
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i64
%6 = tail call float @simple_floor(i64 %5)
%7 = fcmp olt float %0, 0.000000e+00
%8 = fneg float %6
%9 = select i1 %7, float %8, float %6
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char *);
int /*<<< orphan*/ makeTone(int);
int /*<<< orphan*/ testAmplitudePct();
scalar_t__ testFrequency();
int main(int argc, char **argv) {
  if (testFrequency() > 0)
    Fail("testFrequency");
  makeTone(440);
  testAmplitudePct();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <testFrequency@plt>
cmp    $0x0,%rax
jle    1173 <main+0x33>
lea    0xe92(%rip),%rdi
call   1060 <Fail@plt>
mov    $0x1b8,%edi
call   1040 <makeTone@plt>
mov    $0x0,%al
call   1050 <testAmplitudePct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testFrequency@plt>
test   %rax,%rax
jle    1159 <main+0x19>
lea    0xeac(%rip),%rdi
call   1060 <Fail@plt>
mov    $0x1b8,%edi
call   1040 <makeTone@plt>
xor    %eax,%eax
call   1050 <testAmplitudePct@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"testFrequency\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @testFrequency()
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @Fail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = call i32 @makeTone(i32 440)
%12 = call i32 (...) @testAmplitudePct()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"testFrequency\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @testFrequency()
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Fail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @makeTone(i32 440)
%9 = tail call i32 (...) @testAmplitudePct()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int get_file_size(int fd) {
  struct stat buf;
  fstat(fd, &buf);
  return buf.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <fstat@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
void setup_io() {
  int i;
  for (i = 0; i < 256; i++) {
    close(i);
  }
  open("/dev/console", 0);
  open("/dev/console", 0);
  open("/dev/console", 0);
}


x86 assembly (clang, -O0):
<setup_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1152 <setup_io+0x32>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <setup_io+0xf>
lea    0xea7(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
lea    0xe99(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
lea    0xe8b(%rip),%rdi
xor    %esi,%esi
call   1040 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_io>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <close@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <setup_io+0x10>
lea    0xeb7(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <open@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <open@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/console\00"
define void @setup_io() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%13 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%14 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/console\00"
define void @setup_io() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @close(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%9 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
scalar_t__ malloc(int);
void get_mem() {
  char *ptr;
  ptr = (char *)malloc(10);
  __ESBMC_assume(ptr);
}


x86 assembly (clang, -O0):
<get_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <__ESBMC_assume@plt>

LLVM IR (-O0):
define void @get_mem() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @__ESBMC_assume(i8* %4)
ret void
}

LLVM IR (-O2):
define void @get_mem() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @__ESBMC_assume(i8* %2)
ret void
}
void av_malloc_array() {}


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

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

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

LLVM IR (-O2):
define void @av_malloc_array() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg16(int, unsigned short);
void VIM_IPP_SetCaptureDropFrame(unsigned short wDropFrame) {
  VIM_HIF_SetReg16((0x1c00 + 0x058), wDropFrame);
}


x86 assembly (clang, -O0):
<VIM_IPP_SetCaptureDropFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1c58,%edi
movzwl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_SetCaptureDropFrame>:
mov    %edi,%esi
mov    $0x1c58,%edi
jmp    1030 <VIM_HIF_SetReg16@plt>

LLVM IR (-O0):
define void @VIM_IPP_SetCaptureDropFrame(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @VIM_HIF_SetReg16(i32 7256, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_SetCaptureDropFrame(i16 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg16(i32 7256, i16 zeroext %0)
ret void
}