xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ random_range(int, int);
int roll_dice(int amount, int size) {
  int i;
  int result = 0;
  for (i = 1; i <= amount; i++) {
    result += random_range(1, size);
  }
  return result;
}


x86 assembly (clang, -O0):
<roll_dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1160 <roll_dice+0x50>
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <random_range@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <roll_dice+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_dice>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1136 <roll_dice+0x26>
mov    %esi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
nop
mov    $0x1,%edi
mov    %r14d,%esi
call   1030 <random_range@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <roll_dice+0x10>
jmp    1138 <roll_dice+0x28>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @roll_dice(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
store i32 0, i32* %6
store i32 1, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %4
%13 = call i64 @random_range(i32 1, i32 %12)
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @roll_dice(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 1, %2 ]
%7 = tail call i64 @random_range(i32 1, i32 %1)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add nuw i32 %6, 1
%11 = icmp eq i32 %6, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SYS_mprotect;
int syscall(int /*<<< orphan*/, void *, size_t, int);
int gotcha_mprotect(void *addr, size_t len, int prot) {
  return syscall(SYS_mprotect, addr, len, prot);
}


x86 assembly (clang, -O0):
<gotcha_mprotect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_mprotect>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_mprotect = global i32 0
define i32 @gotcha_mprotect(i8* %0, i64 %1, i32 %2) {
%4 = load i32, i32* @SYS_mprotect
%5 = tail call i32 @syscall(i32 %4, i8* %0, i64 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
unsigned char *chacha20_encrypt(unsigned char *, size_t *,
                                unsigned char const *, size_t,
                                unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_chacha20(unsigned char *out, size_t *out_len,
                                      const unsigned char *in, size_t in_len,
                                      const unsigned char *nonce,
                                      const unsigned char *key) {
  return chacha20_encrypt(out, out_len, in, in_len, nonce, key);
}


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

x86 assembly (clang, -O2):
<crypt_encrypt_chacha20>:
jmp    1030 <chacha20_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_chacha20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha20_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_chacha20(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha20_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int strlen(char *);
void removeNewLine(char *str) {
  int inputLenght = strlen(str);
  str[inputLenght - 1] = '\0';
}


x86 assembly (clang, -O0):
<removeNewLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeNewLine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @removeNewLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @removeNewLine(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
__attribute__((always_)) void writel(unsigned int b, volatile void *addr) {
  *(volatile unsigned int *)addr = b;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @writel(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
int fun201() { return 201; }


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

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

LLVM IR (-O0):
define i32 @fun201() {
ret i32 201
}

LLVM IR (-O2):
define i32 @fun201() {
ret i32 201
}
float *vec3_zero(float *result) {
  result[0] = 0.0f;
  result[1] = 0.0f;
  result[2] = 0.0f;
  return result;
}


x86 assembly (clang, -O0):
<vec3_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_zero>:
mov    %rdi,%rax
movq   $0x0,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @vec3_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
ret float* %9
}

LLVM IR (-O2):
define float* @vec3_zero(float* returned writeonly %0) {
store float 0.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
void dumpVec(double *v) { printf("v{%f, %f, %f}\n", v[0], v[1], v[2]); }


x86 assembly (clang, -O0):
<dumpVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpVec>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"v{%f, %f, %f}\0A\00"
define void @dumpVec(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printSubStr(char *str, int low, int high) {
  for (int i = low; i <= high; ++i)
    printf("%c", str[i]);
}


x86 assembly (clang, -O0):
<printSubStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     115a <printSubStr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xebd(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <printSubStr+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSubStr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1156 <printSubStr+0x46>
mov    %edx,%r12d
mov    %rdi,%r14
movslq %esi,%rax
add    %rax,%r14
sub    %esi,%r12d
add    $0x1,%r12d
xor    %ebx,%ebx
lea    0xec8(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <printSubStr+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printSubStr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printSubStr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = add i32 %2, 1
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %5, %9
%10 = phi i64 [ %6, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
%14 = add nsw i64 %10, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %7, %15
br i1 %16, label %8, label %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, size_t);
int /*<<< orphan*/ stderr;
void *x_calloc(size_t nmemb, size_t size) {
  void *r = calloc(nmemb, size);
  if (!r) {
    fprintf(stderr, "Fatal: calloc(%lu, %lu) failed\n", nmemb, size);
    exit(EXIT_FAILURE);
  }
  return r;
}


x86 assembly (clang, -O0):
<x_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1187 <x_calloc+0x57>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Fatal: calloc(%lu, %lu) failed\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Fatal: calloc(%lu, %lu) failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ refresh();
void end_ncenv() {
  erase();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<end_ncenv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <erase@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_ncenv>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <endwin@plt>

LLVM IR (-O0):
define void @end_ncenv() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @end_ncenv() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void rewirepointers(void) { nocall("rewirepointers"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"rewirepointers\00"
define void @rewirepointers() {
%1 = call i32 @nocall(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"rewirepointers\00"
define void @rewirepointers() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int gz_finish(struct coredump_params *cprm) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.coredump_params = type opaque
define i32 @gz_finish(%struct.coredump_params* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ CounterToLocalTimeC__1__Counter__overflow();
int /*<<< orphan*/ TransformAlarmC__1__Counter__overflow();
void TransformCounterC__1__Counter__overflow(void) {
  TransformAlarmC__1__Counter__overflow();
  CounterToLocalTimeC__1__Counter__overflow();
}


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

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

LLVM IR (-O0):
define void @TransformCounterC__1__Counter__overflow() {
%1 = call i32 (...) @TransformAlarmC__1__Counter__overflow()
%2 = call i32 (...) @CounterToLocalTimeC__1__Counter__overflow()
ret void
}

LLVM IR (-O2):
define void @TransformCounterC__1__Counter__overflow() {
%1 = tail call i32 (...) @TransformAlarmC__1__Counter__overflow()
%2 = tail call i32 (...) @CounterToLocalTimeC__1__Counter__overflow()
ret void
}
int test_imm_97int8_mem(signed char *val) {
  return ((*val) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97int8_mem>:
testb  $0x97,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_97int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int int_minus(int x, int y, int index) { return x - y; }


x86 assembly (clang, -O0):
<int_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_minus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_minus(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(scalar_t__ volatile);
uint32_t SSIClockSourceGet(uint32_t ui32Base) {
  ASSERT(_SSIBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000FC8))));
}


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

x86 assembly (clang, -O2):
<SSIClockSourceGet>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    (%rsp),%rax
mov    0xfc8(%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @SSIClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = call i32 @_SSIBaseValid(i64 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @SSIClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = tail call i32 @_SSIBaseValid(i64 %3)
%5 = tail call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ch_crc32_update(int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/, int *);
uint32_t ch_crc32(const uint8_t *s, uint64_t n) {
  uint32_t crc = 0xffffffffU;
  ch_crc32_update(s, n, &crc);
  return crc ^ 0xffffffffU;
}


x86 assembly (clang, -O0):
<ch_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ch_crc32_update@plt>
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_crc32>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rdx
call   1030 <ch_crc32_update@plt>
mov    0x4(%rsp),%eax
not    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ch_crc32(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i32 @ch_crc32_update(i32* %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
%7 = xor i32 %6, -1
ret i32 %7
}
void ncr53c810_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @ncr53c810_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int numero;
  printf("Informe um numero: ");
  scanf("%d", &numero);
  printf(numero % 2 == 0 ? "Par" : "impa");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
lea    0xec5(%rip),%rdi
lea    0xeba(%rip),%rax
cmp    $0x0,%edx
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xecd(%rip),%rax
lea    0xeca(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Informe um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"Par\00"
@.str.3 = [5 x i8] c"impa\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"Par\00"
@.str.3 = [5 x i8] c"impa\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int double_to_bits(double);
int isnormal(double x) {
  unsigned long exponent = (double_to_bits(x) >> 52) & 0x7ff;
  return exponent > 0 && exponent < 2047;
}


x86 assembly (clang, -O0):
<isnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
mov    $0x34,%ecx
sar    %cl,%eax
and    $0x7ff,%eax
cltq
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1157 <isnormal+0x47>
cmpq   $0x7ff,-0x10(%rbp)
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnormal>:
jmp    1030 <double_to_bits@plt>

LLVM IR (-O0):
define i32 @isnormal(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @double_to_bits(double %4)
%6 = ashr i32 %5, 52
%7 = and i32 %6, 2047
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = icmp ult i64 %12, 2047
br label %14
14: ; preds = %11, %1
%15 = phi i1 [ false, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isnormal(double %0) {
%2 = tail call i32 @double_to_bits(double %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ generateRandomBufferCyclic(char *, size_t, long, size_t);
void generateRandomBuffer(char *buffer, size_t size, long seed) {
  generateRandomBufferCyclic(buffer, size, seed, size);
}


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

x86 assembly (clang, -O2):
<generateRandomBuffer>:
mov    %rsi,%rcx
jmp    1030 <generateRandomBufferCyclic@plt>

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

LLVM IR (-O2):
define void @generateRandomBuffer(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @generateRandomBufferCyclic(i8* %0, i64 %1, i64 %2, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void ut_file_close(FILE **file) {
  if (file == NULL || *file == NULL)
    return;
  fclose(*file);
  *file = NULL;
}


x86 assembly (clang, -O0):
<ut_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <ut_file_close+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <ut_file_close+0x2a>
jmp    1151 <ut_file_close+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_file_close>:
push   %rbx
test   %rdi,%rdi
je     112d <ut_file_close+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ut_file_close+0x1d>
call   1030 <fclose@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ut_file_close(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fclose(i32* %4)
store i32* null, i32** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
_Bool SignalingGreaterEqual(float f1, float f2) { return f1 >= f2; }


x86 assembly (clang, -O0):
<SignalingGreaterEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignalingGreaterEqual>:
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define zeroext i1 @SignalingGreaterEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @SignalingGreaterEqual(float %0, float %1) {
%3 = fcmp oge float %0, %1
ret i1 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int _drawtext(int, int /*<<< orphan*/, int, char const *, int /*<<< orphan*/);
int drawtext_getwidth(int x, int y, const char *str, uint16_t length) {
  return _drawtext(x, INT_MAX, y, str, length) - x;
}


x86 assembly (clang, -O0):
<drawtext_getwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   1030 <_drawtext@plt>
sub    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtext_getwidth>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
call   1030 <_drawtext@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @drawtext_getwidth(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* @INT_MAX
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @_drawtext(i32 %9, i32 %10, i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @drawtext_getwidth(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @INT_MAX
%6 = tail call i32 @_drawtext(i32 %0, i32 %5, i32 %1, i8* %2, i32 %3)
%7 = sub nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void cleaner() { write(STDOUT_FILENO, "\n", 1); }


x86 assembly (clang, -O0):
<cleaner>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleaner>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @cleaner() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @cleaner() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void hpgl_close(void) { ; }


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

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

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

LLVM IR (-O2):
define void @hpgl_close() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ put_pixel;
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void *get_XImage_f_put_pixel(void *_p) {
  return (void *)((XImage *)_p)->f.put_pixel;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XImage_f_put_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ stream_write_record(int, int, void const *, int);
void streamWriteRecordF(int streamID, const float *data, int nmiss) {
  stream_write_record(streamID, 2, (const void *)data, nmiss);
}


x86 assembly (clang, -O0):
<streamWriteRecordF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x2,%esi
call   1030 <stream_write_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streamWriteRecordF>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <stream_write_record@plt>

LLVM IR (-O0):
define void @streamWriteRecordF(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = bitcast float* %8 to i8*
%10 = load i32, i32* %6
%11 = call i32 @stream_write_record(i32 %7, i32 2, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @streamWriteRecordF(i32 %0, float* %1, i32 %2) {
%4 = bitcast float* %1 to i8*
%5 = tail call i32 @stream_write_record(i32 %0, i32 2, i8* %4, i32 %2)
ret void
}
int test23(int a, int b, int c, int d) {
  int x = a != b;
  int y = c != 0;
  return x + y;
}


x86 assembly (clang, -O0):
<test23>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test23>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
xor    %eax,%eax
test   %edx,%edx
setne  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test23(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test23(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp ne i32 %2, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: dnswatch interval command hostname [hostname ...]\n");
  exit(4);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: dnswatch interval command hostname [hostname ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: dnswatch interval command hostname [hostname ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 4)
unreachable
}
void dont_swap_buffers(struct gl_test *c) { (void)c; }


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

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

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

LLVM IR (-O2):
%struct.gl_test = type opaque
define void @dont_swap_buffers(%struct.gl_test* nocapture %0) {
ret void
}
void rop3_206_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_206_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_206_1_0>:
not    %dl
or     %sil,%dl
and    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_206_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_206_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, -1
%6 = or i8 %5, %1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ fs_close(int);
int fs_open(char *, int);
int fs_read(int, void *, size_t);
ssize_t fs_load_file(char *filename, void *buf, size_t size) {
  ssize_t count;
  int fd;
  if ((fd = fs_open(filename, 0x01)) == -1)
    return -1;
  count = fs_read(fd, buf, size);
  fs_close(fd);
  return count;
}


x86 assembly (clang, -O0):
<fs_load_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fs_open@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
jne    116a <fs_load_file+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    118b <fs_load_file+0x5b>
mov    -0x28(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <fs_read@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%edi
call   1050 <fs_close@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_load_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x1,%esi
call   1030 <fs_open@plt>
cmp    $0xffffffff,%eax
je     1165 <fs_load_file+0x35>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <fs_read@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <fs_close@plt>
mov    %ebx,%eax
jmp    116a <fs_load_file+0x3a>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fs_load_file(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @fs_open(i8* %0, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fs_read(i32 %4, i8* %1, i64 %2)
%8 = tail call i32 @fs_close(i32 %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
int main() { f2(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f2(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f2(i32 1)
ret i32 0
}
/* Variables and functions */
bool fspath_is_symlink(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_is_symlink(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_program;
typedef int /*<<< orphan*/ *cl_kernel;
typedef int /*<<< orphan*/ cl_context;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int CreateKernel(cl_kernel *kernel, cl_context ctx, cl_program program) {
  assert(*kernel != NULL);
  return 0;
}


x86 assembly (clang, -O0):
<CreateKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateKernel>:
push   %rax
xor    %eax,%eax
cmpq   $0x0,(%rdi)
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CreateKernel(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32**, i32*** %4
%8 = load i32*, i32** %7
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @CreateKernel(i32** nocapture %0, i32 %1, i32 %2) {
%4 = load i32*, i32** %0
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}