xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, unsigned int const);
int /*<<< orphan*/ stdout;
void board(const char *string, const unsigned int number) {
  printf("%s \t %d on board\n", string, number);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s \09 %d on board\0A\00"
@stdout = global i32 0
define void @board(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s \09 %d on board\0A\00"
@stdout = global i32 0
define void @board(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void CRYPTO_get_mem_ex_functions(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_get_mem_ex_functions() {
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_cross(float *, float *, float *);
__attribute__((always_)) struct vec3 *
psvec3_cross(struct vec3 *result, struct vec3 *a, struct vec3 *b) {
  vec3_cross((float *)result, (float *)a, (float *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec3_cross>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <vec3_cross@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3_cross>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_cross@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_cross(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = alloca %struct.vec3*
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %4
store %struct.vec3* %1, %struct.vec3** %5
store %struct.vec3* %2, %struct.vec3** %6
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = call i32 @vec3_cross(float* %8, float* %10, float* %12)
%14 = load %struct.vec3*, %struct.vec3** %4
ret %struct.vec3* %14
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_cross(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = bitcast %struct.vec3* %2 to float*
%7 = tail call i32 @vec3_cross(float* %4, float* %5, float* %6)
ret %struct.vec3* %0
}
unsigned char solve_to_char(int i) { return (unsigned char)i; }


x86 assembly (clang, -O0):
<solve_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_to_char>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @solve_to_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @solve_to_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ panic_blink(int);
void undefined(void) { panic_blink(500); }


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

x86 assembly (clang, -O2):
<undefined>:
mov    $0x1f4,%edi
jmp    1030 <panic_blink@plt>

LLVM IR (-O0):
define void @undefined() {
%1 = call i32 @panic_blink(i32 500)
ret void
}

LLVM IR (-O2):
define void @undefined() {
%1 = tail call i32 @panic_blink(i32 500)
ret void
}
void fn(int n) { _Generic(n, int : 0); }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fn(i32 %0) {
ret void
}
/* Type definitions */
struct reset_control {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int reset_control_assert(struct reset_control *rstc) {
  WARN_ON(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<reset_control_assert>:
push   %rax
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.reset_control = type { i32 }
define i32 @reset_control_assert(%struct.reset_control* %0) {
%2 = alloca %struct.reset_control*
store %struct.reset_control* %0, %struct.reset_control** %2
%3 = call i32 @WARN_ON(i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.reset_control = type { i32 }
define i32 @reset_control_assert(%struct.reset_control* nocapture readnone %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
unsigned int sax_hash(const char *key) {
  unsigned int h = 0;
  while (*key) {
    h ^= (h << 5) + (h >> 2) + (unsigned char)*key;
    ++key;
  }
  return h;
}


x86 assembly (clang, -O0):
<sax_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <sax_hash+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <sax_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sax_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <sax_hash+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
mov    %eax,%esi
shr    $0x2,%esi
add    %edx,%esi
movzbl %cl,%ecx
add    %esi,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sax_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sax_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 0, %1 ]
%7 = phi i8* [ %14, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 5
%9 = lshr i32 %6, 2
%10 = add i32 %8, %9
%11 = zext i8 %5 to i32
%12 = add i32 %10, %11
%13 = xor i32 %12, %6
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i32 [ 0, %1 ], [ %13, %4 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void reapchild() {
  signal(SIGCHLD, reapchild);
  wait(NULL);
}


x86 assembly (clang, -O0):
<reapchild>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rsi
call   1030 <signal@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reapchild>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rsi
call   1030 <signal@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
define void @reapchild() {
%1 = load i32, i32* @SIGCHLD
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @reapchild to void (...)*))
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define void @reapchild() {
%1 = load i32, i32* @SIGCHLD
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @reapchild to void (...)*))
%3 = tail call i32 @wait(i32* null)
ret void
}
void foo358() {}


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

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

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

LLVM IR (-O2):
define void @foo358() {
ret void
}
/* Variables and functions */
bool findIfBit(char *byte, int bit) { return (*byte & (1 << bit)); }


x86 assembly (clang, -O0):
<findIfBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findIfBit>:
mov    %esi,%ecx
movsbl (%rdi),%edx
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @findIfBit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = and i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @findIfBit(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = shl nuw i32 1, %1
%6 = and i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmpcasenosensitive_internal(char const *, char const *);
int unzStringFileNameCompare(const char *fileName1, const char *fileName2,
                             int iCaseSensitivity) {
  if (iCaseSensitivity == 0)
    iCaseSensitivity = 1;
  if (iCaseSensitivity == 1)
    return strcmp(fileName1, fileName2);
  return strcmpcasenosensitive_internal(fileName1, fileName2);
}


x86 assembly (clang, -O0):
<unzStringFileNameCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1144 <unzStringFileNameCompare+0x24>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1163 <unzStringFileNameCompare+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <unzStringFileNameCompare+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmpcasenosensitive_internal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unzStringFileNameCompare>:
cmp    $0x1,%edx
ja     112a <unzStringFileNameCompare+0xa>
jmp    1040 <strcmp@plt>
jmp    1030 <strcmpcasenosensitive_internal@plt>

LLVM IR (-O0):
define i32 @unzStringFileNameCompare(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %7
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @strcmp(i8* %15, i8* %16)
store i32 %17, i32* %4
br label %22
18: ; preds = %11
%19 = load i8*, i8** %5
%20 = load i8*, i8** %6
%21 = call i32 @strcmpcasenosensitive_internal(i8* %19, i8* %20)
store i32 %21, i32* %4
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @unzStringFileNameCompare(i8* %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @strcmpcasenosensitive_internal(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void gtk_paint_shadow() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_shadow() {
ret void
}
double sqr(x)
double x;
{ return x * x; }


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
void spy_mach_write_to_2(unsigned char *b, uint16_t data) {
  assert(b);
  b[0] = (unsigned char)(data >> 8);
  b[1] = (unsigned char)(data);
}


x86 assembly (clang, -O0):
<spy_mach_write_to_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spy_mach_write_to_2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <assert@plt>
rol    $0x8,%bx
mov    %bx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @spy_mach_write_to_2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @spy_mach_write_to_2(i8* %0, i32 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
ret void
}
void f2(void) {
  int x, y;
#pragma unused(x, )
#pragma unused()
}


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

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = alloca i32
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core_main();
int main() {
  core_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @core_main()
ret i32 0
}
/* Variables and functions */
size_t strnlen(char const *, size_t);
size_t safe_strnlen(const char *s, size_t n) {
  if (s) {
    return strnlen(s, n);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<safe_strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <safe_strnlen+0x31>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x8(%rbp)
jmp    1149 <safe_strnlen+0x39>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strnlen>:
test   %rdi,%rdi
je     111a <safe_strnlen+0xa>
jmp    1030 <strnlen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @safe_strnlen(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @strnlen(i8* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ 0, %2 ]
ret i64 %7
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, unsigned int);
int shim_pkey_set(int pkey, unsigned int rights) {
  return shim_enosys(0, pkey, rights);
}


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

x86 assembly (clang, -O2):
<shim_pkey_set>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_pkey_set(i32 %0, i32 %1) {
%3 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int);
char *dispRuntime(unsigned rt) {
  static char *fmtbuf;
  fmtbuf = malloc(32 * sizeof(char));
  snprintf(fmtbuf, 32, "%u.%03.3u", rt / 1000, rt % 1000);
  return (fmtbuf);
}


x86 assembly (clang, -O0):
<dispRuntime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,0x2efc(%rip)
mov    0x2ef5(%rip),%rdi
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x3e8,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%r8d
mov    $0x20,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
mov    0x2ec0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispRuntime>:
push   %rbx
mov    %edi,%ebx
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,0x2f04(%rip)
mov    %ebx,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%edx
sub    %edx,%ebx
lea    0xeb0(%rip),%rdx
mov    %rax,%rdi
mov    $0x20,%esi
mov    %ebx,%r8d
call   1030 <snprintf@plt>
mov    0x2ed1(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@dispRuntime.fmtbuf = internal global i8* null
@.str = [10 x i8] c"%u.%03.3u\00"
define i8* @dispRuntime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @malloc(i32 32)
store i8* %3, i8** @dispRuntime.fmtbuf
%4 = load i8*, i8** @dispRuntime.fmtbuf
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = load i8*, i8** @dispRuntime.fmtbuf
ret i8* %10
}

LLVM IR (-O2):
@dispRuntime.fmtbuf = internal unnamed_addr global i8* null
@.str = [10 x i8] c"%u.%03.3u\00"
define i8* @dispRuntime(i32 %0) {
%2 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
store i8* %2, i8** @dispRuntime.fmtbuf
%3 = udiv i32 %0, 1000
%4 = urem i32 %0, 1000
%5 = tail call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i8*, i8** @dispRuntime.fmtbuf
ret i8* %6
}
unsigned xrop3_154_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_154_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_154_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_154_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_154_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = xor i32 %8, 255
ret i32 %9
}
void struct_align_2_x(void) {}


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

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

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

LLVM IR (-O2):
define void @struct_align_2_x() {
ret void
}
void varargsfn(int lastarg, ...) {
  __builtin_va_list ap;
  __builtin_va_start(ap, lastarg);
  __builtin_va_end(ap);
}


x86 assembly (clang, -O0):
<varargsfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
test   %al,%al
je     1136 <varargsfn+0x36>
movaps %xmm0,-0xa0(%rbp)
movaps %xmm1,-0x90(%rbp)
movaps %xmm2,-0x80(%rbp)
movaps %xmm3,-0x70(%rbp)
movaps %xmm4,-0x60(%rbp)
movaps %xmm5,-0x50(%rbp)
movaps %xmm6,-0x40(%rbp)
movaps %xmm7,-0x30(%rbp)
mov    %r9,-0xa8(%rbp)
mov    %r8,-0xb0(%rbp)
mov    %rcx,-0xb8(%rbp)
mov    %rdx,-0xc0(%rbp)
mov    %rsi,-0xc8(%rbp)
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @varargsfn(i32 %0, ...) {
%2 = alloca i32
%3 = alloca [1 x %struct.__va_list_tag]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%5 = bitcast %struct.__va_list_tag* %4 to i8*
%6 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%7 = bitcast %struct.__va_list_tag* %6 to i8*
ret void
}

LLVM IR (-O2):
define void @varargsfn(i32 %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
void dds_advancef(uint32_t *phase_acc, int32_t phase_rate) {
  *phase_acc += phase_rate;
}


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

x86 assembly (clang, -O2):
<dds_advancef>:
add    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @dds_advancef(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = trunc i64 %1 to i32
%5 = add i32 %3, %4
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ ENAMETOOLONG;
scalar_t__ errno;
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int gethostname(char *name, size_t len) {
  ;
  strncpy(name, "localhost", len);
  if (len <= strlen("localhost")) {
    errno = ENAMETOOLONG;
    return -1;
  }
  errno = 0;
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xead(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
ja     1188 <gethostname+0x68>
mov    0x2e69(%rip),%rax
mov    (%rax),%rcx
mov    0x2e67(%rip),%rax
mov    %rcx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <gethostname+0x7d>
mov    0x2e51(%rip),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
xor    %ecx,%ecx
cmp    $0xa,%rbx
jae    1135 <gethostname+0x25>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rcx
sbb    %eax,%eax
mov    0x2ea2(%rip),%rdx
mov    %rcx,(%rdx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"localhost\00"
@ENAMETOOLONG = global i64 0
@errno = global i64 0
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %5
%10 = call i64 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = icmp ule i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64, i64* @ENAMETOOLONG
store i64 %13, i64* @errno
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i64 0, i64* @errno
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"localhost\00"
@ENAMETOOLONG = global i64 0
@errno = global i64 0
define i32 @gethostname(i8* %0, i64 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %1)
%4 = icmp ult i64 %1, 10
%5 = load i64, i64* @ENAMETOOLONG
%6 = select i1 %4, i64 %5, i64 0
%7 = sext i1 %4 to i32
store i64 %6, i64* @errno
ret i32 %7
}
unsigned twoxbr_generic_output_fmts(unsigned input_fmts) { return input_fmts; }


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

x86 assembly (clang, -O2):
<twoxbr_generic_output_fmts>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @twoxbr_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
int hash(char v[], int m) {
  int i;
  unsigned int h = v[0];
  for (i = 1; v[i] != '\0'; i++)
    h = (h * 251 + v[i]) % m;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <hash+0x5c>
imul   $0xfb,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <hash+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movsbl (%rdi),%edx
mov    0x1(%rdi),%al
test   %al,%al
je     112a <hash+0x2a>
add    $0x2,%rdi
xchg   %ax,%ax
movsbl %al,%ecx
imul   $0xfb,%edx,%eax
add    %ecx,%eax
xor    %edx,%edx
div    %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %6
store i32 1, i32* %5
br label %11
11: ; preds = %31, %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %11
%20 = load i32, i32* %6
%21 = mul i32 %20, 251
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = add i32 %21, %27
%29 = load i32, i32* %4
%30 = urem i32 %28, %29
store i32 %30, i32* %6
br label %31
31: ; preds = %19
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %11
34: ; preds = %11
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %16, %8 ], [ 1, %2 ]
%10 = phi i8 [ %18, %8 ], [ %6, %2 ]
%11 = phi i32 [ %15, %8 ], [ %4, %2 ]
%12 = sext i8 %10 to i32
%13 = mul i32 %11, 251
%14 = add i32 %13, %12
%15 = urem i32 %14, %1
%16 = add nuw nsw i64 %9, 1
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %8
20: ; preds = %8, %2
%21 = phi i32 [ %4, %2 ], [ %15, %8 ]
ret i32 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_wcscpy(void) {
  wchar_t *str1;
  wchar_t *str2;
  (void)wcscpy(str1, str2);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcscpy>:
jmp    1030 <wcscpy@plt>

LLVM IR (-O0):
define void @uninitvar_wcscpy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcscpy(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcscpy() {
%1 = tail call i32 @wcscpy(i32* undef, i32* undef)
ret void
}
void g_queue_pop_nth() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_pop_nth() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ timeval;
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
int /*<<< orphan*/ memset(struct timeval *, int /*<<< orphan*/, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, struct timeval *,
               int);
int sock_set_recvtimeout(int sock, int seconds) {
  struct timeval timeval;
  memset(&timeval, 0, sizeof(timeval));
  timeval.tv_sec = seconds;
  return setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeval, sizeof(timeval));
}


x86 assembly (clang, -O0):
<sock_set_recvtimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_set_recvtimeout>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,0x8(%rsp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %r14,%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @sock_set_recvtimeout(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @memset(%struct.timeval* %5, i32 0, i32 4)
%7 = load i32, i32* %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = load i32, i32* @SOL_SOCKET
%11 = load i32, i32* @SO_RCVTIMEO
%12 = call i32 @setsockopt(i32 %9, i32 %10, i32 %11, %struct.timeval* %5, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @sock_set_recvtimeout(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @memset(%struct.timeval* %3, i32 0, i32 4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVTIMEO
%9 = call i32 @setsockopt(i32 %0, i32 %7, i32 %8, %struct.timeval* %3, i32 4)
ret i32 %9
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
char do_get_type(struct stat);
int do_type(char type, struct stat attr) {
  if (type == do_get_type(attr)) {
    return EXIT_SUCCESS;
  }
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<do_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <do_get_type@plt>
mov    %al,%cl
mov    -0x10(%rbp),%eax
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1151 <do_type+0x41>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <do_type+0x4d>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_type>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <do_get_type@plt>
cmp    %bl,%al
jne    1127 <do_type+0x17>
mov    0x2eb3(%rip),%rax
jmp    112e <do_type+0x1e>
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_type(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.stat
%5 = alloca i8
%6 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
store i32 %1, i32* %6
store i8 %0, i8* %5
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call signext i8 @do_get_type(i32 %10)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %8, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* @EXIT_SUCCESS
store i32 %15, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* @EXIT_FAILURE
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_type(i8 signext %0, i32 %1) {
%3 = tail call signext i8 @do_get_type(i32 %1)
%4 = icmp eq i8 %3, %0
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
char *getname();
int main() { char *n = getname(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getname@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @getname()
ret i32 0
}
void setstamp(f, date, time) char *f;
unsigned short date, time;
{}


x86 assembly (clang, -O0):
<setstamp>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%cx
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setstamp(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
%7 = trunc i32 %1 to i16
%8 = trunc i32 %2 to i16
store i8* %0, i8** %4
store i16 %7, i16* %5
store i16 %8, i16* %6
ret void
}

LLVM IR (-O2):
define void @setstamp(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putline(char *str, int dim) {
  int i;
  i = 0;
  while (i <= dim) {
    ft_putchar(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1151 <ft_putline+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putline+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putline>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1143 <ft_putline+0x33>
mov    %esi,%r15d
mov    %rdi,%r14
add    $0x1,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r14,%rbx,1),%edi
call   1030 <ft_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ft_putline+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_putline(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @ft_putchar(i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
busy() {
  FILE *pip, *popen();
  char c;
  int b, r;
  float a;
}


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

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

LLVM IR (-O0):
define i32 @busy() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @busy() {
ret i32 undef
}
main(argc, argv) int argc;
char **argv;
{
  foo(0, 0, 0, 0, 0, 0, 0, 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
call   1030 <foo@plt>
add    $0x10,%rsp
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
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 i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ OSDToggle(int /*<<< orphan*/);
void ToggleFPS() { OSDToggle(0); }


x86 assembly (clang, -O0):
<ToggleFPS>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <OSDToggle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToggleFPS>:
xor    %edi,%edi
jmp    1030 <OSDToggle@plt>

LLVM IR (-O0):
define void @ToggleFPS() {
%1 = call i32 @OSDToggle(i32 0)
ret void
}

LLVM IR (-O2):
define void @ToggleFPS() {
%1 = tail call i32 @OSDToggle(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DaoIGC_TryInvoke();
void DaoGC_TryInvoke() { DaoIGC_TryInvoke(); }


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

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

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

LLVM IR (-O2):
define void @DaoGC_TryInvoke() {
%1 = tail call i32 (...) @DaoIGC_TryInvoke()
ret void
}
/* Variables and functions */
int add_all_ints(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                 int *, int *, int *, int /*<<< orphan*/ *);
void valid_call(int *a, int *b, int *c) {
  int x = add_all_ints(0, 0, 0, a, b, c, NULL);
}


x86 assembly (clang, -O0):
<valid_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
xor    %edx,%edx
xor    %eax,%eax
mov    %edx,%edi
mov    %edx,%esi
movq   $0x0,(%rsp)
call   1030 <add_all_ints@plt>
mov    %eax,-0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_call>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
movq   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <add_all_ints@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @valid_call(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = call i32 @add_all_ints(i32 0, i32 0, i32 0, i32* %8, i32* %9, i32* %10, i32* null)
store i32 %11, i32* %7
ret void
}

LLVM IR (-O2):
define void @valid_call(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @add_all_ints(i32 0, i32 0, i32 0, i32* %0, i32* %1, i32* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void EssentialFunc14(char *Input) {
  char Buffer2S[1000];
  strcpy(Buffer2S, Input);
}


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

x86 assembly (clang, -O2):
<EssentialFunc14>:
sub    $0x3e8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
define void @EssentialFunc14(i8* %0) {
%2 = alloca i8*
%3 = alloca [1000 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @EssentialFunc14(i8* %0) {
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
double cos(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Coseno(double a) {
  printf("Enter a number: ");
  scanf("%lf", &a);
  return (cos(a));
}


x86 assembly (clang, -O0):
<Coseno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Coseno>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Coseno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @cos(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Coseno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @cos(double %5)
ret double %6
}