xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ XUnmapEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XUnmapEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XUnmapEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XUnmapEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XUnmapEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XUnmapEvent>:
test   %rdi,%rdi
je     112a <free_XUnmapEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XUnmapEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XUnmapEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
int is_space(char x) {
  return (x == ' ' || x == '\f' || x == '\n' || x == '\r' || x == '\t' ||
          x == '\v');
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <is_space+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
ja     1120 <is_space+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    1120 <is_space+0x20>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 12
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 11
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void f(int z) {
  int x, y, k;
#pragma omp task depend(out : x, k)
  {
    x = 3;
    k = 4;
  }
#pragma omp task depend(in : x, k) depend(out : y, z)
  {
    y = x + 1 + k;
    z = y + 2;
  }
#pragma omp taskwait
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
float floorf(float x) { return (float)floor((double)x); }


x86 assembly (clang, -O0):
<floorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @floor(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @floor(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
extern void execute(char *arglist[]) {
  execvp(arglist[0], arglist);
  perror("execvp failed");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <execvp@plt>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<execute>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1040 <execvp@plt>
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"execvp failed\00"
@EXIT_FAILURE = global i32 0
define void @execute(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"execvp failed\00"
@EXIT_FAILURE = global i32 0
define void @execute(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int k;
  scanf("%d", &k);
  printf("%d", k * k);
  printf("\n%d", k * k * k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_min_epu8(__m128i A, __m128i B) { return _mm_min_epu8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_min_epu8>:
jmp    1030 <_mm_min_epu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_min_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_epu8(i32 %0, i32 %1)
ret i32 %3
}
int fun1284() { return 1284; }


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

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

LLVM IR (-O0):
define i32 @fun1284() {
ret i32 1284
}

LLVM IR (-O2):
define i32 @fun1284() {
ret i32 1284
}
int funcdef() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funcdef() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ do_cpuid(int /*<<< orphan*/, int /*<<< orphan*/ *);
uint32_t cpuid_ecx(uint32_t op) {
  uint32_t regs[4];
  do_cpuid(op, regs);
  return regs[2];
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <do_cpuid@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
sub    $0x18,%rsp
mov    %rsp,%rsi
call   1030 <do_cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @do_cpuid(i32 %4, i32* %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @do_cpuid(i32 %0, i32* %4)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%7 = load i32, i32* %6
ret i32 %7
}
/* Type definitions */
struct mb_interpreter_t {
  int dummy;
};

/* Variables and functions */
int _remove_func(struct mb_interpreter_t *, char const *, int);
int mb_remove_reserved_func(struct mb_interpreter_t *s, const char *n) {
  return _remove_func(s, n, (!0));
}


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

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

LLVM IR (-O0):
%struct.mb_interpreter_t = type { i32 }
define i32 @mb_remove_reserved_func(%struct.mb_interpreter_t* %0, i8* %1) {
%3 = alloca %struct.mb_interpreter_t*
%4 = alloca i8*
store %struct.mb_interpreter_t* %0, %struct.mb_interpreter_t** %3
store i8* %1, i8** %4
%5 = load %struct.mb_interpreter_t*, %struct.mb_interpreter_t** %3
%6 = load i8*, i8** %4
%7 = call i32 @_remove_func(%struct.mb_interpreter_t* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.mb_interpreter_t = type { i32 }
define i32 @mb_remove_reserved_func(%struct.mb_interpreter_t* %0, i8* %1) {
%3 = tail call i32 @_remove_func(%struct.mb_interpreter_t* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
void *alloca(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void _swap(void *a, void *b, int size) {
  void *c = alloca(size);
  memcpy(c, a, size);
  memcpy(a, b, size);
  memcpy(b, c, size);
}


x86 assembly (clang, -O0):
<_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1030 <alloca@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define void @_swap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @alloca(i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
ret void
}
void deflateBound(void) {}


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

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

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

LLVM IR (-O2):
define void @deflateBound() {
ret void
}
int func(void) { return 0x12345678; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 305419896
}

LLVM IR (-O2):
define i32 @func() {
ret i32 305419896
}
int _is_digit(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @_is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double div_double(double arg1, double arg2) { return arg1 / arg2; }


x86 assembly (clang, -O0):
<div_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_double>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @div_double(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
void strip_spaces(const char *buf, int *ip) {
  int i = *ip;
  while (isspace((unsigned char)buf[i]))
    i++;
  *ip = i;
}


x86 assembly (clang, -O0):
<strip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1152 <strip_spaces+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <strip_spaces+0x19>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_spaces>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movslq (%rsi),%rax
lea    -0x1(%rax),%ebp
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <strip_spaces+0x20>
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strip_spaces(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ %11, %5 ], [ %4, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 zeroext %8)
%10 = icmp eq i64 %9, 0
%11 = add i64 %6, 1
br i1 %10, label %12, label %5
12: ; preds = %5
%13 = trunc i64 %6 to i32
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_set_drain_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_set_drain_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_ioline_set_drain_callback\0A\00"
define i32 @pa_ioline_set_drain_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_ioline_set_drain_callback\00"
define i32 @pa_ioline_set_drain_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int primeNumber_L();
int main(void) {
  int result;
  result = primeNumber_L();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @primeNumber_L()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getc();
int /*<<< orphan*/ init_irq();
int /*<<< orphan*/ key_init();
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ uart_init();
int gboot_main() {
  unsigned char buf[2048];
  led_init();
  key_init();
  init_irq();
  uart_init();
  putc('H');
  while (1)
    getc();
  return 0;
}


x86 assembly (clang, -O0):
<gboot_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
mov    $0x0,%al
call   1060 <led_init@plt>
mov    $0x0,%al
call   1030 <key_init@plt>
mov    $0x0,%al
call   1040 <init_irq@plt>
mov    $0x0,%al
call   1050 <uart_init@plt>
mov    $0x48,%edi
call   1070 <putc@plt>
mov    $0x0,%al
call   1080 <getc@plt>
jmp    1191 <gboot_main+0x31>

x86 assembly (clang, -O2):
<gboot_main>:
push   %rax
xor    %eax,%eax
call   1060 <led_init@plt>
xor    %eax,%eax
call   1030 <key_init@plt>
xor    %eax,%eax
call   1040 <init_irq@plt>
xor    %eax,%eax
call   1050 <uart_init@plt>
mov    $0x48,%edi
call   1070 <putc@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <getc@plt>
jmp    1190 <gboot_main+0x30>

LLVM IR (-O0):
define i32 @gboot_main() {
%1 = alloca [2048 x i8]
%2 = call i32 (...) @led_init()
%3 = call i32 (...) @key_init()
%4 = call i32 (...) @init_irq()
%5 = call i32 (...) @uart_init()
%6 = call i32 @putc(i8 signext 72)
br label %7
7: ; preds = %0, %7
%8 = call i32 (...) @getc()
br label %7
}

LLVM IR (-O2):
define i32 @gboot_main() {
%1 = tail call i32 (...) @led_init()
%2 = tail call i32 (...) @key_init()
%3 = tail call i32 (...) @init_irq()
%4 = tail call i32 (...) @uart_init()
%5 = tail call i32 @putc(i8 signext 72)
br label %6
6: ; preds = %6, %0
%7 = tail call i32 (...) @getc()
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
size_t strlcpy(char *dst, const char *src, size_t size) {
  size_t srclen;
  size--;
  srclen = strlen(src);
  if (srclen > size)
    srclen = size;
  memcpy(dst, src, srclen);
  dst[srclen] = '\0';
  return (srclen);
}


x86 assembly (clang, -O0):
<strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1163 <strlcpy+0x43>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    -0x1(%rdx),%r12
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
cmp    %r12,%rax
cmova  %r12,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = icmp ugt i64 %5, %4
%7 = select i1 %6, i64 %4, i64 %5
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %7)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %9
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ Start_TP();
void main() {
  Start_TP();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Start_TP@plt>
jmp    111b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Start_TP@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @Start_TP()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @Start_TP()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ SYSCALL2(int, int, int, char const *);
void sys_write(int color, const char *str) {
  int res;
  SYSCALL2(8, res, color, str);
}


x86 assembly (clang, -O0):
<sys_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x8,%edi
call   1030 <SYSCALL2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_write>:
mov    %rsi,%rcx
mov    %edi,%edx
mov    $0x8,%edi
jmp    1030 <SYSCALL2@plt>

LLVM IR (-O0):
define void @sys_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @SYSCALL2(i32 8, i32 %6, i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @sys_write(i32 %0, i8* %1) {
%3 = tail call i32 @SYSCALL2(i32 8, i32 undef, i32 %0, i8* %1)
ret void
}
void *mem_malloc(u)
unsigned u;
{
  return mem_malloc_debug(
      u,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/"
      "master/CodeFix5/Code/MEM/mem.c",
      283);
}


x86 assembly (clang, -O0):
<mem_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x11b,%edx
mov    $0x0,%al
call   1030 <mem_malloc_debug@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_malloc>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x11b,%edx
xor    %eax,%eax
call   1030 <mem_malloc_debug@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_malloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 283)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_malloc(i32 %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_malloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 283)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
long ROUND(double value) {
  long intpart;
  intpart = (long)value;
  value = value - intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<ROUND>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114a <ROUND+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROUND>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0xeea(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @ROUND(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
store double %9, double* %2
%10 = load double, double* %2
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ROUND(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp oge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup_escape_xml(char *);
int main() {
  char *p = strdup_escape_xml("AAA");
  free(p);
  p = strdup_escape_xml("");
  free(p);
  p = strdup_escape_xml(NULL);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <strdup_escape_xml@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xeb4(%rip),%rdi
call   1040 <strdup_escape_xml@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strdup_escape_xml@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <strdup_escape_xml@plt>
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xec7(%rip),%rdi
call   1040 <strdup_escape_xml@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1040 <strdup_escape_xml@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"AAA\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i8* @strdup_escape_xml(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @free(i8* %1)
%3 = tail call i8* @strdup_escape_xml(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @free(i8* %3)
%5 = tail call i8* @strdup_escape_xml(i8* null)
%6 = tail call i32 @free(i8* %5)
ret i32 0
}
void SHA512_Update(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA512_Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
recall_register(char *p) {
  if (p)
    printf("recall_register: %s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<recall_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <recall_register+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recall_register>:
test   %rdi,%rdi
je     1129 <recall_register+0x19>
push   %rax
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"recall_register: %s\0A\00"
define i32 @recall_register(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"recall_register: %s\0A\00"
define i32 @recall_register(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  void x1(void);
  x1();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1030 <x1@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <x1@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void @x1()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *proc) {
  fprintf(stdout,
          "%s usage : \n"
          "%s [option] [INPUT] \n"
          "option is :\n"
          " --mapper | -m the command to execute in shell\n"
          " --count  | -c the process num in background\n"
          " --help   | -h \n"
          " --version| -v \n",
          proc, proc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    %rcx,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [170 x i8] c"%s usage : \0A%s [option] [INPUT] \0Aoption is :\0A --mapper | -m the command to execute in shell\0A --count | -c the process num in background\0A --help | -h \0A --version| -v \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [170 x i8] c"%s usage : \0A%s [option] [INPUT] \0Aoption is :\0A --mapper | -m the command to execute in shell\0A --count | -c the process num in background\0A --help | -h \0A --version| -v \0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
int test2(int c, int d) { return (c & d) ^ d; }


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

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
ret i32 %4
}
__typeof__(alloca(1)) test_alloca_85(void) { return alloca(1); }


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

x86 assembly (clang, -O2):
<test_alloca_85>:
lea    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @test_alloca_85() {
%1 = alloca i8, i64 1
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_alloca_85() {
%1 = alloca i8
ret i8* %1
}
/* Variables and functions */
int mystery(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int x;
  int y;
  printf("Enter two integer: ");
  scanf("%d%d", &x, &y);
  printf("The result is %d\n", mystery(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mystery@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <mystery@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Enter two integer: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @mystery(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
int fn1(int x, int y) {
  int tem1 = x | y;
  int tem2 = ~(x & y);
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LRDP(char *);
void uc2_special3() { LRDP("uc2:special3\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"uc2:special3\0A\00"
define void @uc2_special3() {
%1 = call i32 @LRDP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"uc2:special3\0A\00"
define void @uc2_special3() {
%1 = tail call i32 @LRDP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
double square(double x) { return (x * x); }


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

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

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

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
reg_list(list, reverse) {
  register rev_list, i;
  if (!reverse) {
    return list;
  }
  rev_list = 0;
  for (i = 0; i < 8; i++) {
    if (list & (1 << i)) {
      rev_list |= 1 << (7 - i);
    }
  }
  return rev_list;
}


x86 assembly (clang, -O0):
<reg_list>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <reg_list+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <reg_list+0x7f>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1179 <reg_list+0x79>
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1166 <reg_list+0x66>
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116b <reg_list+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <reg_list+0x2d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_list>:
mov    %edi,%eax
test   %esi,%esi
je     1128 <reg_list+0x28>
rol    $0x4,%al
mov    %eax,%ecx
and    $0x33,%cl
shl    $0x2,%cl
shr    $0x2,%al
and    $0x33,%al
or     %cl,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @reg_list(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = trunc i32 %0 to i8
%6 = call i8 @llvm.bitreverse.i8(i8 %5)
%7 = zext i8 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %0, %2 ], [ %7, %4 ]
ret i32 %9
}