xunge/DecIR huggingface dataset:
/* Type definitions */
struct testcase_t {
  int dummy;
};
struct data_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct data_buffer *);
int clean_data_buffer(const struct testcase_t *testcase, void *ptr) {
  struct data_buffer *db = ptr;
  if (db) {
    free(db);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<clean_data_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <clean_data_buffer+0x38>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    114f <clean_data_buffer+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_data_buffer>:
test   %rsi,%rsi
je     1128 <clean_data_buffer+0x18>
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.testcase_t = type { i32 }
%struct.data_buffer = type { i32 }
define i32 @clean_data_buffer(%struct.testcase_t* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.testcase_t*
%5 = alloca i8*
%6 = alloca %struct.data_buffer*
store %struct.testcase_t* %0, %struct.testcase_t** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to %struct.data_buffer*
store %struct.data_buffer* %8, %struct.data_buffer** %6
%9 = load %struct.data_buffer*, %struct.data_buffer** %6
%10 = icmp ne %struct.data_buffer* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.data_buffer*, %struct.data_buffer** %6
%13 = call i32 @free(%struct.data_buffer* %12)
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.testcase_t = type { i32 }
%struct.data_buffer = type { i32 }
define i32 @clean_data_buffer(%struct.testcase_t* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i8* %1 to %struct.data_buffer*
%6 = tail call i32 @free(%struct.data_buffer* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
int compar(int ud, int *a, int *b) {
  if (*a < *b)
    return -ud;
  else if (*a > *b)
    return ud;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112e <compar+0x2e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <compar+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    114b <compar+0x4b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <compar+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
mov    (%rsi),%ecx
mov    %edi,%esi
neg    %esi
xor    %eax,%eax
cmp    (%rdx),%ecx
cmovg  %edi,%eax
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @compar(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* %5
%15 = sub nsw i32 0, %14
store i32 %15, i32* %4
br label %25
16: ; preds = %3
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = load i32*, i32** %7
%20 = load i32, i32* %19
%21 = icmp sgt i32 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = load i32, i32* %5
store i32 %23, i32* %4
br label %25
24: ; preds = %16
store i32 0, i32* %4
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @compar(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
%7 = sub nsw i32 0, %0
%8 = icmp sgt i32 %4, %5
%9 = select i1 %8, i32 %0, i32 0
%10 = select i1 %6, i32 %7, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void _writer_stream(const void *wdest, char c) { fputc(c, (FILE *)wdest); }


x86 assembly (clang, -O0):
<_writer_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_writer_stream>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @_writer_stream(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fputc(i8 signext %1, i32* %3)
ret void
}
void gnttab_finish_foreign_transfer_ref() {}


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

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

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

LLVM IR (-O2):
define void @gnttab_finish_foreign_transfer_ref() {
ret void
}
int get_rightmost_one_bit(unsigned value) { return (value & -value); }


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

x86 assembly (clang, -O2):
<get_rightmost_one_bit>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_rightmost_one_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 0, %4
%6 = and i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_rightmost_one_bit(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ task_deassert_flag(int, int);
void task_deassert_exec(int id) { task_deassert_flag(id, (1 << 1)); }


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

x86 assembly (clang, -O2):
<task_deassert_exec>:
mov    $0x2,%esi
jmp    1030 <task_deassert_flag@plt>

LLVM IR (-O0):
define void @task_deassert_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @task_deassert_flag(i32 %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @task_deassert_exec(i32 %0) {
%2 = tail call i32 @task_deassert_flag(i32 %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *, char *);
void gt_showshortversion(const char *progname) {
  printf("%s (GenomeTools) %s (%s)\n", progname, "1.4.1",
         "2012-06-18 15:03:36");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"%s (GenomeTools) %s (%s)\0A\00"
@.str.1 = [6 x i8] c"1.4.1\00"
@.str.2 = [20 x i8] c"2012-06-18 15:03:36\00"
define void @gt_showshortversion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s (GenomeTools) %s (%s)\0A\00"
@.str.1 = [6 x i8] c"1.4.1\00"
@.str.2 = [20 x i8] c"2012-06-18 15:03:36\00"
define void @gt_showshortversion(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned int hash(char *str) {
  unsigned int h = 0;
  unsigned char *p;
  for (p = (unsigned char *)str; *p != '\0'; p++)
    h = 31 * h + *p;
  return h % 10;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <hash+0x48>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash+0x17>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %7, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 10
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void coprocessor_segment_overrun() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: coprocessor_segment_overrun\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<coprocessor_segment_overrun>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <coprocessor_segment_overrun+0x21>
jmp    1152 <coprocessor_segment_overrun+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coprocessor_segment_overrun>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <coprocessor_segment_overrun+0x20>

LLVM IR (-O0):
@.str = [37 x i8] c"\0AERROR: coprocessor_segment_overrun\0A\00"
define void @coprocessor_segment_overrun() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0AERROR: coprocessor_segment_overrun\0A\00"
define void @coprocessor_segment_overrun() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void igraph_warning_handler_print(const char *reason, const char *file,
                                  int line, int igraph_errno) {
  fprintf(stderr, "Warning: %s in file %s, line %i\n", reason, file, line);
}


x86 assembly (clang, -O0):
<igraph_warning_handler_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_warning_handler_print>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Warning: %s in file %s, line %i\0A\00"
define void @igraph_warning_handler_print(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Warning: %s in file %s, line %i\0A\00"
define void @igraph_warning_handler_print(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "%s", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ data_packing(int, int);
void test_7219(int testMode) { data_packing(0x0F, testMode); }


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

x86 assembly (clang, -O2):
<test_7219>:
mov    %edi,%esi
mov    $0xf,%edi
jmp    1030 <data_packing@plt>

LLVM IR (-O0):
define void @test_7219(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @data_packing(i32 15, i32 %3)
ret void
}

LLVM IR (-O2):
define void @test_7219(i32 %0) {
%2 = tail call i32 @data_packing(i32 15, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_hex(const unsigned char *array, int length) {
  while (length--) {
    printf("%.02x", *array++);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<show_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <show_hex+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <show_hex+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <show_hex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <show_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.02x\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = zext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %5
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.02x\00"
define void @show_hex(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ write(int, void const *, size_t);
ssize_t sf_write(int fd, const void *buffer, size_t len) {
  ssize_t n = 0;
  do {
    n = write(fd, buffer, len);
  } while (n < 0 && errno == EINTR);
  return n;
}


x86 assembly (clang, -O0):
<sf_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1169 <sf_write+0x59>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    112b <sf_write+0x1b>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
test   %rax,%rax
jns    114b <sf_write+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <sf_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @sf_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @write(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @sf_write(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
void test3(int i) { int A[i]; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test3(i32 %0) {
ret void
}
unsigned clampu(unsigned min, unsigned x, unsigned max) {
  if (min > x)
    return min;
  if (max < x)
    return max;
  else
    return x;
}


x86 assembly (clang, -O0):
<clampu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1124 <clampu+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clampu+0x41>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113b <clampu+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clampu+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampu>:
mov    %edx,%eax
cmp    %esi,%edx
cmovae %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clampu(i32 %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %0, %1
%5 = icmp ult i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getshstr(int *, int *, char **, size_t *, int /*<<< orphan*/ *, char, char,
             char, int /*<<< orphan*/);
int getshline_numbered(int *firstline, int *lastline, char **lineptr, size_t *n,
                       FILE *stream) {
  return getshstr(firstline, lastline, lineptr, n, stream, '\n', '\\', '#', 0);
}


x86 assembly (clang, -O0):
<getshline_numbered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0xa,%r9d
xor    %eax,%eax
movl   $0x5c,(%rsp)
movl   $0x23,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <getshstr@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshline_numbered>:
push   %rax
sub    $0x8,%rsp
mov    $0xa,%r9d
push   $0x0
push   $0x23
push   $0x5c
call   1030 <getshstr@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getshline_numbered(i32* %0, i32* %1, i8** %2, i64* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8**
%9 = alloca i64*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i8** %2, i8*** %8
store i64* %3, i64** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i8**, i8*** %8
%14 = load i64*, i64** %9
%15 = load i32*, i32** %10
%16 = call i32 @getshstr(i32* %11, i32* %12, i8** %13, i64* %14, i32* %15, i8 signext 10, i8 signext 92, i8 signext 35, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @getshline_numbered(i32* %0, i32* %1, i8** %2, i64* %3, i32* %4) {
%6 = tail call i32 @getshstr(i32* %0, i32* %1, i8** %2, i64* %3, i32* %4, i8 signext 10, i8 signext 92, i8 signext 35, i32 0)
ret i32 %6
}
/* Type definitions */
struct fpu_area {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fpu_xsaveopt(struct fpu_area *, int);
void dune_fpu_save(struct fpu_area *fp) { fpu_xsaveopt(fp, -1); }


x86 assembly (clang, -O0):
<dune_fpu_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <fpu_xsaveopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dune_fpu_save>:
mov    $0xffffffff,%esi
jmp    1030 <fpu_xsaveopt@plt>

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

LLVM IR (-O2):
%struct.fpu_area = type { i32 }
define void @dune_fpu_save(%struct.fpu_area* %0) {
%2 = tail call i32 @fpu_xsaveopt(%struct.fpu_area* %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cgiMakeResetButton() {
  printf("<INPUT TYPE=RESET NAME=\"Reset\" VALUE=\" Reset \">");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"<INPUT TYPE=RESET NAME=\22Reset\22 VALUE=\22 Reset \22>\00"
define void @cgiMakeResetButton() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"<INPUT TYPE=RESET NAME=\22Reset\22 VALUE=\22 Reset \22>\00"
define void @cgiMakeResetButton() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_eval_print_loop();
int main() {
  read_eval_print_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_eval_print_loop()
ret i32 0
}
double gprima(double x) {
  x = 3.00 * x * x;
  return x;
}


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

x86 assembly (clang, -O2):
<gprima>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @gprima(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %2
%7 = load double, double* %2
ret double %7
}

LLVM IR (-O2):
define double @gprima(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtp_6184_stap_set_size(uint8_t *header, uint16_t size) {
  header[0] = size >> 8;
  header[1] = size & 0xff;
}


x86 assembly (clang, -O0):
<rtp_6184_stap_set_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_6184_stap_set_size>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp_6184_stap_set_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* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @rtp_6184_stap_set_size(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
int cmp_int_asc(const void *x, const void *y) {
  if (*(int *)x < *(int *)y) {
    return -1;
  } else if (*(int *)x > *(int *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_int_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <cmp_int_asc+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <cmp_int_asc+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <cmp_int_asc+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <cmp_int_asc+0x54>
jmp    114d <cmp_int_asc+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int_asc>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_int_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int fdatasync(int);
int full_fsync(int fd, int fullSync, int dataOnly) {
  int rc;
  (fullSync = 0);
  (dataOnly = 0);
  rc = fdatasync(fd);
  if (rc != -1) {
    rc = 0;
  }
  return rc;
}


x86 assembly (clang, -O0):
<full_fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fdatasync@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     114b <full_fsync+0x3b>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_fsync>:
push   %rax
call   1030 <fdatasync@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @full_fsync(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fdatasync(i32 %0)
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void handle_signal(int signo) {
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define void @handle_signal(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, size_t);
void clearInputBuffer() {
  int const COUNTDOWN_BUFFER = 120;
  char buf[COUNTDOWN_BUFFER * 3];
  size_t nbytes;
  nbytes = sizeof(buf);
  read(0, buf, nbytes);
}


x86 assembly (clang, -O0):
<clearInputBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x78,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
movq   $0x168,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
lea    -0x180(%rbp),%rsi
call   1030 <read@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearInputBuffer>:
sub    $0x168,%rsp
mov    %rsp,%rsi
mov    $0x168,%edx
xor    %edi,%edi
call   1030 <read@plt>
add    $0x168,%rsp
ret

LLVM IR (-O0):
define void @clearInputBuffer() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 120, i32* %1
%4 = call i8* @llvm.stacksave()
store i8* %4, i8** %2
%5 = alloca i8, i64 360
store i64 360, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @read(i32 0, i8* %5, i64 %6)
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @clearInputBuffer() {
%1 = alloca [360 x i8]
%2 = getelementptr inbounds [360 x i8], [360 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i64 360)
ret void
}
/* Type definitions */
struct tgl_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_log_event(struct tgl_state *, int *, int);
int *alloc_log_event(int);
void bl_do_set_working_dc(struct tgl_state *TLS, int num) {
  int *ev = alloc_log_event(8);
  ev[0] = 0x9e83dbdc;
  ev[1] = num;
  add_log_event(TLS, ev, 8);
}


x86 assembly (clang, -O0):
<bl_do_set_working_dc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x8,%edi
call   1040 <alloc_log_event@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x9e83dbdc,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <add_log_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_do_set_working_dc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x8,%edi
call   1040 <alloc_log_event@plt>
movl   $0x9e83dbdc,(%rax)
mov    %ebx,0x4(%rax)
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <add_log_event@plt>

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
define void @bl_do_set_working_dc(%struct.tgl_state* %0, i32 %1) {
%3 = alloca %struct.tgl_state*
%4 = alloca i32
%5 = alloca i32*
store %struct.tgl_state* %0, %struct.tgl_state** %3
store i32 %1, i32* %4
%6 = call i32* @alloc_log_event(i32 8)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 -1635525668, i32* %8
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load %struct.tgl_state*, %struct.tgl_state** %3
%13 = load i32*, i32** %5
%14 = call i32 @add_log_event(%struct.tgl_state* %12, i32* %13, i32 8)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
define void @bl_do_set_working_dc(%struct.tgl_state* %0, i32 %1) {
%3 = tail call i32* @alloc_log_event(i32 8)
store i32 -1635525668, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %1, i32* %4
%5 = tail call i32 @add_log_event(%struct.tgl_state* %0, i32* %3, i32 8)
ret void
}
/* Variables and functions */
void kmemset(void *dest, char c, size_t sz) {
  unsigned int i;
  for (i = 0; i < sz; i++) {
    *((char *)dest + i) = c;
  }
}


x86 assembly (clang, -O0):
<kmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1141 <kmemset+0x41>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1119 <kmemset+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmemset>:
test   %rdx,%rdx
je     111c <kmemset+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %sil,(%rdi,%rax,1)
add    $0x1,%eax
cmp    %rdx,%rax
jb     1110 <kmemset+0x10>
ret

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

LLVM IR (-O2):
define void @kmemset(i8* nocapture writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %1, i8* %7
%8 = add nuw nsw i64 %6, 1
%9 = and i64 %8, 4294967295
%10 = icmp ult i64 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr,
          "usage: ttyasc [-h] filename\n"
          "\n"
          "Command options:\n"
          "    -h    Print this help and exits\n"
          "\n"
          "This program translates a `ttyrec' recorded file to the file format "
          "for\n"
          "the asciinema terminal player, and blurts it out to the stdout.\n"
          "\n"
          "Report bugs to <krpors at gmail.com> or see "
          "<http://github.com/krpors/ttyasc>\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [299 x i8] c"usage: ttyasc [-h] filename\0A\0ACommand options:\0A -h Print this help and exits\0A\0AThis program translates a `ttyrec' recorded file to the file format for\0Athe asciinema terminal player, and blurts it out to the stdout.\0A\0AReport bugs to <krpors at gmail.com> or see <http://github.com/krpors/ttyasc>\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [299 x i8] c"usage: ttyasc [-h] filename\0A\0ACommand options:\0A -h Print this help and exits\0A\0AThis program translates a `ttyrec' recorded file to the file format for\0Athe asciinema terminal player, and blurts it out to the stdout.\0A\0AReport bugs to <krpors at gmail.com> or see <http://github.com/krpors/ttyasc>\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_windows_corvering_set();
int main() {
  test_windows_corvering_set();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_windows_corvering_set()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *search() {
  printf("search\n");
  return "1";
}


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

x86 assembly (clang, -O2):
<search>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [2 x i8] c"1\00"
@str = [7 x i8] c"search\00"
define i8* @search() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_S5KA3AFX(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_S5KA3AFX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_S5KA3AFX>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

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

LLVM IR (-O2):
define void @SensorSetReg_S5KA3AFX(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void g_slice_free_chain_with_offset(size_t mem_size, void *mem_chain,
                                    size_t next_offset) {
  void *ptr = mem_chain;
  while (ptr) {
    char *current = (char *)ptr;
    ptr = *(void **)(current + next_offset);
    free(current);
  }
}


x86 assembly (clang, -O0):
<g_slice_free_chain_with_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <g_slice_free_chain_with_offset+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    112c <g_slice_free_chain_with_offset+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_slice_free_chain_with_offset>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1131 <g_slice_free_chain_with_offset+0x21>
mov    %rdx,%r14
mov    %rsi,%rdi
nop
mov    (%rdi,%r14,1),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <g_slice_free_chain_with_offset+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @g_slice_free_chain_with_offset(i64 %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %9, %5 ], [ %1, %3 ]
%7 = getelementptr inbounds i8, i8* %6, i64 %2
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %6)
%11 = icmp eq i8* %9, null
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}