xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main() {
  const int a;
  int const a2;
  int *pi = (int *)&a;
  *pi = 19;
  printf("%d\n", a);
  pi = (int *)&a2;
  *pi = 20;
  printf("%d\n", a2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x13,(%rax)
mov    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x14,(%rax)
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 19)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t libenjoy_hash(char *str) {
  uint64_t h = 0;
  for (; *str; ++str) {
    if (*str != ' ')
      h = h << 1 ^ *str;
  }
  return h;
}


x86 assembly (clang, -O0):
<libenjoy_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <libenjoy_hash+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     113e <libenjoy_hash+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <libenjoy_hash+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <libenjoy_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libenjoy_hash>:
xor    %eax,%eax
jmp    1114 <libenjoy_hash+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rdi
movsbl (%rdi),%ecx
cmp    $0x20,%ecx
je     1110 <libenjoy_hash+0x10>
test   %cl,%cl
je     1126 <libenjoy_hash+0x26>
add    %eax,%eax
xor    %ecx,%eax
jmp    1110 <libenjoy_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @libenjoy_hash(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %12, %10 ]
%4 = phi i32 [ 0, %1 ], [ %11, %10 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %13
i8 32, label %10
]
6: ; preds = %2
%7 = sext i8 %5 to i32
%8 = shl i32 %4, 1
%9 = xor i32 %8, %7
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ %4, %2 ]
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
13: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(void) {
  int global = 6;
  printf("global (foo) = %i\n", global);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"global (foo) = %i\0A\00"
define void @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigwaitinfo(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void test(void) {
  sigset_t set;
  siginfo_t info;
  int result;
  (void)sigemptyset(&set);
  result = sigwaitinfo(&set, &info);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <sigwaitinfo@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <sigwaitinfo@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @sigemptyset(i32* %1)
%5 = call i32 @sigwaitinfo(i32* %1, i32* %2)
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigemptyset(i32* %1)
%6 = call i32 @sigwaitinfo(i32* %1, i32* %2)
ret void
}
int to_unicode(const short int *charset, int c) { return charset[c]; }


x86 assembly (clang, -O0):
<to_unicode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_unicode>:
movslq %esi,%rax
movswl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @to_unicode(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @to_unicode(i16* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
extern void matcpy(double *A, const double *B, int n, int m) {
  memcpy(A, B, sizeof(double) * n * m);
}


x86 assembly (clang, -O0):
<matcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
movslq -0x18(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matcpy>:
imul   %ecx,%edx
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matcpy(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = mul i64 8, %12
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = mul i64 %13, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memcpy(double* %9, double* %10, i32 %17)
ret void
}

LLVM IR (-O2):
define void @matcpy(double* %0, double* %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 3
%6 = mul i32 %5, %3
%7 = tail call i32 @memcpy(double* %0, double* %1, i32 %6)
ret void
}
void rvec_zero(register float *arg1, register int n) {
  while (n--) {
    *arg1++ = 0.0;
  }
}


x86 assembly (clang, -O0):
<rvec_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113a <rvec_zero+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    110b <rvec_zero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rvec_zero>:
test   %esi,%esi
je     1126 <rvec_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @rvec_zero(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i32 1
store float* %11, float** %3
store float 0.000000e+00, float* %10
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @rvec_zero(float* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
long long int longlongint_id(long long int x) { return x; }


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

x86 assembly (clang, -O2):
<longlongint_id>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @longlongint_id(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ getPT();
unsigned ET2_getPT_L(void) {
  int i;
  unsigned lval;
  unsigned char *p;
  p = (unsigned char *)&lval;
  for (i = 0; i < 4; ++i) {
    *(p++) = getPT();
  }
  return lval;
}


x86 assembly (clang, -O0):
<ET2_getPT_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1159 <ET2_getPT_L+0x49>
mov    $0x0,%al
call   1030 <getPT@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <ET2_getPT_L+0x17>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ET2_getPT_L>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <getPT@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <getPT@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getPT@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getPT@plt>
shl    $0x18,%eax
movzbl %bl,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
shl    $0x8,%ebp
movzwl %bp,%ecx
or     %ecx,%eax
movzbl %r14b,%ecx
or     %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ET2_getPT_L() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
store i32 0, i32* %1
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i32 (...) @getPT()
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
br label %13
13: ; preds = %8
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ET2_getPT_L() {
%1 = tail call i32 (...) @getPT()
%2 = tail call i32 (...) @getPT()
%3 = tail call i32 (...) @getPT()
%4 = tail call i32 (...) @getPT()
%5 = shl i32 %4, 24
%6 = shl i32 %3, 16
%7 = and i32 %6, 16711680
%8 = or i32 %5, %7
%9 = shl i32 %2, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = and i32 %1, 255
%13 = or i32 %11, %12
ret i32 %13
}
double calculate_acceleration_mi_hour(double init_velocity,
                                      double final_velocity,
                                      double time_interval) {
  double acceleration = 0.0;
  acceleration = (final_velocity - init_velocity) / (time_interval / 60.0);
  return acceleration;
}


x86 assembly (clang, -O0):
<calculate_acceleration_mi_hour>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xece(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_acceleration_mi_hour>:
subsd  %xmm0,%xmm1
divsd  0xef4(%rip),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_acceleration_mi_hour(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = fdiv double %11, 6.000000e+01
%13 = fdiv double %10, %12
store double %13, double* %7
%14 = load double, double* %7
ret double %14
}

LLVM IR (-O2):
define double @calculate_acceleration_mi_hour(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fdiv double %2, 6.000000e+01
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strlen(char *);
int read_line(char *input, int length) {
  char *pos = fgets(input, length, stdin);
  if (pos == NULL) {
    return -1;
  }
  return strlen(input);
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115f <read_line+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <read_line+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
test   %rax,%rax
je     1140 <read_line+0x20>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @read_line(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* @stdin
%10 = call i8* @fgets(i8* %7, i32 %8, i32 %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %17
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @read_line(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
char *rtrim(int /*<<< orphan*/);
char *trim_str(char *str) { return rtrim(ltrim(str)); }


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

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

LLVM IR (-O0):
define i8* @trim_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ltrim(i8* %3)
%5 = call i8* @rtrim(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @trim_str(i8* %0) {
%2 = tail call i32 @ltrim(i8* %0)
%3 = tail call i8* @rtrim(i32 %2)
ret i8* %3
}
void modif_front_unit2UTF8() {}


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

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

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

LLVM IR (-O2):
define void @modif_front_unit2UTF8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, unsigned long,
                           void *, unsigned long, void *);
int /*<<< orphan*/ stderr;
void write_trap(void *addr, void *oldPC, unsigned long oldTid, void *newPC,
                unsigned long newTid) {
  fprintf(stderr, "M[%p]: T%lu,W@%p -> T%lu,W@%p\n", addr, oldTid, oldPC,
          newTid, newPC);
}


x86 assembly (clang, -O0):
<write_trap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xeb0(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_trap>:
push   %rax
mov    %r8,%r9
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ebc(%rip),%rsi
mov    (%rsi),%edi
mov    %rcx,(%rsp)
lea    0xecf(%rip),%rsi
mov    %rax,%rcx
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"M[%p]: T%lu,W@%p -> T%lu,W@%p\0A\00"
define void @write_trap(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = load i64, i64* %8
%14 = load i8*, i8** %7
%15 = load i64, i64* %10
%16 = load i8*, i8** %9
%17 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13, i8* %14, i64 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"M[%p]: T%lu,W@%p -> T%lu,W@%p\0A\00"
define void @write_trap(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i8* %1, i64 %4, i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ test19_aux1();
scalar_t__ test19_aux2();
scalar_t__ test19_aux3(int *);
int test20() {
  int z;
  if ((test19_aux1() + test19_aux2() && test19_aux1()) || test19_aux3(&z))
    return z;
  return 0;
}


x86 assembly (clang, -O0):
<test20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test19_aux1@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test19_aux2@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
cmp    $0x0,%rax
je     116f <test20+0x3f>
mov    $0x0,%al
call   1040 <test19_aux1@plt>
cmp    $0x0,%rax
jne    1182 <test20+0x52>
lea    -0x8(%rbp),%rdi
call   1050 <test19_aux3@plt>
cmp    $0x0,%rax
je     118d <test20+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <test20+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test20>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <test19_aux1@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <test19_aux2@plt>
add    %rbx,%rax
je     1157 <test20+0x27>
xor    %eax,%eax
call   1040 <test19_aux1@plt>
test   %rax,%rax
jne    116a <test20+0x3a>
lea    0x4(%rsp),%rdi
call   1050 <test19_aux3@plt>
test   %rax,%rax
je     116a <test20+0x3a>
mov    0x4(%rsp),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test20() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @test19_aux1()
%4 = call i64 (...) @test19_aux2()
%5 = add nsw i64 %3, %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i64 (...) @test19_aux1()
%9 = icmp ne i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7, %0
%11 = call i64 @test19_aux3(i32* %2)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10, %7
%14 = load i32, i32* %2
store i32 %14, i32* %1
br label %16
15: ; preds = %10
store i32 0, i32* %1
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @test20() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 (...) @test19_aux1()
%4 = tail call i64 (...) @test19_aux2()
%5 = sub i64 0, %4
%6 = icmp eq i64 %3, %5
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = tail call i64 (...) @test19_aux1()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7, %0
%11 = call i64 @test19_aux3(i32* %1)
%12 = icmp eq i64 %11, 0
%13 = load i32, i32* %1
%14 = select i1 %12, i32 0, i32 %13
br label %15
15: ; preds = %10, %7
%16 = phi i32 [ undef, %7 ], [ %14, %10 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ halt_if_failed(int /*<<< orphan*/);
int /*<<< orphan*/ test_fir_cic3_decim_2_s16_s16();
int /*<<< orphan*/ test_fir_cic3_decim_2_s16_s32();
int /*<<< orphan*/ test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16();
void decimate_test() {
  halt_if_failed(test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16());
  halt_if_failed(test_fir_cic3_decim_2_s16_s32());
  halt_if_failed(test_fir_cic3_decim_2_s16_s16());
}


x86 assembly (clang, -O0):
<decimate_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16@plt>
mov    %eax,%edi
call   1050 <halt_if_failed@plt>
mov    $0x0,%al
call   1040 <test_fir_cic3_decim_2_s16_s32@plt>
mov    %eax,%edi
call   1050 <halt_if_failed@plt>
mov    $0x0,%al
call   1060 <test_fir_cic3_decim_2_s16_s16@plt>
mov    %eax,%edi
call   1050 <halt_if_failed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimate_test>:
push   %rax
xor    %eax,%eax
call   1030 <test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16@plt>
mov    %eax,%edi
call   1050 <halt_if_failed@plt>
xor    %eax,%eax
call   1040 <test_fir_cic3_decim_2_s16_s32@plt>
mov    %eax,%edi
call   1050 <halt_if_failed@plt>
xor    %eax,%eax
call   1060 <test_fir_cic3_decim_2_s16_s16@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <halt_if_failed@plt>

LLVM IR (-O0):
define void @decimate_test() {
%1 = call i32 (...) @test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16()
%2 = call i32 @halt_if_failed(i32 %1)
%3 = call i32 (...) @test_fir_cic3_decim_2_s16_s32()
%4 = call i32 @halt_if_failed(i32 %3)
%5 = call i32 (...) @test_fir_cic3_decim_2_s16_s16()
%6 = call i32 @halt_if_failed(i32 %5)
ret void
}

LLVM IR (-O2):
define void @decimate_test() {
%1 = tail call i32 (...) @test_translate_fs_over_4_and_decimate_by_2_cic_3_s8_s16()
%2 = tail call i32 @halt_if_failed(i32 %1)
%3 = tail call i32 (...) @test_fir_cic3_decim_2_s16_s32()
%4 = tail call i32 @halt_if_failed(i32 %3)
%5 = tail call i32 (...) @test_fir_cic3_decim_2_s16_s16()
%6 = tail call i32 @halt_if_failed(i32 %5)
ret void
}
/* Type definitions */
struct blob_attr {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ blob_get_u32(struct blob_attr const *);
int32_t blob_get_int32(const struct blob_attr *attr) {
  return blob_get_u32(attr);
}


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

x86 assembly (clang, -O2):
<blob_get_int32>:
jmp    1030 <blob_get_u32@plt>

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

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
define i32 @blob_get_int32(%struct.blob_attr* %0) {
%2 = tail call i32 @blob_get_u32(%struct.blob_attr* %0)
ret i32 %2
}
tri_subdivision() {}


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

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

LLVM IR (-O0):
define i32 @tri_subdivision() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @tri_subdivision() {
ret i32 undef
}
int get_xio_pin_base() { return 1013; }


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

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

LLVM IR (-O0):
define i32 @get_xio_pin_base() {
ret i32 1013
}

LLVM IR (-O2):
define i32 @get_xio_pin_base() {
ret i32 1013
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
pid_t vfork(void) { return syscall(2); }


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

x86 assembly (clang, -O2):
<vfork>:
mov    $0x2,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @vfork() {
%1 = call i32 @syscall(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @vfork() {
%1 = tail call i32 @syscall(i32 2)
ret i32 %1
}
void UYVYToARGBRow_C() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToARGBRow_C() {
ret void
}
/* Variables and functions */
double __nv_nextafter(double, double);
double nextafter(double __a, double __b) { return __nv_nextafter(__a, __b); }


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

x86 assembly (clang, -O2):
<nextafter>:
jmp    1030 <__nv_nextafter@plt>

LLVM IR (-O0):
define double @nextafter(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 = call double @__nv_nextafter(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @nextafter(double %0, double %1) {
%3 = tail call double @__nv_nextafter(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ putcbyte(int);
void do_continuation(int cont) {
  switch (cont) {
  case -1:
    putcbyte(0x0D);
    break;
  case -2:
    break;
  }
}


x86 assembly (clang, -O0):
<do_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xfffffffe,%eax
je     114f <do_continuation+0x3f>
jmp    112f <do_continuation+0x1f>
mov    -0x8(%rbp),%eax
sub    $0xffffffff,%eax
jne    1154 <do_continuation+0x44>
jmp    1140 <do_continuation+0x30>
mov    $0xd,%edi
call   1030 <putcbyte@plt>
jmp    1154 <do_continuation+0x44>
jmp    1154 <do_continuation+0x44>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_continuation>:
cmp    $0xffffffff,%edi
je     1116 <do_continuation+0x6>
ret
mov    $0xd,%edi
jmp    1030 <putcbyte@plt>

LLVM IR (-O0):
define void @do_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 -1, label %4
i32 -2, label %6
]
4: ; preds = %1
%5 = call i32 @putcbyte(i32 13)
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %4
ret void
}

LLVM IR (-O2):
define void @do_continuation(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putcbyte(i32 13)
br label %5
5: ; preds = %1, %3
ret void
}
int _master_dummy_send_finish(const struct fds *master) { return 0; }


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

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

LLVM IR (-O0):
%struct.fds = type opaque
define i32 @_master_dummy_send_finish(%struct.fds* %0) {
%2 = alloca %struct.fds*
store %struct.fds* %0, %struct.fds** %2
ret i32 0
}

LLVM IR (-O2):
%struct.fds = type opaque
define i32 @_master_dummy_send_finish(%struct.fds* nocapture readnone %0) {
ret i32 0
}
void gpio_toggle_heartbeat_led(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_toggle_heartbeat_led() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, unsigned int);
scalar_t__ pthread_self();
int /*<<< orphan*/ usleep(int);
void *threadfunc(void *p) {
  printf("%ld: thread 0x%0x\n", (long)p, (unsigned)pthread_self());
  while (1) {
    usleep(50 * 1000);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<threadfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc350,%edi
call   1050 <usleep@plt>
jmp    115d <threadfunc+0x2d>

x86 assembly (clang, -O2):
<threadfunc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
nopl   0x0(%rax)
mov    $0xc350,%edi
call   1050 <usleep@plt>
jmp    1150 <threadfunc+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"%ld: thread 0x%0x\0A\00"
define i8* @threadfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i64 (...) @pthread_self()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %4, i32 %6)
br label %8
8: ; preds = %1, %8
%9 = call i32 @usleep(i32 50000)
br label %8
}

LLVM IR (-O2):
@.str = [19 x i8] c"%ld: thread 0x%0x\0A\00"
define noalias i8* @threadfunc(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %2, i32 %4)
br label %6
6: ; preds = %1, %6
%7 = tail call i32 @usleep(i32 50000)
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ SwapByteOrder_64(int /*<<< orphan*/);
void bswap_64(const int n, void *u) {
  uint64_t *T = u;
  int i;
#pragma omp parallel for private(i)
  for (i = 0; i < n; i++) {
    *(T + i) = SwapByteOrder_64(*(T + i));
  }
  return;
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <bswap_64+0x55>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <bswap_64+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_64>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <bswap_64+0x36>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bswap_64+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bswap_64(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @SwapByteOrder_64(i32 %10)
store i32 %11, i32* %9
%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
}
/* Variables and functions */
int /*<<< orphan*/ symbol_delete(void *);
void symbol_delete_cb(void *self) { symbol_delete(self); }


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

x86 assembly (clang, -O2):
<symbol_delete_cb>:
jmp    1030 <symbol_delete@plt>

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

LLVM IR (-O2):
define void @symbol_delete_cb(i8* %0) {
%2 = tail call i32 @symbol_delete(i8* %0)
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int decode_tag_internal(unsigned long *, struct evbuffer *, int);
int evtag_decode_tag(unsigned long *ptag, struct evbuffer *evbuf) {
  return (decode_tag_internal(ptag, evbuf, 1));
}


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

x86 assembly (clang, -O2):
<evtag_decode_tag>:
mov    $0x1,%edx
jmp    1030 <decode_tag_internal@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_tag(i64* %0, %struct.evbuffer* %1) {
%3 = alloca i64*
%4 = alloca %struct.evbuffer*
store i64* %0, i64** %3
store %struct.evbuffer* %1, %struct.evbuffer** %4
%5 = load i64*, i64** %3
%6 = load %struct.evbuffer*, %struct.evbuffer** %4
%7 = call i32 @decode_tag_internal(i64* %5, %struct.evbuffer* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_tag(i64* %0, %struct.evbuffer* %1) {
%3 = tail call i32 @decode_tag_internal(i64* %0, %struct.evbuffer* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ compute(int, int);
void main() { compute(6, 7); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <compute@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%edi
mov    $0x7,%esi
jmp    1030 <compute@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @compute(i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @compute(i32 6, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASL_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void ASL_abs(void) {
  c64_memAbsoluteAddr();
  ASL_();
}


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

x86 assembly (clang, -O2):
<ASL_abs>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ASL_@plt>

LLVM IR (-O0):
define void @ASL_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @ASL_()
ret void
}

LLVM IR (-O2):
define void @ASL_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @ASL_()
ret void
}
/* Type definitions */
struct dynamic_packet_test_function_impl_gen_struct {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void generate_test_frame_dynamic_method(
    FILE *stream, struct dynamic_packet_test_function_impl_gen_struct *record,
    unsigned int indent) {
  (void)(record);
  (void)(indent);
  fprintf(stream, "return -1;");
}


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

x86 assembly (clang, -O2):
<generate_test_frame_dynamic_method>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
%struct.dynamic_packet_test_function_impl_gen_struct = type { i32 }
@.str = [11 x i8] c"return -1;\00"
define void @generate_test_frame_dynamic_method(i32* %0, %struct.dynamic_packet_test_function_impl_gen_struct* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca %struct.dynamic_packet_test_function_impl_gen_struct*
%6 = alloca i32
store i32* %0, i32** %4
store %struct.dynamic_packet_test_function_impl_gen_struct* %1, %struct.dynamic_packet_test_function_impl_gen_struct** %5
store i32 %2, i32* %6
%7 = load %struct.dynamic_packet_test_function_impl_gen_struct*, %struct.dynamic_packet_test_function_impl_gen_struct** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.dynamic_packet_test_function_impl_gen_struct = type { i32 }
@.str = [11 x i8] c"return -1;\00"
define void @generate_test_frame_dynamic_method(i32* nocapture %0, %struct.dynamic_packet_test_function_impl_gen_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
ret void
}
void foo(void) {
  int i, a;
  for (i = 0; i < 10; i++) {
    a = i;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1129 <foo+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void mapperNone() {}


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

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

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

LLVM IR (-O2):
define void @mapperNone() {
ret void
}
void wifi_evt_endpoint_closing(
    const struct wifi_msg_endpoint_closing_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_endpoint_closing_evt_t = type opaque
define void @wifi_evt_endpoint_closing(%struct.wifi_msg_endpoint_closing_evt_t* %0) {
%2 = alloca %struct.wifi_msg_endpoint_closing_evt_t*
store %struct.wifi_msg_endpoint_closing_evt_t* %0, %struct.wifi_msg_endpoint_closing_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_endpoint_closing_evt_t = type opaque
define void @wifi_evt_endpoint_closing(%struct.wifi_msg_endpoint_closing_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_work();
void __cl_spec_parallel1() { parallel_work(); }


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

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

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

LLVM IR (-O2):
define void @__cl_spec_parallel1() {
%1 = tail call i32 (...) @parallel_work()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ rexit(int);
void bombs(int num) {
  printf("Error in TOS program, %d bombs!\n", num);
  rexit(1);
}


x86 assembly (clang, -O0):
<bombs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <rexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bombs>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <rexit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Error in TOS program, %d bombs!\0A\00"
define void @bombs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @rexit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Error in TOS program, %d bombs!\0A\00"
define void @bombs(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @rexit(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void main() {
  int x;
  int y;
  int *p1;
  int **p2;
  int ***p3;
  int *q1;
  int **q2;
  int ***q3;
  x = 674;
  p1 = &x;
  p2 = &p1;
  p3 = &p2;
  q3 = p3;
  q2 = *q3;
  q1 = *q2;
  y = *q1;
  test(x == y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x2a2,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i32***
%6 = alloca i32*
%7 = alloca i32**
%8 = alloca i32***
store i32 674, i32* %1
store i32* %1, i32** %3
store i32** %3, i32*** %4
store i32*** %4, i32**** %5
%9 = load i32***, i32**** %5
store i32*** %9, i32**** %8
%10 = load i32***, i32**** %8
%11 = load i32**, i32*** %10
store i32** %11, i32*** %7
%12 = load i32**, i32*** %7
%13 = load i32*, i32** %12
store i32* %13, i32** %6
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
store i32 %15, i32* %2
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @test(i32 %19)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @test(i32 1)
ret void
}
__attribute__((always_)) void cpuid(unsigned int op, unsigned int *eax,
                                    unsigned int *ebx, unsigned int *ecx,
                                    unsigned int *edx) {
  __asm__("cpuid"
          : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
          : "0"(op), "c"(0));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
xor    %ecx,%ecx
cpuid
mov    %eax,(%rsi)
mov    %ebx,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %15, i32 0)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}