xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
char *get_csv_file_name(char *book_file_name) {
  char *rtr_val = book_file_name;
  int length = strlen(book_file_name);
  rtr_val[length - 3] = 'c';
  rtr_val[length - 2] = 's';
  rtr_val[length - 1] = 'v';
  return rtr_val;
}


x86 assembly (clang, -O0):
<get_csv_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movb   $0x63,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x73,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x76,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @get_csv_file_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 99, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 115, i8* %17
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 118, i8* %22
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @get_csv_file_name(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 99, i8* %5
%6 = add nsw i32 %2, -2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 115, i8* %8
%9 = add nsw i32 %2, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 118, i8* %11
ret i8* %0
}
void function_c() {
  asm volatile("mov $60, %rax\n"
               "xor %rdi, %rdi\n"
               "syscall");
}


x86 assembly (clang, -O0):
<function_c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%rax
xor    %rdi,%rdi
syscall
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_c>:
mov    $0x3c,%rax
xor    %rdi,%rdi
syscall
ret

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

LLVM IR (-O2):
define void @function_c() {
tail call void asm sideeffect "mov $$60, %rax\0Axor %rdi, %rdi\0Asyscall", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void print_double(struct printf_format *format, double data) {}


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

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

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

LLVM IR (-O2):
%struct.printf_format = type opaque
define void @print_double(%struct.printf_format* nocapture %0, double %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, int, int,
                           int);
void usage(FILE *file, const char *arg0) {
  fprintf(file,
          "Usage: %s [options] path ...\n"
          "Options:\n"
          "  -h     Print this message\n"
          "  -j N   Operate on N files at a time (default %d)\n"
          "  -e P   Exclude files matching P\n"
          "  -g[F]  At least F times (default %d) the average size (default)\n"
          "  -l[F]  At most 1/F times (default %d) the average size\n",
          arg0, 4, 10, 100);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x4,%ecx
mov    $0xa,%r8d
mov    $0x64,%r9d
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x4,%ecx
mov    $0xa,%r8d
mov    $0x64,%r9d
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [275 x i8] c"Usage: %s [options] path ...\0AOptions:\0A -h Print this message\0A -j N Operate on N files at a time (default %d)\0A -e P Exclude files matching P\0A -g[F] At least F times (default %d) the average size (default)\0A -l[F] At most 1/F times (default %d) the average size\0A\00"
define void @usage(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([275 x i8], [275 x i8]* @.str, i64 0, i64 0), i8* %6, i32 4, i32 10, i32 100)
ret void
}

LLVM IR (-O2):
@.str = [275 x i8] c"Usage: %s [options] path ...\0AOptions:\0A -h Print this message\0A -j N Operate on N files at a time (default %d)\0A -e P Exclude files matching P\0A -g[F] At least F times (default %d) the average size (default)\0A -l[F] At most 1/F times (default %d) the average size\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([275 x i8], [275 x i8]* @.str, i64 0, i64 0), i8* %1, i32 4, i32 10, i32 100)
ret void
}
void nested(char *a) {
  while (*a) {
    while (*a) {
      a++;
    }
    a++;
  }
}


x86 assembly (clang, -O0):
<nested>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <nested+0x49>
jmp    111a <nested+0x1a>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1138 <nested+0x38>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111a <nested+0x1a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <nested+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nested(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %3
br label %8
8: ; preds = %12, %7
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %8
15: ; preds = %8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @nested(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int __int16_t_encoded_array_size(const int16_t *p, int elements) {
  (void)p;
  return sizeof(int16_t) * elements;
}


x86 assembly (clang, -O0):
<__int16_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int16_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int16_t_encoded_array_size(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__int16_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_divide_by_two(void) {
  output_line("asra");
  output_line("rorb");
}


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

x86 assembly (clang, -O2):
<gen_divide_by_two>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <output_line@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <output_line@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"asra\00"
@.str.1 = [5 x i8] c"rorb\00"
define void @gen_divide_by_two() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"asra\00"
@.str.1 = [5 x i8] c"rorb\00"
define void @gen_divide_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *test_anti_range_124(signed char n) {
  extern void *alloc_anti_range_124(signed char) __attribute__((alloc_size(1)));
  if ((-0x7f - 1) + 2 <= n && n <= 1)
    n = (-0x7f - 1) + 2 - 1;
  return alloc_anti_range_124(n);
}


x86 assembly (clang, -O0):
<test_anti_range_124>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xffffff82,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_124+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jg     1140 <test_anti_range_124+0x30>
movb   $0x81,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_124@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_124>:
mov    %edi,%eax
add    $0x7e,%al
mov    $0x81,%eax
cmovs  %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_124@plt>

LLVM IR (-O0):
define i8* @test_anti_range_124(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 -126, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -127, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_124(i8 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_124(i8 signext %0) {
%2 = add i8 %0, 126
%3 = icmp sgt i8 %2, -1
%4 = select i1 %3, i8 -127, i8 %0
%5 = tail call i8* @alloc_anti_range_124(i8 signext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char nome[100];
  printf("Digite seu nome completo : ");
  gets(nome);
  printf("Seu nome completo e : ");
  puts(nome);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Digite seu nome completo : \00"
@.str.1 = [23 x i8] c"Seu nome completo e : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Digite seu nome completo : \00"
@.str.1 = [23 x i8] c"Seu nome completo e : \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
struct _RuntimeStack {
  int dummy;
};

/* Variables and functions */
struct _RuntimeStack *_frame_until(int, int);
struct _RuntimeStack *_pop_frame_until(int tag) {
  return _frame_until(tag, 1);
}


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

x86 assembly (clang, -O2):
<_pop_frame_until>:
mov    $0x1,%esi
jmp    1030 <_frame_until@plt>

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

LLVM IR (-O2):
%struct._RuntimeStack = type { i32 }
define %struct._RuntimeStack* @_pop_frame_until(i32 %0) {
%2 = tail call %struct._RuntimeStack* @_frame_until(i32 %0, i32 1)
ret %struct._RuntimeStack* %2
}
int xmlUCSIsBopomofo(int code) {
  return (((code >= 0x3100) && (code <= 0x312F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsBopomofo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3100,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsBopomofo+0x26>
cmpl   $0x312f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsBopomofo>:
add    $0xffffcf00,%edi
xor    %eax,%eax
cmp    $0x30,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsBopomofo(i32 %0) {
%2 = add i32 %0, -12544
%3 = icmp ult i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  a += 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 2
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
struct SocketBuffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ buffRead(int, struct SocketBuffer *);
unsigned char readByte(struct SocketBuffer *buff) {
  return (*(unsigned char *)buffRead(sizeof(char), buff));
}


x86 assembly (clang, -O0):
<readByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <buffRead@plt>
movzbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readByte>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <buffRead@plt>
mov    (%rax),%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.SocketBuffer = type { i32 }
define zeroext i8 @readByte(%struct.SocketBuffer* %0) {
%2 = alloca %struct.SocketBuffer*
store %struct.SocketBuffer* %0, %struct.SocketBuffer** %2
%3 = load %struct.SocketBuffer*, %struct.SocketBuffer** %2
%4 = call i64 @buffRead(i32 1, %struct.SocketBuffer* %3)
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
%struct.SocketBuffer = type { i32 }
define zeroext i8 @readByte(%struct.SocketBuffer* %0) {
%2 = tail call i64 @buffRead(i32 1, %struct.SocketBuffer* %0)
%3 = inttoptr i64 %2 to i8*
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ safeExitErr(char *);
void *safeMalloc(size_t size) {
  void *mem = malloc(size);
  if (size && !mem)
    safeExitErr("Not enough memory");
  return mem;
}


x86 assembly (clang, -O0):
<safeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <safeMalloc+0x3b>
cmpq   $0x0,-0x10(%rbp)
jne    115b <safeMalloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <safeExitErr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <safeMalloc+0x25>
test   %r14,%r14
jne    1145 <safeMalloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <safeExitErr@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @safeMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @safeExitErr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"Not enough memory\00"
define noalias i8* @safeMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @safeExitErr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fill_matrix(int **, int, int, char);
int /*<<< orphan*/ mark_one_cluster_aux(int **, int **, int **, int, int, int *,
                                        int);
void mark_one_cluster(int **site_marks, int **vbonds, int **hbonds, int M,
                      int N, int A1[2], int mark_value) {
  fill_matrix(site_marks, M, N, '.');
  mark_one_cluster_aux(site_marks, vbonds, hbonds, M, N, A1, mark_value);
}


x86 assembly (clang, -O0):
<mark_one_cluster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    $0x2e,%ecx
call   1030 <fill_matrix@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <mark_one_cluster_aux@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_one_cluster>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8d,%r13d
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbp
mov    %ecx,%esi
mov    %r8d,%edx
mov    $0x2e,%ecx
call   1030 <fill_matrix@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mark_one_cluster_aux@plt>

LLVM IR (-O0):
define void @mark_one_cluster(i32** %0, i32** %1, i32** %2, i32 %3, i32 %4, i32* %5, i32 %6) {
%8 = alloca i32**
%9 = alloca i32**
%10 = alloca i32**
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
store i32** %0, i32*** %8
store i32** %1, i32*** %9
store i32** %2, i32*** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i32 %6, i32* %14
%15 = load i32**, i32*** %8
%16 = load i32, i32* %11
%17 = load i32, i32* %12
%18 = call i32 @fill_matrix(i32** %15, i32 %16, i32 %17, i8 signext 46)
%19 = load i32**, i32*** %8
%20 = load i32**, i32*** %9
%21 = load i32**, i32*** %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32*, i32** %13
%25 = load i32, i32* %14
%26 = call i32 @mark_one_cluster_aux(i32** %19, i32** %20, i32** %21, i32 %22, i32 %23, i32* %24, i32 %25)
ret void
}

LLVM IR (-O2):
define void @mark_one_cluster(i32** %0, i32** %1, i32** %2, i32 %3, i32 %4, i32* %5, i32 %6) {
%8 = tail call i32 @fill_matrix(i32** %0, i32 %3, i32 %4, i8 signext 46)
%9 = tail call i32 @mark_one_cluster_aux(i32** %0, i32** %1, i32** %2, i32 %3, i32 %4, i32* %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_msg(char *);
char *expand_pkgdatadir(void) {
  error_msg("The $PKGDATADIR variable was removed in dte v1.4");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"The $PKGDATADIR variable was removed in dte v1.4\00"
define i8* @expand_pkgdatadir() {
%1 = call i32 @error_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [49 x i8] c"The $PKGDATADIR variable was removed in dte v1.4\00"
define noalias i8* @expand_pkgdatadir() {
%1 = tail call i32 @error_msg(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int __llair_choice();
int main() {
  int n = 0;
  int b = __llair_choice();
  for (int i = 0; i < b; i++) {
    n += i;
  }
  return n;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__llair_choice@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <main+0x4a>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <main+0x27>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__llair_choice@plt>
test   %eax,%eax
jle    1131 <main+0x21>
lea    -0x1(%rax),%ecx
lea    -0x2(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rax,%rdx,1),%ebx
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__llair_choice()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0
%4 = add nsw i32 %1, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %1, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %1, %10
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %0
%14 = phi i32 [ 0, %0 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ g(int /*<<< orphan*/);
f(int i) {
  g(0);
  while (({ i--; }))
    g(0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <g@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <f+0x36>
xor    %edi,%edi
call   1030 <g@plt>
jmp    1122 <f+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <g@plt>
test   %ebx,%ebx
je     112c <f+0x1c>
xchg   %ax,%ax
xor    %edi,%edi
call   1030 <g@plt>
add    $0xffffffff,%ebx
jne    1120 <f+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @g(i32 0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @g(i32 0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i32 undef
}
void PiComs_EnableInt(void) {}


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

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

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

LLVM IR (-O2):
define void @PiComs_EnableInt() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void unaligned_write_le16(void *_u, uint16_t a) {
  uint8_t *u = _u;
  u[0] = (uint8_t)a;
  u[1] = (uint8_t)(a >> 8);
}


x86 assembly (clang, -O0):
<unaligned_write_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_le16>:
movslq %esi,%rax
mov    %rax,(%rdi)
sar    $0x8,%eax
cltq
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @unaligned_write_le16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = load i64*, i64** %5
%11 = getelementptr inbounds i64, i64* %10, i64 0
store i64 %9, i64* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 1
store i64 %14, i64* %16
ret void
}

LLVM IR (-O2):
define void @unaligned_write_le16(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = sext i32 %1 to i64
store i64 %4, i64* %3
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callok();
int /*<<< orphan*/ vla();
int main(void) {
  vla();
  callok();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <vla@plt>
mov    $0x0,%al
call   1040 <callok@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @vla()
%2 = call i32 (...) @callok()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vla()
%2 = tail call i32 (...) @callok()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int);
void write_port(uint8_t address, uint8_t port, uint8_t value) {
  set_port(address, port, value, 0x12, 0x13);
}


x86 assembly (clang, -O0):
<write_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x12,%ecx
mov    $0x13,%r8d
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_port>:
mov    $0x12,%ecx
mov    $0x13,%r8d
jmp    1030 <set_port@plt>

LLVM IR (-O0):
define void @write_port(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 = load i32, i32* %6
%10 = call i32 @set_port(i32 %7, i32 %8, i32 %9, i32 18, i32 19)
ret void
}

LLVM IR (-O2):
define void @write_port(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_port(i32 %0, i32 %1, i32 %2, i32 18, i32 19)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int inputNumber() {
  int num = 0;
  printf("Enter number: ");
  scanf("%d", &num);
  return num;
}


x86 assembly (clang, -O0):
<inputNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputNumber>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputNumber() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 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
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputNumber() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ towupper(int /*<<< orphan*/);
void uninitvar_towupper(void) {
  wint_t i;
  (void)towupper(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_towupper>:
jmp    1030 <towupper@plt>

LLVM IR (-O0):
define void @uninitvar_towupper() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @towupper(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_towupper() {
%1 = tail call i32 @towupper(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ estimateCovarianceMatrixML(int);
int /*<<< orphan*/ estimateMeanVectorML(int);
void estimateParametersML(int population_index) {
  estimateMeanVectorML(population_index);
  estimateCovarianceMatrixML(population_index);
}


x86 assembly (clang, -O0):
<estimateParametersML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <estimateMeanVectorML@plt>
mov    -0x4(%rbp),%edi
call   1030 <estimateCovarianceMatrixML@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimateParametersML>:
push   %rbx
mov    %edi,%ebx
call   1040 <estimateMeanVectorML@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <estimateCovarianceMatrixML@plt>

LLVM IR (-O0):
define void @estimateParametersML(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @estimateMeanVectorML(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @estimateCovarianceMatrixML(i32 %5)
ret void
}

LLVM IR (-O2):
define void @estimateParametersML(i32 %0) {
%2 = tail call i32 @estimateMeanVectorML(i32 %0)
%3 = tail call i32 @estimateCovarianceMatrixML(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned int,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(void *, int, unsigned int, int /*<<< orphan*/ *);
void patch(FILE *f, unsigned int at, void *data, unsigned int size) {
  fseek(f, at, SEEK_SET);
  fwrite(data, 1, size, f);
}


x86 assembly (clang, -O0):
<patch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rbp,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @patch(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* %6
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %9, i32 %10, i32 %11)
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %5
%16 = call i32 @fwrite(i8* %13, i32 1, i32 %14, i32* %15)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @patch(i32* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 %1, i32 %5)
%7 = tail call i32 @fwrite(i8* %2, i32 1, i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
scalar_t__ unlink(char const *);
int disk_unlink(const char *fname) {
  if (unlink(fname) != 0) {
    fprintf(stderr, "disk unlink error (%d:%s)\n", errno, strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<disk_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1196 <disk_unlink+0x66>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    %rax,%rcx
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <disk_unlink+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disk_unlink>:
push   %rbp
push   %rbx
push   %rax
call   1030 <unlink@plt>
test   %rax,%rax
je     1170 <disk_unlink+0x40>
mov    0x2e9c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8b(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xea3(%rip),%rsi
mov    %ebx,%edi
mov    %ebp,%edx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    1172 <disk_unlink+0x42>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"disk unlink error (%d:%s)\0A\00"
@errno = global i32 0
define i32 @disk_unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"disk unlink error (%d:%s)\0A\00"
@errno = global i32 0
define i32 @disk_unlink(i8* nocapture %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int (*destroy_image)(TYPE_2__ *);
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void set_XImage_f_destroy_image(void *_p, void *_v) {
  ((XImage *)_p)->f.destroy_image = (int (*)(XImage *))_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_f_destroy_image>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { {}* }
define void @set_XImage_f_destroy_image(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32 (%struct.TYPE_4__*)*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = bitcast {}** %10 to i32 (%struct.TYPE_4__*)**
store i32 (%struct.TYPE_4__*)* %6, i32 (%struct.TYPE_4__*)** %11
ret void
}

LLVM IR (-O2):
define void @set_XImage_f_destroy_image(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int tl880_read_register(struct tl880_dev *, int);
int tl880_blt_int(struct tl880_dev *tl880dev) {
  if (tl880_read_register(tl880dev, 0x4014) &
      tl880_read_register(tl880dev, 0x4010) & 0x10) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tl880_blt_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4014,%esi
call   1030 <tl880_read_register@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4010,%esi
call   1030 <tl880_read_register@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    %ecx,%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     115a <tl880_blt_int+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <tl880_blt_int+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_blt_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4014,%esi
call   1030 <tl880_read_register@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x4010,%esi
call   1030 <tl880_read_register@plt>
and    %ebp,%eax
shr    $0x4,%eax
and    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define i32 @tl880_blt_int(%struct.tl880_dev* %0) {
%2 = alloca i32
%3 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %3
%4 = load %struct.tl880_dev*, %struct.tl880_dev** %3
%5 = call i32 @tl880_read_register(%struct.tl880_dev* %4, i32 16404)
%6 = load %struct.tl880_dev*, %struct.tl880_dev** %3
%7 = call i32 @tl880_read_register(%struct.tl880_dev* %6, i32 16400)
%8 = and i32 %5, %7
%9 = and i32 %8, 16
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define i32 @tl880_blt_int(%struct.tl880_dev* %0) {
%2 = tail call i32 @tl880_read_register(%struct.tl880_dev* %0, i32 16404)
%3 = tail call i32 @tl880_read_register(%struct.tl880_dev* %0, i32 16400)
%4 = and i32 %3, %2
%5 = lshr i32 %4, 4
%6 = and i32 %5, 1
ret i32 %6
}
void X509V3_EXT_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_cleanup() {
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *p;
  for (p = str; *p != '\0'; p++)
    ;
  return (p - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
void __attribute__((visibility("default")))
border_n_vertical_special_sand_e(unsigned char *pic, unsigned char *mirr) {
  *pic = 0x2E;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_n_vertical_special_sand_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2e,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_n_vertical_special_sand_e>:
movb   $0x2e,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_n_vertical_special_sand_e(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
store i8 46, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_n_vertical_special_sand_e(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 46, i8* %0
store i8 2, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, char const *);
int nc_open(char const *, int, int *);
int ncopen(const char *path, int mode) {
  int ncid;
  const int status = nc_open(path, mode, &ncid);
  if (status != 0) {
    nc_advise("ncopen", status, "filename \"%s\"", path);
    return -1;
  }
  return ncid;
}


x86 assembly (clang, -O0):
<ncopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1040 <nc_open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1172 <ncopen+0x52>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xea6(%rip),%rdi
lea    0xea6(%rip),%rdx
call   1030 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <ncopen+0x58>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncopen>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
call   1040 <nc_open@plt>
test   %eax,%eax
je     1155 <ncopen+0x35>
lea    0xec3(%rip),%rdi
lea    0xec3(%rip),%rdx
mov    %eax,%esi
mov    %rbx,%rcx
call   1030 <nc_advise@plt>
mov    $0xffffffff,%eax
jmp    1159 <ncopen+0x39>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ncopen\00"
@.str.1 = [14 x i8] c"filename \22%s\22\00"
define i32 @ncopen(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @nc_open(i8* %8, i32 %9, i32* %6)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %7
%15 = load i8*, i8** %4
%16 = call i32 @nc_advise(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 -1, i32* %3
br label %19
17: ; preds = %2
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"ncopen\00"
@.str.1 = [14 x i8] c"filename \22%s\22\00"
define i32 @ncopen(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @nc_open(i8* %0, i32 %1, i32* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @nc_advise(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ %10, %9 ]
ret i32 %12
}
int alt_kume_mi(int A[], int A_size, int B[], int B_size) { return -1; }


x86 assembly (clang, -O0):
<alt_kume_mi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @alt_kume_mi(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @alt_kume_mi(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32 %3) {
ret i32 -1
}
void WatchdogStallDisable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40080000 + 0x00000418) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40080000 + 0x00000418) & 0x000FFFFF) << 5) |
             ((8) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<WatchdogStallDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43008320,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStallDisable>:
movq   $0x0,0x43008320
ret

LLVM IR (-O0):
define void @WatchdogStallDisable() {
store volatile i64 0, i64* inttoptr (i64 1124107040 to i64*)
ret void
}

LLVM IR (-O2):
define void @WatchdogStallDisable() {
store volatile i64 0, i64* inttoptr (i64 1124107040 to i64*)
ret void
}