xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int ret = 0;
  int i;
  printf("hello world\n");
  printf("(%d)\n", argc);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"(%d)\0A\00"
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret i32 0
}
void strtoupper(char *str) {
  for (char *c = str; *c; c++) {
    if (*c >= 'a' && *c <= 'z') {
      *c &= ~32;
    }
  }
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <strtoupper+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1149 <strtoupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1149 <strtoupper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %cl,(%rax)
jmp    114e <strtoupper+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strtoupper+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
mov    (%rdi),%al
test   %al,%al
je     112a <strtoupper+0x2a>
add    $0x1,%rdi
jmp    111b <strtoupper+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <strtoupper+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <strtoupper+0x10>
and    $0xdf,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strtoupper+0x10>
ret

LLVM IR (-O0):
define void @strtoupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = and i32 %22, -33
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @strtoupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %12, %1
ret void
5: ; preds = %1, %12
%6 = phi i8 [ %14, %12 ], [ %2, %1 ]
%7 = phi i8* [ %13, %12 ], [ %0, %1 ]
%8 = add i8 %6, -97
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = and i8 %6, -33
store i8 %11, i8* %7
br label %12
12: ; preds = %5, %10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %4, label %5
}
int rot_l_asm(int x, unsigned count) {
  asm("rol %%cl, %[x]" : [x] "+r"(x) : "c"(count) : "cc");
  return x;
}


x86 assembly (clang, -O0):
<rot_l_asm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
rol    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_l_asm>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rot_l_asm(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 asm "rol %cl, $0", "=r,{cx},0,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %5)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @rot_l_asm(i32 %0, i32 %1) {
%3 = tail call i32 asm "rol %cl, $0", "=r,{cx},0,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aes_free_context(void *handle) { free(handle); }


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

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

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

LLVM IR (-O2):
define void @aes_free_context(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(sizeof(int));
  int x;
  int i, y;
  i = y;
  if (i == 4711)
    p = &x;
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1267,-0x18(%rbp)
jne    1158 <main+0x38>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32, i32* %5
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 4711
br i1 %9, label %10, label %11
10: ; preds = %0
store i32* %3, i32** %2
br label %11
11: ; preds = %10, %0
%12 = load i32*, i32** %2
%13 = call i32 @free(i32* %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int mtwist_next(struct mtwist_state *);
char random_digit(struct mtwist_state *mt) {
  int x = mtwist_next(mt) % 10 + '0';
  return (char)x;
}


x86 assembly (clang, -O0):
<random_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mtwist_next@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_digit>:
push   %rax
call   1030 <mtwist_next@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define signext i8 @random_digit(%struct.mtwist_state* %0) {
%2 = alloca %struct.mtwist_state*
%3 = alloca i32
store %struct.mtwist_state* %0, %struct.mtwist_state** %2
%4 = load %struct.mtwist_state*, %struct.mtwist_state** %2
%5 = call i32 @mtwist_next(%struct.mtwist_state* %4)
%6 = srem i32 %5, 10
%7 = add nsw i32 %6, 48
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define signext i8 @random_digit(%struct.mtwist_state* %0) {
%2 = tail call i32 @mtwist_next(%struct.mtwist_state* %0)
%3 = srem i32 %2, 10
%4 = trunc i32 %3 to i8
%5 = add nsw i8 %4, 48
ret i8 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_rotate(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                float);
__attribute__((always_)) struct vec2i *
psvec2i_rotate(struct vec2i *result, struct vec2i *a, float angle) {
  vec2i_rotate((int32_t *)result, (int32_t *)a, angle);
  return result;
}


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

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

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

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_rotate(%struct.vec2i* returned %0, %struct.vec2i* %1, float %2) {
%4 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%6 = tail call i32 @vec2i_rotate(i32* %4, i32* %5, float %2)
ret %struct.vec2i* %0
}
/* Variables and functions */
int /*<<< orphan*/ glmCrossProduct2d(double *, double *);
int /*<<< orphan*/ glmMakeVector2d(double *, double const *, double const *);
int /*<<< orphan*/ glmNormalizeVector2d(double *);
void glmComputeLineNormald(double normal[2], const double c1[2],
                           const double c2[2]) {
  double v[2];
  glmMakeVector2d(v, c1, c2);
  glmCrossProduct2d(normal, v);
  glmNormalizeVector2d(normal);
}


x86 assembly (clang, -O0):
<glmComputeLineNormald>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <glmMakeVector2d@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <glmCrossProduct2d@plt>
mov    -0x8(%rbp),%rdi
call   1040 <glmNormalizeVector2d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeLineNormald>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <glmMakeVector2d@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <glmCrossProduct2d@plt>
mov    %rbx,%rdi
call   1040 <glmNormalizeVector2d@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmComputeLineNormald(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [2 x double]
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = call i32 @glmMakeVector2d(double* %8, double* %9, double* %10)
%12 = load double*, double** %4
%13 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%14 = call i32 @glmCrossProduct2d(double* %12, double* %13)
%15 = load double*, double** %4
%16 = call i32 @glmNormalizeVector2d(double* %15)
ret void
}

LLVM IR (-O2):
define void @glmComputeLineNormald(double* %0, double* %1, double* %2) {
%4 = alloca [2 x double]
%5 = bitcast [2 x double]* %4 to i8*
%6 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%7 = call i32 @glmMakeVector2d(double* %6, double* %1, double* %2)
%8 = call i32 @glmCrossProduct2d(double* %0, double* %6)
%9 = call i32 @glmNormalizeVector2d(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
unsigned long long foo();
int main(void) {
  if (foo() != 1ULL << 63)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
movabs $0x8000000000000000,%rcx
cmp    %rcx,%rax
je     1160 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
movabs $0x8000000000000000,%rcx
cmp    %rcx,%rax
jne    114e <main+0x1e>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, -9223372036854775808
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, -9223372036854775808
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int func2(int x) {
#pragma critTer : 11 :../ test / resources / functionCommentReturn.c:
  return 0;
#pragma critTer : 12 :../ test / resources / functionCommentReturn.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func2(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char const *);
void str_ok(const char *got, const char *expected) {
  if (strcmp(got, expected) == 0)
    return;
  fprintf(stderr, "Got '%s', expected '%s'\n", got, expected);
  exit(1);
}


x86 assembly (clang, -O0):
<str_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115d <str_ok+0x2d>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<str_ok>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
jne    114c <str_ok+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Got '%s', expected '%s'\0A\00"
define void @str_ok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
ret void
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Got '%s', expected '%s'\0A\00"
define void @str_ok(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
ret void
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((weak)) __attribute__((visibility("hidden"))) void
_compilerrt_abort_impl(const char *file, int line, const char *func) {}


x86 assembly (clang, -O0):
<_compilerrt_abort_impl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define weak hidden void @_compilerrt_abort_impl(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define weak hidden void @_compilerrt_abort_impl(i8* %0, i32 %1, i8* %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct buffer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ game_process_stream(int /*<<< orphan*/, int /*<<< orphan*/,
                                       struct buffer_t *);
void game_process_stream_timed(uint32_t conn, uint32_t index, uint64_t *stamp,
                               struct buffer_t *stream) {
  game_process_stream(conn, index, stream);
}


x86 assembly (clang, -O0):
<game_process_stream_timed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <game_process_stream@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_process_stream_timed>:
mov    %rcx,%rdx
jmp    1030 <game_process_stream@plt>

LLVM IR (-O0):
%struct.buffer_t = type { i32 }
define void @game_process_stream_timed(i32 %0, i32 %1, i32* %2, %struct.buffer_t* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.buffer_t*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store %struct.buffer_t* %3, %struct.buffer_t** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load %struct.buffer_t*, %struct.buffer_t** %8
%12 = call i32 @game_process_stream(i32 %9, i32 %10, %struct.buffer_t* %11)
ret void
}

LLVM IR (-O2):
%struct.buffer_t = type { i32 }
define void @game_process_stream_timed(i32 %0, i32 %1, i32* nocapture readnone %2, %struct.buffer_t* %3) {
%5 = tail call i32 @game_process_stream(i32 %0, i32 %1, %struct.buffer_t* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int nullinteract(int what, FILE *controltty, char *string) { return 0; }


x86 assembly (clang, -O0):
<nullinteract>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @nullinteract(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
const char *ltr_int_slave_fifo_name() {
  static const char slave_fifo[] = "/tmp/ltr_sfifi%02d";
  return slave_fifo;
}


x86 assembly (clang, -O0):
<ltr_int_slave_fifo_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltr_int_slave_fifo_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@ltr_int_slave_fifo_name.slave_fifo = internal constant [19 x i8] c"/tmp/ltr_sfifi%02d\00"
define i8* @ltr_int_slave_fifo_name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @ltr_int_slave_fifo_name.slave_fifo, i64 0, i64 0)
}

LLVM IR (-O2):
@ltr_int_slave_fifo_name.slave_fifo = internal constant [19 x i8] c"/tmp/ltr_sfifi%02d\00"
define i8* @ltr_int_slave_fifo_name() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @ltr_int_slave_fifo_name.slave_fifo, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dbg_set_chain(int /*<<< orphan*/);
int /*<<< orphan*/ get_byte_from_vpi(int /*<<< orphan*/ *);
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ send_address_to_vpi(int);
int /*<<< orphan*/ send_command_to_vpi(int);
int dbg_wb_read8(uint32_t adr, uint8_t *data) {
  if (0)
    printf("dbg_wb_read8: adr 0x%.8x \n", adr);
  dbg_set_chain(0);
  send_command_to_vpi(0xe);
  send_address_to_vpi(adr);
  get_byte_from_vpi(data);
  get_response_from_vpi();
  return 0;
}


x86 assembly (clang, -O0):
<dbg_wb_read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <dbg_set_chain@plt>
mov    $0xe,%edi
call   1030 <send_command_to_vpi@plt>
mov    -0x4(%rbp),%edi
call   1040 <send_address_to_vpi@plt>
mov    -0x10(%rbp),%rdi
call   1070 <get_byte_from_vpi@plt>
mov    $0x0,%al
call   1060 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_wb_read8>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <dbg_set_chain@plt>
mov    $0xe,%edi
call   1030 <send_command_to_vpi@plt>
mov    %ebp,%edi
call   1040 <send_address_to_vpi@plt>
mov    %rbx,%rdi
call   1070 <get_byte_from_vpi@plt>
xor    %eax,%eax
call   1060 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dbg_wb_read8(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @dbg_set_chain(i32 0)
%6 = call i32 @send_command_to_vpi(i32 14)
%7 = load i32, i32* %3
%8 = call i32 @send_address_to_vpi(i32 %7)
%9 = load i32*, i32** %4
%10 = call i32 @get_byte_from_vpi(i32* %9)
%11 = call i32 (...) @get_response_from_vpi()
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_wb_read8(i32 %0, i32* %1) {
%3 = tail call i32 @dbg_set_chain(i32 0)
%4 = tail call i32 @send_command_to_vpi(i32 14)
%5 = tail call i32 @send_address_to_vpi(i32 %0)
%6 = tail call i32 @get_byte_from_vpi(i32* %1)
%7 = tail call i32 (...) @get_response_from_vpi()
ret i32 0
}
/* Variables and functions */
int tokenizer_finished();
int vvtbi_finished(void) { return tokenizer_finished(); }


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

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

LLVM IR (-O0):
define i32 @vvtbi_finished() {
%1 = call i32 (...) @tokenizer_finished()
ret i32 %1
}

LLVM IR (-O2):
define i32 @vvtbi_finished() {
%1 = tail call i32 (...) @tokenizer_finished()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(intptr_t, void *, size_t);
ssize_t vmir_sysio_read(void *opaque, intptr_t fh, void *buf, size_t count) {
  return read(fh, buf, count);
}


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

x86 assembly (clang, -O2):
<vmir_sysio_read>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @vmir_sysio_read(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = call i32 @read(i64 %9, i8* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @vmir_sysio_read(i8* nocapture readnone %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i32 @read(i64 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "This program requires the new tesselator API in GLU 1.2.\n");
  fprintf(stderr,
          "Your GLU library does not support this new interface, sorry.\n");
  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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"This program requires the new tesselator API in GLU 1.2.\0A\00"
@.str.1 = [62 x i8] c"Your GLU library does not support this new interface, sorry.\0A\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 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"This program requires the new tesselator API in GLU 1.2.\0A\00"
@.str.1 = [62 x i8] c"Your GLU library does not support this new interface, sorry.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_4Eint16_reg(short val) {
  return ((val) & (0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x4e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Eint16_reg>:
test   $0x4e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 78
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_4Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 78
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int usage() {
  puts("this is the event handler for wpa_cli");
  puts("usage:");
  puts("samen-handler <interface> (CONNECTED|DISCONNECTED)");
  return -1;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"this is the event handler for wpa_cli\00"
@.str.1 = [7 x i8] c"usage:\00"
@.str.2 = [51 x i8] c"samen-handler <interface> (CONNECTED|DISCONNECTED)\00"
define i32 @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [38 x i8] c"this is the event handler for wpa_cli\00"
@.str.1 = [7 x i8] c"usage:\00"
@.str.2 = [51 x i8] c"samen-handler <interface> (CONNECTED|DISCONNECTED)\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int isinf(double);
int module_libc_isinf(double value) { return isinf(value); }


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

x86 assembly (clang, -O2):
<module_libc_isinf>:
jmp    1030 <isinf@plt>

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

LLVM IR (-O2):
define i32 @module_libc_isinf(double %0) {
%2 = tail call i32 @isinf(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double sign(double d) {
  assert(((d) == (d)));
  if (d < +0.0)
    return -1.0;
  else
    return 1.0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1159 <sign+0x49>
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <sign+0x56>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
push   %rbx
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
ucomisd %xmm0,%xmm1
seta   %bl
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
lea    0xecc(%rip),%rax
movsd  (%rax,%rbx,8),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* %3
%6 = fcmp oeq double %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load double, double* %3
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %1
store double -1.000000e+00, double* %2
br label %13
12: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
13: ; preds = %12, %11
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp ord double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = fcmp olt double %0, 0.000000e+00
%6 = select i1 %5, double -1.000000e+00, double 1.000000e+00
ret double %6
}
void g_option_group_free() {}


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

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

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

LLVM IR (-O2):
define void @g_option_group_free() {
ret void
}
int test2(int c, int d) { return (c ^ d) != 0; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test2(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 = xor i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int kernel_has_rtsig(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kernel_has_rtsig() {
ret i32 0
}
void log_init(void) {}


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

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

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

LLVM IR (-O2):
define void @log_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_string(char *);
frontend_version() { output_string("\tFront End (2.7,84/11/28)"); }


x86 assembly (clang, -O0):
<frontend_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_string@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontend_version>:
lea    0xee9(%rip),%rdi
jmp    1030 <output_string@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\09Front End (2.7,84/11/28)\00"
define i32 @frontend_version() {
%1 = alloca i32
%2 = call i32 @output_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [26 x i8] c"\09Front End (2.7,84/11/28)\00"
define i32 @frontend_version() {
%1 = tail call i32 @output_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *getLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ parseLine(char *);
int parseConfigFile(FILE *file) {
  char *s;
  while ((s = getLine(file)) != NULL) {
    parseLine(s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parseConfigFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getLine@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <parseConfigFile+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <parseLine@plt>
jmp    112c <parseConfigFile+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigFile>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <getLine@plt>
test   %rax,%rax
je     1147 <parseConfigFile+0x27>
mov    %rax,%rdi
call   1040 <parseLine@plt>
mov    %rbx,%rdi
jmp    1130 <parseConfigFile+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parseConfigFile(i32* %0) {
%2 = tail call i8* @getLine(i32* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @parseLine(i8* %5)
%7 = tail call i8* @getLine(i32* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fftw_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @fftw_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ MultHi(int, int);
int VP8Clip8(scalar_t__);
int VP8YUVToG(int y, int u, int v) {
  return VP8Clip8(MultHi(y, 19077) - MultHi(u, 6419) - MultHi(v, 13320) + 8708);
}


x86 assembly (clang, -O0):
<VP8YUVToG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4a85,%esi
call   1030 <MultHi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1913,%esi
call   1030 <MultHi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x3408,%esi
call   1030 <MultHi@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
add    $0x2204,%rdi
call   1040 <VP8Clip8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP8YUVToG>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0x4a85,%esi
call   1030 <MultHi@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    $0x1913,%esi
call   1030 <MultHi@plt>
mov    %rax,%rbp
mov    %ebx,%edi
mov    $0x3408,%esi
call   1030 <MultHi@plt>
add    %rbp,%rax
neg    %rax
lea    (%r14,%rax,1),%rdi
add    $0x2204,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <VP8Clip8@plt>

LLVM IR (-O0):
define i32 @VP8YUVToG(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i64 @MultHi(i32 %7, i32 19077)
%9 = load i32, i32* %5
%10 = call i64 @MultHi(i32 %9, i32 6419)
%11 = sub nsw i64 %8, %10
%12 = load i32, i32* %6
%13 = call i64 @MultHi(i32 %12, i32 13320)
%14 = sub nsw i64 %11, %13
%15 = add nsw i64 %14, 8708
%16 = call i32 @VP8Clip8(i64 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @VP8YUVToG(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @MultHi(i32 %0, i32 19077)
%5 = tail call i64 @MultHi(i32 %1, i32 6419)
%6 = tail call i64 @MultHi(i32 %2, i32 13320)
%7 = add i64 %4, 8708
%8 = add i64 %5, %6
%9 = sub i64 %7, %8
%10 = tail call i32 @VP8Clip8(i64 %9)
ret i32 %10
}
int fitsheadsize(header)
char *header;
{
  char *endhead;
  int nbhead, nblocks;
  endhead = ksearch(header, "END") + 80;
  nbhead = endhead - header;
  nblocks = nbhead / 2880;
  if (nblocks * 2880 < nbhead)
    nblocks = nblocks + 1;
  return (nblocks * 2880);
}


x86 assembly (clang, -O0):
<fitsheadsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <ksearch@plt>
add    $0x50,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xb40,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
imul   $0xb40,-0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116c <fitsheadsize+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
imul   $0xb40,-0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsheadsize>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <ksearch@plt>
sub    %ebx,%eax
mov    %eax,%ecx
add    $0x50,%ecx
movslq %ecx,%rcx
imul   $0xffffffffb60b60b7,%rcx,%rdx
shr    $0x20,%rdx
add    %edx,%eax
add    $0x50,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0xb,%eax
add    %edx,%eax
imul   $0xb40,%eax,%edx
xor    %esi,%esi
cmp    %ecx,%edx
setl   %sil
add    %eax,%esi
imul   $0xb40,%esi,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"END\00"
define i32 @fitsheadsize(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ksearch to i32 (i8*, i8*, ...)*)(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = add nsw i32 %7, 80
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 2880
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, 2880
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %1
%27 = load i32, i32* %5
%28 = mul nsw i32 %27, 2880
ret i32 %28
}

LLVM IR (-O2):
@.str = [4 x i8] c"END\00"
define i32 @fitsheadsize(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ksearch to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = sub i32 80, %4
%6 = add i32 %5, %2
%7 = sdiv i32 %6, 2880
%8 = mul nsw i32 %7, 2880
%9 = icmp slt i32 %8, %6
%10 = zext i1 %9 to i32
%11 = add nsw i32 %7, %10
%12 = mul nsw i32 %11, 2880
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ an_array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int an_array[] = {1, 2, 9, 4, 8, 5, 6, 3, 8, 1};
  int i;
  int array_length = sizeof(an_array) / sizeof(int);
  int int_length = sizeof(int);
  printf("sizeof(int): %d\n", int_length);
  printf("array_length: %d\n", array_length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x38(%rbp)
movl   $0x4,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.an_array = [10 x i32] [i32 1, i32 2, i32 9, i32 4, i32 8, i32 5, i32 6, i32 3, i32 8, i32 1]
@.str = [17 x i8] c"sizeof(int): %d\0A\00"
@.str.1 = [18 x i8] c"array_length: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %4
store i32 4, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"sizeof(int): %d\0A\00"
@.str.1 = [18 x i8] c"array_length: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ XF_ViewQuit();
void onButtonOK(void *arg) { XF_ViewQuit(); }


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

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

LLVM IR (-O0):
define void @onButtonOK(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @XF_ViewQuit()
ret void
}

LLVM IR (-O2):
define void @onButtonOK(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @XF_ViewQuit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __arch_atomic_dec(long *);
void atomic_dec(long int *p) { __arch_atomic_dec(p); }


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

x86 assembly (clang, -O2):
<atomic_dec>:
jmp    1030 <__arch_atomic_dec@plt>

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

LLVM IR (-O2):
define void @atomic_dec(i64* %0) {
%2 = tail call i32 @__arch_atomic_dec(i64* %0)
ret void
}
/* Type definitions */
struct gsm_modul {
  int dummy;
};

/* Variables and functions */
int module_send_text(struct gsm_modul *, char *, char *);
int __gsm_send_text(struct gsm_modul *gsm, char *destination, char *message) {
  return module_send_text(gsm, destination, message);
}


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

x86 assembly (clang, -O2):
<__gsm_send_text>:
jmp    1030 <module_send_text@plt>

LLVM IR (-O0):
%struct.gsm_modul = type { i32 }
define i32 @__gsm_send_text(%struct.gsm_modul* %0, i8* %1, i8* %2) {
%4 = alloca %struct.gsm_modul*
%5 = alloca i8*
%6 = alloca i8*
store %struct.gsm_modul* %0, %struct.gsm_modul** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.gsm_modul*, %struct.gsm_modul** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @module_send_text(%struct.gsm_modul* %7, i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.gsm_modul = type { i32 }
define i32 @__gsm_send_text(%struct.gsm_modul* %0, i8* %1, i8* %2) {
%4 = tail call i32 @module_send_text(%struct.gsm_modul* %0, i8* %1, i8* %2)
ret i32 %4
}
int le(double a, double b) { return a <= b; }


x86 assembly (clang, -O0):
<le>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @le(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @le(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double GAUnitGaussian();
double GAGaussianDouble(double dev) { return GAUnitGaussian() * dev; }


x86 assembly (clang, -O0):
<GAGaussianDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <GAUnitGaussian@plt>
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GAGaussianDouble>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <GAUnitGaussian@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @GAGaussianDouble(double %0) {
%2 = tail call double (...) @GAUnitGaussian()
%3 = fmul double %2, %0
ret double %3
}