xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x_root;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
int get_XButtonPressedEvent_x_root(void *_p) {
  return (int)((XButtonPressedEvent *)_p)->x_root;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XButtonPressedEvent_x_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
char lib_toupper(char c) {
  if ((c >= 'a') && (c <= 'z'))
    c -= 32;
  return c;
}


x86 assembly (clang, -O0):
<lib_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <lib_toupper+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <lib_toupper+0x2e>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_toupper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lib_toupper(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, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @lib_toupper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int rip_wav(FILE *fp) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @rip_wav(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void empty_error(const char *s) { printf("%s\n", s); }


x86 assembly (clang, -O0):
<empty_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @empty_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double pow(double, int);
double f(double x) { return pow(x - 1, 3); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addsd  0xee8(%rip),%xmm0
mov    $0x3,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = call double @pow(double %4, i32 3)
ret double %5
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = tail call double @pow(double %2, i32 3)
ret double %3
}
int dev(double i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dev(double %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ detail;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
int get_XFocusChangeEvent_detail(void *_p) {
  return (int)((XFocusChangeEvent *)_p)->detail;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XFocusChangeEvent_detail(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int qwerty(char layout[][96], int i) {
  strncpy(layout[i],
          " 1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./"
          "!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?",
          96);
  return 85;
}


x86 assembly (clang, -O0):
<qwerty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   $0x60,%rax,%rax
add    %rax,%rdi
lea    0xecb(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qwerty>:
push   %rax
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
add    %rax,%rdi
lea    0xeda(%rip),%rsi
mov    $0x60,%edx
call   1030 <strncpy@plt>
mov    $0x55,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [94 x i8] c" 1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\22ZXCVBNM<>?\00"
define i32 @qwerty([96 x i8]* %0, i32 %1) {
%3 = alloca [96 x i8]*
%4 = alloca i32
store [96 x i8]* %0, [96 x i8]** %3
store i32 %1, i32* %4
%5 = load [96 x i8]*, [96 x i8]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [96 x i8], [96 x i8]* %5, i64 %7
%9 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}

LLVM IR (-O2):
@.str = [94 x i8] c" 1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\22ZXCVBNM<>?\00"
define i32 @qwerty([96 x i8]* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [96 x i8], [96 x i8]* %0, i64 %3, i64 0
%5 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i32 96)
ret i32 85
}
void rdu_write_lock(struct rdu *p) {}


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

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

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

LLVM IR (-O2):
%struct.rdu = type opaque
define void @rdu_write_lock(%struct.rdu* nocapture %0) {
ret void
}
void mrdump_reserve_memory(void) {}


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

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

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

LLVM IR (-O2):
define void @mrdump_reserve_memory() {
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
scalar_t__ sprintf(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int create_timestamp(char *destination) {
  struct timeval currentStart;
  gettimeofday(&currentStart, 0);
  if (sprintf(destination, "%ld-%ld", currentStart.tv_sec,
              currentStart.tv_usec) < 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<create_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeb8(%rip),%rsi
call   1040 <sprintf@plt>
cmp    $0x0,%rax
jge    1163 <create_timestamp+0x43>
movl   $0x0,-0x4(%rbp)
jmp    116a <create_timestamp+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_timestamp>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edx
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [8 x i8] c"%ld-%ld\00"
define i32 @create_timestamp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.timeval
store i8* %0, i8** %3
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%6 = load i8*, i8** %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @sprintf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [8 x i8] c"%ld-%ld\00"
define i32 @create_timestamp(i8* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @sprintf(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = lshr i64 %9, 63
%11 = trunc i64 %10 to i32
%12 = xor i32 %11, 1
ret i32 %12
}
int compare_function(const void *a, const void *b) {
  float *x = (float *)a;
  float *y = (float *)b;
  if ((*x) < (*y))
    return -1;
  else if ((*x) > (*y))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1141 <compare_function+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <compare_function+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1162 <compare_function+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <compare_function+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_function>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_function(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
store float* %9, float** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
store float* %11, float** %7
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = fcmp olt float %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load float*, float** %6
%20 = load float, float* %19
%21 = load float*, float** %7
%22 = load float, float* %21
%23 = fcmp ogt float %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compare_function(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = fcmp ogt float %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int isSorted(int *arr, int n) {
  int flag = 1;
  for (int i = 0; i < n - 1; ++i) {
    if (arr[i] > arr[i + 1]) {
      flag = 0;
      break;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<isSorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116a <isSorted+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1157 <isSorted+0x57>
movl   $0x0,-0x10(%rbp)
jmp    116a <isSorted+0x6a>
jmp    115c <isSorted+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <isSorted+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSorted>:
add    $0xffffffff,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     1128 <isSorted+0x28>
mov    (%rdi,%rax,4),%ecx
lea    0x1(%rax),%rdx
cmp    0x4(%rdi,%rax,4),%ecx
mov    %rdx,%rax
jle    1110 <isSorted+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isSorted(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 1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = load i32*, i32** %3
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %3
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = icmp sgt i32 %17, %23
br i1 %24, label %25, label %26
25: ; preds = %12
store i32 0, i32* %5
br label %30
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %25, %7
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @isSorted(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %9, %6
%17 = phi i32 [ 1, %6 ], [ 0, %9 ]
ret i32 %17
}
void main(void) {
  int i;
  int j = 0;
  for (i = 0; i < 100; i++) {
    j++;
    j++;
    j++;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <main+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ file_delete(char const *);
int file_exists(char const *);
int /*<<< orphan*/ printf(char *, ...);
void file_delete_check(const char *path) {
  if (file_exists(path) == true) {
    file_delete(path);
  } else {
    if (true) {
      printf("DEBUG: ");
      printf("file_delete_check - File '%s' does not exist. Can not delete!\n",
             path);
    };
  }
}


x86 assembly (clang, -O0):
<file_delete_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file_exists@plt>
cmp    $0x1,%eax
jne    115c <file_delete_check+0x2c>
mov    -0x8(%rbp),%rdi
call   1050 <file_delete@plt>
jmp    117c <file_delete_check+0x4c>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_delete_check>:
push   %rbx
mov    %rdi,%rbx
call   1030 <file_exists@plt>
cmp    $0x1,%eax
jne    1147 <file_delete_check+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <file_delete@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"DEBUG: \00"
@.str.1 = [63 x i8] c"file_delete_check - File '%s' does not exist. Can not delete!\0A\00"
define void @file_delete_check(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_exists(i8* %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @file_delete(i8* %7)
br label %13
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"DEBUG: \00"
@.str.1 = [63 x i8] c"file_delete_check - File '%s' does not exist. Can not delete!\0A\00"
define void @file_delete_check(i8* %0) {
%2 = tail call i32 @file_exists(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @file_delete(i8* %0)
br label %9
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int nl_sendgetaddr_do(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, int);
int nl_sendgetaddrs6(int fd, uint32_t seq) {
  return nl_sendgetaddr_do(fd, seq, 0, 0, AF_INET6, 1);
}


x86 assembly (clang, -O0):
<nl_sendgetaddrs6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%r8d
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %ecx,%edx
call   1030 <nl_sendgetaddr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_sendgetaddrs6>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r9d
jmp    1030 <nl_sendgetaddr_do@plt>

LLVM IR (-O0):
@AF_INET6 = global i32 0
define i32 @nl_sendgetaddrs6(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 = load i32, i32* @AF_INET6
%8 = call i32 @nl_sendgetaddr_do(i32 %5, i32 %6, i32 0, i32 0, i32 %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
define i32 @nl_sendgetaddrs6(i32 %0, i32 %1) {
%3 = load i32, i32* @AF_INET6
%4 = tail call i32 @nl_sendgetaddr_do(i32 %0, i32 %1, i32 0, i32 0, i32 %3, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vsnprintf(char *, int, char const *const,
                             int /*<<< orphan*/);
void vprint_message(const char *const format, va_list args) {
  char buffer[1024];
  vsnprintf(buffer, sizeof(buffer), format, args);
  printf("%s", buffer);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<vprint_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprint_message>:
push   %rbx
sub    $0x400,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @vprint_message(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %7, i32 %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @vprint_message(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
void free_ip_address(struct addrinfo *addr) {
  if (addr != NULL)
    freeaddrinfo(addr);
}


x86 assembly (clang, -O0):
<free_ip_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_ip_address+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <freeaddrinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ip_address>:
test   %rdi,%rdi
je     111a <free_ip_address+0xa>
jmp    1030 <freeaddrinfo@plt>
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @free_ip_address(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = icmp ne %struct.addrinfo* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.addrinfo*, %struct.addrinfo** %2
%7 = call i32 @freeaddrinfo(%struct.addrinfo* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @free_ip_address(%struct.addrinfo* %0) {
%2 = icmp eq %struct.addrinfo* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @freeaddrinfo(%struct.addrinfo* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Scorelist_write();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Game_quit() {
  Scorelist_write();
  exit(0);
}


x86 assembly (clang, -O0):
<Game_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Scorelist_write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Game_quit>:
push   %rax
xor    %eax,%eax
call   1030 <Scorelist_write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Game_quit() {
%1 = call i32 (...) @Scorelist_write()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Game_quit() {
%1 = tail call i32 (...) @Scorelist_write()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *, char *,
                          char *, char *);
void testapos(char *pieces, char *color, char *castle, char *enpassant,
              char *halfmove, char *fullmove) {
  char *p1 = "8/8/8/8/4BB2/1K6/7p/k7 w - - 0 1";
  sscanf(p1, "%s %s %s %s %s %s", pieces, color, castle, enpassant, halfmove,
         fullmove);
}


x86 assembly (clang, -O0):
<testapos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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)
lea    0xec9(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
lea    0xec3(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sscanf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testapos>:
push   %rax
mov    %r9,%rax
mov    %r8,%r10
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xed6(%rip),%rdi
lea    0xef0(%rip),%rsi
push   %rax
push   %r10
call   1030 <sscanf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"8/8/8/8/4BB2/1K6/7p/k7 w - - 0 1\00"
@.str.1 = [18 x i8] c"%s %s %s %s %s %s\00"
define void @testapos(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %13
%14 = load i8*, i8** %13
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i8*, i8** %12
%21 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16, i8* %17, i8* %18, i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"8/8/8/8/4BB2/1K6/7p/k7 w - - 0 1\00"
@.str.1 = [18 x i8] c"%s %s %s %s %s %s\00"
define void @testapos(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @sscanf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ch_log_out_(int /*<<< orphan*/, int, char *, char *, char *,
                                char *);
int ch_options_tail(char *description) {
  (void)description;
  _ch_log_out_(0, 145,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/mgrosvenor/libchaste/refs/"
               "heads/master/options/options.c",
               "Function unimplemented", "", "");
  return 0;
}


x86 assembly (clang, -O0):
<ch_options_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x91,%esi
lea    0xed6(%rip),%rdx
lea    0xf62(%rip),%rcx
lea    0xf5a(%rip),%r9
mov    %r9,%r8
call   1030 <_ch_log_out_@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_options_tail>:
push   %rax
lea    0xee8(%rip),%rdx
lea    0xf74(%rip),%rcx
lea    0xf6c(%rip),%r8
xor    %edi,%edi
mov    $0x91,%esi
mov    %r8,%r9
call   1030 <_ch_log_out_@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mgrosvenor/libchaste/refs/heads/master/options/options.c\00"
@.str.1 = [23 x i8] c"Function unimplemented\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @ch_options_tail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_ch_log_out_(i32 0, i32 145, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mgrosvenor/libchaste/refs/heads/master/options/options.c\00"
@.str.1 = [23 x i8] c"Function unimplemented\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @ch_options_tail(i8* nocapture readnone %0) {
%2 = tail call i32 @_ch_log_out_(i32 0, i32 145, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ssds_get_gen_name(int, char *, char *, char *, char *, int);
int ssds_get_class_name(int pcfd, char *class_def, char *res, int len) {
  return ssds_get_gen_name(pcfd, class_def, "gc", "name", res, len);
}


x86 assembly (clang, -O0):
<ssds_get_class_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
lea    0xec4(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1030 <ssds_get_gen_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_class_name>:
mov    %ecx,%r9d
mov    %rdx,%r8
lea    0xee3(%rip),%rdx
lea    0xedf(%rip),%rcx
jmp    1030 <ssds_get_gen_name@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gc\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @ssds_get_class_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_get_gen_name(i32 %9, i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"gc\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @ssds_get_class_name(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_get_gen_name(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
void strncpyt(char *dst, char *src, int dstsize) {
  int len = strlen(src);
  if (len >= dstsize)
    len = dstsize - 1;
  memcpy(dst, src, len);
  dst[len] = '\0';
}


x86 assembly (clang, -O0):
<strncpyt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1154 <strncpyt+0x34>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpyt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rbx),%ebp
cmp    %ebx,%eax
cmovl  %eax,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,(%r15,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strncpyt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %4, %2
%6 = add nsw i32 %2, -1
%7 = select i1 %5, i32 %4, i32 %6
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
struct rt2501buffer *rt2501_receive(void) {}


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

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

LLVM IR (-O0):
%struct.rt2501buffer = type opaque
define %struct.rt2501buffer* @rt2501_receive() {
%1 = alloca %struct.rt2501buffer*
%2 = load %struct.rt2501buffer*, %struct.rt2501buffer** %1
ret %struct.rt2501buffer* %2
}

LLVM IR (-O2):
%struct.rt2501buffer = type opaque
define noalias %struct.rt2501buffer* @rt2501_receive() {
ret %struct.rt2501buffer* undef
}
void SHA2ClearDigestAvailableFlag(void) {
  (*((volatile unsigned long *)(0x40024000 + 0x00000680))) =
      (*((volatile unsigned long *)(0x40024000 + 0x00000680)));
}


x86 assembly (clang, -O0):
<SHA2ClearDigestAvailableFlag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40024680,%eax
mov    (%rax),%rcx
mov    $0x40024680,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA2ClearDigestAvailableFlag>:
mov    0x40024680,%rax
40
mov    %rax,0x40024680
40
ret

LLVM IR (-O0):
define void @SHA2ClearDigestAvailableFlag() {
%1 = load volatile i64, i64* inttoptr (i64 1073890944 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1073890944 to i64*)
ret void
}

LLVM IR (-O2):
define void @SHA2ClearDigestAvailableFlag() {
%1 = load volatile i64, i64* inttoptr (i64 1073890944 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1073890944 to i64*)
ret void
}
int isAlphanumeric(char c) {
  if ('A' <= c && 'Z' >= c) {
    return 1;
  }
  if ('a' <= c && 'z' >= c) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isAlphanumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1138 <isAlphanumeric+0x38>
movsbl -0x5(%rbp),%ecx
mov    $0x5a,%eax
cmp    %ecx,%eax
jl     1138 <isAlphanumeric+0x38>
movl   $0x1,-0x4(%rbp)
jmp    116d <isAlphanumeric+0x6d>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1166 <isAlphanumeric+0x66>
movsbl -0x5(%rbp),%ecx
mov    $0x7a,%eax
cmp    %ecx,%eax
jl     1166 <isAlphanumeric+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <isAlphanumeric+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlphanumeric>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isAlphanumeric(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 65, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 90, %9
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 97, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 122, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @isAlphanumeric(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned int tolower(char);
unsigned int hash_stri(char *str) {
  unsigned int hash = 0;
  for (; *str; str++)
    hash = (hash * 32) - hash + tolower(*str);
  return hash;
}


x86 assembly (clang, -O0):
<hash_stri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <hash_stri+0x53>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <hash_stri+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_stri>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114e <hash_stri+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebp
shl    $0x5,%ebp
sub    %eax,%ebp
movsbl %cl,%edi
call   1030 <tolower@plt>
add    %ebp,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash_stri+0x20>
jmp    1150 <hash_stri+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hash_stri(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul i32 %9, 32
%11 = load i32, i32* %3
%12 = sub i32 %10, %11
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = call i32 @tolower(i8 signext %14)
%16 = add i32 %12, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %8
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash_stri(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = tail call i32 @tolower(i8 signext %5)
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int verify_record(void *record) {
  (void)record;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @verify_record(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR80_set(void) { return U_WMRCORENONE_set("U_WMR80"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR80\00"
define i8* @U_WMR80_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR80\00"
define i8* @U_WMR80_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char DigitToChar(unsigned int Digit) {
  Digit += 0x30;
  return Digit;
}


x86 assembly (clang, -O0):
<DigitToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DigitToChar>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @DigitToChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 48
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @DigitToChar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
int __bch_count_data(struct btree *b) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.btree = type opaque
define i32 @__bch_count_data(%struct.btree* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ changeBuffer();
int /*<<< orphan*/ fill_rect(int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                             int);
int /*<<< orphan*/ initScreenAndCtrl();
void init_app() {
  initScreenAndCtrl();
  fill_rect(0, 0, 480, 272, 0x0);
  changeBuffer();
}


x86 assembly (clang, -O0):
<init_app>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initScreenAndCtrl@plt>
xor    %r8d,%r8d
mov    $0x1e0,%edx
mov    $0x110,%ecx
mov    %r8d,%edi
mov    %r8d,%esi
call   1050 <fill_rect@plt>
mov    $0x0,%al
call   1030 <changeBuffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_app>:
push   %rax
xor    %eax,%eax
call   1040 <initScreenAndCtrl@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1e0,%edx
mov    $0x110,%ecx
xor    %r8d,%r8d
call   1050 <fill_rect@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <changeBuffer@plt>

LLVM IR (-O0):
define void @init_app() {
%1 = call i32 (...) @initScreenAndCtrl()
%2 = call i32 @fill_rect(i32 0, i32 0, i32 480, i32 272, i32 0)
%3 = call i32 (...) @changeBuffer()
ret void
}

LLVM IR (-O2):
define void @init_app() {
%1 = tail call i32 (...) @initScreenAndCtrl()
%2 = tail call i32 @fill_rect(i32 0, i32 0, i32 480, i32 272, i32 0)
%3 = tail call i32 (...) @changeBuffer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
#define ASN1_PKEY_CTRL_DEFAULT_MD_NID 128
int NID_id_Gost28147_89_MAC;
int mac_ctrl_gost(EVP_PKEY *pkey, int op, long arg1, void *arg2) {
  switch (op) {
  case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
    *(int *)arg2 = NID_id_Gost28147_89_MAC;
    return 2;
  }
  return -2;
}


x86 assembly (clang, -O0):
<mac_ctrl_gost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
jne    1141 <mac_ctrl_gost+0x41>
jmp    1126 <mac_ctrl_gost+0x26>
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1148 <mac_ctrl_gost+0x48>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_ctrl_gost>:
mov    $0xfffffffe,%eax
cmp    $0x80,%esi
jne    111d <mac_ctrl_gost+0x1d>
mov    0x2ee4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rcx)
mov    $0x2,%eax
ret

LLVM IR (-O0):
@NID_id_Gost28147_89_MAC = global i32 0
define i32 @mac_ctrl_gost(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
%10 = load i32, i32* %7
switch i32 %10, label %15 [
i32 128, label %11
]
11: ; preds = %4
%12 = load i32, i32* @NID_id_Gost28147_89_MAC
%13 = load i8*, i8** %9
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
store i32 2, i32* %5
br label %16
15: ; preds = %4
store i32 -2, i32* %5
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@NID_id_Gost28147_89_MAC = global i32 0
define i32 @mac_ctrl_gost(i32* nocapture readnone %0, i32 %1, i64 %2, i8* nocapture writeonly %3) {
%5 = icmp eq i32 %1, 128
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i32, i32* @NID_id_Gost28147_89_MAC
%8 = bitcast i8* %3 to i32*
store i32 %7, i32* %8
br label %9
9: ; preds = %4, %6
%10 = phi i32 [ 2, %6 ], [ -2, %4 ]
ret i32 %10
}