xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  float a = 0, b = 4;
  float simps(float a, float b, int n);
  printf("Enter the value of n\n");
  scanf("%d", &n);
  printf("Integral value of f(x) by Simpson's rule:%f\n", simps(a, b, n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeb8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mov    -0x4(%rbp),%edi
call   1040 <simps@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
movss  0xe96(%rip),%xmm1
xorps  %xmm0,%xmm0
call   1050 <simps@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the value of n\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [45 x i8] c"Integral value of f(x) by Simpson's rule:%f\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store float 0.000000e+00, float* %2
store float 4.000000e+00, float* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load i32, i32* %1
%9 = call float @simps(float %6, float %7, i32 %8)
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [45 x i8] c"Integral value of f(x) by Simpson's rule:%f\0A\00"
@str = [21 x i8] c"Enter the value of n\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call float @simps(float 0.000000e+00, float 4.000000e+00, i32 %5)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %7)
ret void
}
/* Variables and functions */
long __fs2ulong(float);
signed long __fs2slong(float f) {
  if (!f)
    return 0;
  if (f < 0) {
    return -__fs2ulong(-f);
  } else {
    return __fs2ulong(f);
  }
}


x86 assembly (clang, -O0):
<__fs2slong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1141 <__fs2slong+0x31>
jp     1141 <__fs2slong+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1184 <__fs2slong+0x74>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1176 <__fs2slong+0x66>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <__fs2ulong@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <__fs2slong+0x74>
movss  -0xc(%rbp),%xmm0
call   1030 <__fs2ulong@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fs2slong>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111a <__fs2slong+0xa>
jnp    1134 <__fs2slong+0x24>
ucomiss %xmm0,%xmm1
jbe    1137 <__fs2slong+0x27>
push   %rax
xorps  0xed9(%rip),%xmm0
call   1030 <__fs2ulong@plt>
neg    %rax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret
jmp    1030 <__fs2ulong@plt>

LLVM IR (-O0):
define i64 @__fs2slong(float %0) {
%2 = alloca i64
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp une float %4, 0.000000e+00
br i1 %5, label %7, label %6
6: ; preds = %1
store i64 0, i64* %2
br label %18
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp olt float %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load float, float* %3
%12 = fneg float %11
%13 = call i64 @__fs2ulong(float %12)
%14 = sub nsw i64 0, %13
store i64 %14, i64* %2
br label %18
15: ; preds = %7
%16 = load float, float* %3
%17 = call i64 @__fs2ulong(float %16)
store i64 %17, i64* %2
br label %18
18: ; preds = %15, %10, %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @__fs2slong(float %0) {
%2 = fcmp une float %0, 0.000000e+00
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = fcmp olt float %0, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = fneg float %0
%7 = tail call i64 @__fs2ulong(float %6)
%8 = sub nsw i64 0, %7
br label %11
9: ; preds = %3
%10 = tail call i64 @__fs2ulong(float %0)
br label %11
11: ; preds = %1, %9, %5
%12 = phi i64 [ %8, %5 ], [ %10, %9 ], [ 0, %1 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ swap(unsigned int *, unsigned int *);
unsigned gcd(unsigned m, unsigned n) {
  unsigned x;
  if (m < n)
    swap(&m, &n);
  while (n != 0) {
    x = m % n;
    m = n;
    n = x;
  }
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1137 <gcd+0x27>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap@plt>
jmp    113c <gcd+0x2c>
cmpl   $0x0,-0x8(%rbp)
je     1162 <gcd+0x52>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113c <gcd+0x2c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rax
mov    %esi,%edx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
cmp    %esi,%edi
jae    1132 <gcd+0x22>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%edi
test   %edx,%edx
je     1157 <gcd+0x47>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
mov    %edx,%edi
xor    %edx,%edx
div    %edi
test   %edx,%edx
jne    1140 <gcd+0x30>
mov    %edi,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %edi,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = icmp ult i32 %0, %1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 @swap(i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = load i32, i32* %3
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ %0, %2 ]
%12 = phi i32 [ %8, %6 ], [ %1, %2 ]
%13 = icmp eq i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i32 [ %17, %14 ], [ %12, %10 ]
%16 = phi i32 [ %15, %14 ], [ %11, %10 ]
%17 = urem i32 %16, %15
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %14
19: ; preds = %14
store i32 %15, i32* %3
store i32 0, i32* %4
br label %20
20: ; preds = %19, %10
%21 = phi i32 [ %15, %19 ], [ %11, %10 ]
ret i32 %21
}
int mfs_unmap(int fd) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @mfs_unmap(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ joe_fatal(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *new = malloc(size);
  if (!new)
    joe_fatal("Memory exhausted");
  return new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <joe_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <joe_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @joe_fatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"Memory exhausted\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @joe_fatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void log_it(char *log) {
  FILE *f = fopen("/tmp/ohcount.log", "a");
  fputs(log, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<log_it>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_it>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/ohcount.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_it(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fputs(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/ohcount.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_it(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fputs(i8* %0, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int VirtualFree(void *, int /*<<< orphan*/, int);
int freepages(void *p) { return VirtualFree(p, 0, 32768); }


x86 assembly (clang, -O0):
<freepages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8000,%edx
call   1030 <VirtualFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freepages>:
xor    %esi,%esi
mov    $0x8000,%edx
jmp    1030 <VirtualFree@plt>

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

LLVM IR (-O2):
define i32 @freepages(i8* %0) {
%2 = tail call i32 @VirtualFree(i8* %0, i32 0, i32 32768)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int assign_dobldobl_coefficient_of_slice(int i, int j, double *r) {
  int fail;
  fail = _ada_use_c2phc4c(633, &i, &j, r, 0);
  return fail;
}


x86 assembly (clang, -O0):
<assign_dobldobl_coefficient_of_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x279,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_dobldobl_coefficient_of_slice>:
push   %rax
mov    %rdx,%rcx
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x279,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @assign_dobldobl_coefficient_of_slice(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 633, i32* %4, i32* %5, double* %8, i32 0)
store i32 %9, i32* %7
%10 = load i32, i32* %7
ret i32 %10
}

LLVM IR (-O2):
define i32 @assign_dobldobl_coefficient_of_slice(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 633, i32* %4, i32* %5, double* %2, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x75() {
  Assert_real((isalpha(117)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              590, ("isalpha should be 1 for u"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for u\00"
define void @t_isalpha_0x75() {
%1 = tail call i32 @isalpha(i32 117)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 590, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv, char **envp) {
  printf("[SKIP]\tNot a 32-bit x86 userspace\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"[SKIP]\09Not a 32-bit x86 userspace\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"[SKIP]\09Not a 32-bit x86 userspace\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void cw1200_debug_tx_copy(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_tx_copy(%struct.cw1200_common* nocapture %0) {
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int binary_semaphore_post(int semid) {
  struct sembuf operations[1];
  operations[0].sem_num = 0;
  operations[0].sem_op = 1;
  operations[0].sem_flg = SEM_UNDO;
  return semop(semid, operations, 1);
}


x86 assembly (clang, -O0):
<binary_semaphore_post>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_semaphore_post>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movl   $0x1,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @binary_semaphore_post(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x %struct.sembuf]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 1, i32* %7
%8 = load i32, i32* @SEM_UNDO
%9 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %9, i32 0, i32 1
store i32 %8, i32* %10
%11 = load i32, i32* %2
%12 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %3, i64 0, i64 0
%13 = call i32 @semop(i32 %11, %struct.sembuf* %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @binary_semaphore_post(i32 %0) {
%2 = alloca [1 x %struct.sembuf]
%3 = bitcast [1 x %struct.sembuf]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 0
store i32 1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds [1 x %struct.sembuf], [1 x %struct.sembuf]* %2, i64 0, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret i32 %9
}
/* Type definitions */
struct clib_rb_node {
  int dummy;
};
struct clib_rb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ debug_verify_property_5_helper(struct clib_rb *,
                                                  struct clib_rb_node *,
                                                  int /*<<< orphan*/, int *);
void debug_verify_property_5(struct clib_rb *pTree, struct clib_rb_node *root) {
  int black_count_path = -1;
  debug_verify_property_5_helper(pTree, root, 0, &black_count_path);
}


x86 assembly (clang, -O0):
<debug_verify_property_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
lea    -0x14(%rbp),%rcx
call   1030 <debug_verify_property_5_helper@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_verify_property_5>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rcx
xor    %edx,%edx
call   1030 <debug_verify_property_5_helper@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.clib_rb = type { i32 }
%struct.clib_rb_node = type { i32 }
define void @debug_verify_property_5(%struct.clib_rb* %0, %struct.clib_rb_node* %1) {
%3 = alloca %struct.clib_rb*
%4 = alloca %struct.clib_rb_node*
%5 = alloca i32
store %struct.clib_rb* %0, %struct.clib_rb** %3
store %struct.clib_rb_node* %1, %struct.clib_rb_node** %4
store i32 -1, i32* %5
%6 = load %struct.clib_rb*, %struct.clib_rb** %3
%7 = load %struct.clib_rb_node*, %struct.clib_rb_node** %4
%8 = call i32 @debug_verify_property_5_helper(%struct.clib_rb* %6, %struct.clib_rb_node* %7, i32 0, i32* %5)
ret void
}

LLVM IR (-O2):
%struct.clib_rb = type { i32 }
%struct.clib_rb_node = type { i32 }
define void @debug_verify_property_5(%struct.clib_rb* %0, %struct.clib_rb_node* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i32 @debug_verify_property_5_helper(%struct.clib_rb* %0, %struct.clib_rb_node* %1, i32 0, i32* %3)
ret void
}
int test_imm_8Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Bint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x8b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Bint64_midword_reg>:
test   $0x8b0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 139
%6 = icmp ne i64 %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_8Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9109504
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void force_mem(int *arg) {}


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

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

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

LLVM IR (-O2):
define void @force_mem(i32* nocapture %0) {
ret void
}
const char *kernel_if_name() { return "kernel_seam"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"kernel_seam\00"
define i8* @kernel_if_name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"kernel_seam\00"
define i8* @kernel_if_name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void lrc_debug_matrix_(int *matrix, int row, int col) {
  ;
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++) {
      int e = matrix[i * col + j];
      if (e == 0) {
        ;
      } else {
        ;
      }
    };
  }
}


x86 assembly (clang, -O0):
<lrc_debug_matrix_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1185 <lrc_debug_matrix_+0x85>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1172 <lrc_debug_matrix_+0x72>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115a <lrc_debug_matrix_+0x5a>
jmp    115f <lrc_debug_matrix_+0x5f>
jmp    115f <lrc_debug_matrix_+0x5f>
jmp    1164 <lrc_debug_matrix_+0x64>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <lrc_debug_matrix_+0x28>
jmp    1177 <lrc_debug_matrix_+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <lrc_debug_matrix_+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lrc_debug_matrix_(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
int swap(left, right)
int *left, *right;
{
  int tmp = *left;
  *left = *right;
  *right = tmp;
  output(*right == *left);
  if (*right == *left)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <output@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1177 <swap+0x67>
movl   $0x1,-0x4(%rbp)
jmp    117e <swap+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %edi,%edi
cmp    (%rbx),%eax
sete   %dil
xor    %eax,%eax
call   1030 <output@plt>
mov    (%r14),%ecx
xor    %eax,%eax
cmp    (%rbx),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @swap(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = icmp eq i32 %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %19)
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %23
%25 = icmp eq i32 %22, %24
br i1 %25, label %26, label %27
26: ; preds = %2
store i32 1, i32* %3
br label %28
27: ; preds = %2
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
%5 = load i32, i32* %0
%6 = icmp eq i32 %3, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @output to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %1
%10 = load i32, i32* %0
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int memcmp(const void *ptr1, const void *ptr2, size_t n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @memcmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
void kgdb_trap(struct pt_regs *regs, int param) {}


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

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

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @kgdb_trap(%struct.pt_regs* %0, i32 %1) {
%3 = alloca %struct.pt_regs*
%4 = alloca i32
store %struct.pt_regs* %0, %struct.pt_regs** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @kgdb_trap(%struct.pt_regs* nocapture %0, i32 %1) {
ret void
}
int test3(int *a) {
  a = __builtin_assume_aligned(a, 32);
  return a[0];
}


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

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

LLVM IR (-O0):
define i32 @test3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test3(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
ret i32 %3
}
void set_bfinal(void *buf, int bfinal) {
  char *b = buf;
  if (bfinal)
    *b = *b | (unsigned char)0x01;
  else
    *b = *b & (unsigned char)0xfe;
}


x86 assembly (clang, -O0):
<set_bfinal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1134 <set_bfinal+0x34>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
or     $0x1,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1148 <set_bfinal+0x48>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
and    $0xfe,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bfinal>:
test   %esi,%esi
setne  %al
mov    (%rdi),%cl
and    $0xfe,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @set_bfinal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %5
store i8 %14, i8* %15
br label %23
16: ; preds = %2
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %19, 254
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
store i8 %21, i8* %22
br label %23
23: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @set_bfinal(i8* nocapture %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = load i8, i8* %0
%5 = and i8 %4, -2
%6 = zext i1 %3 to i8
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret void
}
void f() {
  int n = 3;
  typedef int T[n++];
  T t;
  t[0] = 7;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movl   $0x7,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = zext i32 %4 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i32, i64 %6
store i64 %6, i64* %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 7, i32* %9
%10 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
void CFGMR3QueryPortDef(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryPortDef() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_retry_limit_usage(void) {
  printf("\nUsage : sys_cfg_retry_limit [RETRY_LIMIT]\n");
  printf("\nIf RETRY_LIMIT is provided, a 'set' is performed, else a 'get' is "
         "performed.");
  printf("\nRETRY_LIMIT should be greater than or equal to zero and less than "
         "or equal to 14\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_retry_limit_usage>:
push   %rax
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf39(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AUsage : sys_cfg_retry_limit [RETRY_LIMIT]\0A\00"
@.str.1 = [78 x i8] c"\0AIf RETRY_LIMIT is provided, a 'set' is performed, else a 'get' is performed.\00"
@.str.2 = [83 x i8] c"\0ARETRY_LIMIT should be greater than or equal to zero and less than or equal to 14\0A\00"
define void @print_sys_cfg_retry_limit_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [78 x i8] c"\0AIf RETRY_LIMIT is provided, a 'set' is performed, else a 'get' is performed.\00"
@str = [43 x i8] c"\0AUsage : sys_cfg_retry_limit [RETRY_LIMIT]\00"
@str.3 = [82 x i8] c"\0ARETRY_LIMIT should be greater than or equal to zero and less than or equal to 14\00"
define void @print_sys_cfg_retry_limit_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_ADC_Get_Result(void *);
char adcGet(void *parameters) {
  R_ADC_Get_Result(parameters);
  return 0;
}


x86 assembly (clang, -O0):
<adcGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <R_ADC_Get_Result@plt>
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @adcGet(i8* %0) {
%2 = tail call i32 @R_ADC_Get_Result(i8* %0)
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int puts(char *);
int flu_putf(char *s) {
  int r = puts(s);
  free(s);
  return r;
}


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

x86 assembly (clang, -O2):
<flu_putf>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <puts@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @flu_putf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @flu_putf(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @free(i8* %0)
ret i32 %2
}
/* Variables and functions */
int kpt_relocate_BZ_grid_address(int **, int *, int **, int const *, double **,
                                 int const *);
int spg_relocate_BZ_grid_address(int bz_grid_address[][3], int bz_map[],
                                 int grid_address[][3], const int mesh[3],
                                 double rec_lattice[3][3],
                                 const int is_shift[3]) {
  return kpt_relocate_BZ_grid_address(bz_grid_address, bz_map, grid_address,
                                      mesh, rec_lattice, is_shift);
}


x86 assembly (clang, -O0):
<spg_relocate_BZ_grid_address>:
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    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <kpt_relocate_BZ_grid_address@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_relocate_BZ_grid_address>:
jmp    1030 <kpt_relocate_BZ_grid_address@plt>

LLVM IR (-O0):
define i32 @spg_relocate_BZ_grid_address([3 x i32]* %0, i32* %1, [3 x i32]* %2, i32* %3, [3 x double]* %4, i32* %5) {
%7 = alloca [3 x i32]*
%8 = alloca i32*
%9 = alloca [3 x i32]*
%10 = alloca i32*
%11 = alloca [3 x double]*
%12 = alloca i32*
store [3 x i32]* %0, [3 x i32]** %7
store i32* %1, i32** %8
store [3 x i32]* %2, [3 x i32]** %9
store i32* %3, i32** %10
store [3 x double]* %4, [3 x double]** %11
store i32* %5, i32** %12
%13 = load [3 x i32]*, [3 x i32]** %7
%14 = bitcast [3 x i32]* %13 to i32**
%15 = load i32*, i32** %8
%16 = load [3 x i32]*, [3 x i32]** %9
%17 = bitcast [3 x i32]* %16 to i32**
%18 = load i32*, i32** %10
%19 = load [3 x double]*, [3 x double]** %11
%20 = bitcast [3 x double]* %19 to double**
%21 = load i32*, i32** %12
%22 = call i32 @kpt_relocate_BZ_grid_address(i32** %14, i32* %15, i32** %17, i32* %18, double** %20, i32* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @spg_relocate_BZ_grid_address([3 x i32]* %0, i32* %1, [3 x i32]* %2, i32* %3, [3 x double]* %4, i32* %5) {
%7 = bitcast [3 x i32]* %0 to i32**
%8 = bitcast [3 x i32]* %2 to i32**
%9 = bitcast [3 x double]* %4 to double**
%10 = tail call i32 @kpt_relocate_BZ_grid_address(i32** %7, i32* %1, i32** %8, i32* %3, double** %9, i32* %5)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void dumpheader(void) {
  fprintf(stdout, "PC   SP   OV   A    B    C    X    Y    Z    I    J    Next "
                  "Instruction\n"
                  "---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- "
                  "----------------\n");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [145 x i8] c"PC SP OV A B C X Y Z I J Next Instruction\0A---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----------------\0A\00"
define void @dumpheader() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [145 x i8] c"PC SP OV A B C X Y Z I J Next Instruction\0A---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----------------\0A\00"
define void @dumpheader() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret void
}
int t11_last(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @t11_last() {
ret i32 1
}

LLVM IR (-O2):
define i32 @t11_last() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ change(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[101];
  scanf("%s", str);
  change(str);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <change@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <change@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @change(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ monShell(char **);
int main(int argc, char *argv[], char *arge[]) {
  monShell(arge);
  return EXIT_SUCCESS;
}


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)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <monShell@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rdx,%rdi
call   1030 <monShell@plt>
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %7
%9 = call i32 @monShell(i8** %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @monShell(i8** %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ lb;

/* Variables and functions */
int /*<<< orphan*/ log_write(char *);
int /*<<< orphan*/ str_fill(char *, char, int);
void log_h(char *val) {
  char lb[128];
  str_fill(lb, '-', sizeof(lb));
  log_write(lb);
  log_write(val);
  log_write(lb);
}


x86 assembly (clang, -O0):
<log_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x2d,%esi
mov    $0x80,%edx
call   1030 <str_fill@plt>
lea    -0x90(%rbp),%rdi
call   1040 <log_write@plt>
mov    -0x8(%rbp),%rdi
call   1040 <log_write@plt>
lea    -0x90(%rbp),%rdi
call   1040 <log_write@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_h>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x2d,%esi
mov    $0x80,%edx
call   1030 <str_fill@plt>
mov    %r14,%rdi
call   1040 <log_write@plt>
mov    %rbx,%rdi
call   1040 <log_write@plt>
mov    %r14,%rdi
call   1040 <log_write@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @log_h(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @str_fill(i8* %4, i8 signext 45, i32 128)
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = call i32 @log_write(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @log_write(i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = call i32 @log_write(i8* %10)
ret void
}

LLVM IR (-O2):
define void @log_h(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @str_fill(i8* %3, i8 signext 45, i32 128)
%5 = call i32 @log_write(i8* %3)
%6 = call i32 @log_write(i8* %0)
%7 = call i32 @log_write(i8* %3)
ret void
}