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

/* Variables and functions */
int /*<<< orphan*/ Button1;
int /*<<< orphan*/ SendMouseEvent(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                  int, int);
int /*<<< orphan*/ usleep(int);
void pageBackward(Display *display) {
  SendMouseEvent(display, Button1, 50, 300, true);
  usleep(10000);
  SendMouseEvent(display, Button1, 50, 300, false);
}


x86 assembly (clang, -O0):
<pageBackward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    $0x32,%edx
mov    $0x12c,%ecx
mov    $0x1,%r8d
call   1030 <SendMouseEvent@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    $0x32,%edx
mov    $0x12c,%ecx
xor    %r8d,%r8d
call   1030 <SendMouseEvent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pageBackward>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
mov    (%r14),%esi
mov    $0x32,%edx
mov    $0x12c,%ecx
mov    $0x1,%r8d
call   1030 <SendMouseEvent@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
mov    $0x32,%edx
mov    $0x12c,%ecx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <SendMouseEvent@plt>

LLVM IR (-O0):
@Button1 = global i32 0
define void @pageBackward(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @Button1
%5 = call i32 @SendMouseEvent(i32* %3, i32 %4, i32 50, i32 300, i32 1)
%6 = call i32 @usleep(i32 10000)
%7 = load i32*, i32** %2
%8 = load i32, i32* @Button1
%9 = call i32 @SendMouseEvent(i32* %7, i32 %8, i32 50, i32 300, i32 0)
ret void
}

LLVM IR (-O2):
@Button1 = global i32 0
define void @pageBackward(i32* %0) {
%2 = load i32, i32* @Button1
%3 = tail call i32 @SendMouseEvent(i32* %0, i32 %2, i32 50, i32 300, i32 1)
%4 = tail call i32 @usleep(i32 10000)
%5 = load i32, i32* @Button1
%6 = tail call i32 @SendMouseEvent(i32* %0, i32 %5, i32 50, i32 300, i32 0)
ret void
}
/* Type definitions */
struct read_queue {
  int dummy;
};
struct read_format_params {
  int dummy;
};
struct output_stream {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ start_writer2(struct output_stream *,
                                 struct read_format_params const *,
                                 struct read_queue *, int /*<<< orphan*/ *,
                                 struct read_queue *);
pthread_t start_writer1(struct output_stream *out,
                        const struct read_format_params *oparams,
                        struct read_queue *to_write_queue,
                        struct read_queue *avail_queue) {
  return start_writer2(out, oparams, to_write_queue, NULL, avail_queue);
}


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

x86 assembly (clang, -O2):
<start_writer1>:
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <start_writer2@plt>

LLVM IR (-O0):
%struct.output_stream = type { i32 }
%struct.read_format_params = type { i32 }
%struct.read_queue = type { i32 }
define i32 @start_writer1(%struct.output_stream* %0, %struct.read_format_params* %1, %struct.read_queue* %2, %struct.read_queue* %3) {
%5 = alloca %struct.output_stream*
%6 = alloca %struct.read_format_params*
%7 = alloca %struct.read_queue*
%8 = alloca %struct.read_queue*
store %struct.output_stream* %0, %struct.output_stream** %5
store %struct.read_format_params* %1, %struct.read_format_params** %6
store %struct.read_queue* %2, %struct.read_queue** %7
store %struct.read_queue* %3, %struct.read_queue** %8
%9 = load %struct.output_stream*, %struct.output_stream** %5
%10 = load %struct.read_format_params*, %struct.read_format_params** %6
%11 = load %struct.read_queue*, %struct.read_queue** %7
%12 = load %struct.read_queue*, %struct.read_queue** %8
%13 = call i32 @start_writer2(%struct.output_stream* %9, %struct.read_format_params* %10, %struct.read_queue* %11, i32* null, %struct.read_queue* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.output_stream = type { i32 }
%struct.read_format_params = type { i32 }
%struct.read_queue = type { i32 }
define i32 @start_writer1(%struct.output_stream* %0, %struct.read_format_params* %1, %struct.read_queue* %2, %struct.read_queue* %3) {
%5 = tail call i32 @start_writer2(%struct.output_stream* %0, %struct.read_format_params* %1, %struct.read_queue* %2, i32* null, %struct.read_queue* %3)
ret i32 %5
}
int test_imm_D9uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xd9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D9uint64_lowword_reg>:
test   $0xd9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D9uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 217
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fun584() { return 584; }


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

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

LLVM IR (-O0):
define i32 @fun584() {
ret i32 584
}

LLVM IR (-O2):
define i32 @fun584() {
ret i32 584
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t stream_write_fd(void *cookie, const void *buf, size_t size) {
  ssize_t nbytes;
  int fd;
  fd = *(int *)cookie;
  nbytes = write(fd, buf, size);
  return (nbytes);
}


x86 assembly (clang, -O0):
<stream_write_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_write_fd>:
mov    (%rdi),%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @stream_write_fd(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @write(i32 %12, i8* %13, i64 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @stream_write_fd(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write(i32 %5, i8* %1, i64 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_65(void) {
  { a_0_55(((((11)))), "MODULE?"); }
}


x86 assembly (clang, -O0):
<a_0_65>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_65>:
lea    0xee9(%rip),%rsi
mov    $0xb,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"MODULE?\00"
define void @a_0_65() {
%1 = call i32 @a_0_55(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"MODULE?\00"
define void @a_0_65() {
%1 = tail call i32 @a_0_55(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sv_get_song_tpl(int);
int vox_get_song_tpl(int slot) { return sv_get_song_tpl(slot); }


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

x86 assembly (clang, -O2):
<vox_get_song_tpl>:
jmp    1030 <sv_get_song_tpl@plt>

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

LLVM IR (-O2):
define i32 @vox_get_song_tpl(i32 %0) {
%2 = tail call i32 @sv_get_song_tpl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int yyerror(const char *s) {
  fprintf(stderr, "EEK, parse error!  Message: [%s]\n", s);
  { fprintf(stderr, "Line %3d of File %s \n", 572, "qgrammar.y"); };
  return -1;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
mov    $0x23c,%edx
lea    0xee5(%rip),%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeee(%rip),%rsi
lea    0xefd(%rip),%rcx
mov    $0x23c,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"EEK, parse error! Message: [%s]\0A\00"
@.str.1 = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.2 = [11 x i8] c"qgrammar.y\00"
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 572, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"EEK, parse error! Message: [%s]\0A\00"
@.str.1 = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.2 = [11 x i8] c"qgrammar.y\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 572, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *build_ref_for_offset(void *, int);
int main(void) {
  void *ret = build_ref_for_offset((void *)0, 32);
  if (ret != (void *)0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x20,%esi
call   1040 <build_ref_for_offset@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x20,%esi
call   1040 <build_ref_for_offset@plt>
test   %rax,%rax
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @build_ref_for_offset(i8* null, i32 32)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @build_ref_for_offset(i8* null, i32 32)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int StrNLen32(const char *z, int N) {
  int n = 0;
  while ((N-- != 0) && *(z++) != 0) {
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<StrNLen32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1146 <StrNLen32+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <StrNLen32+0x56>
jmp    1164 <StrNLen32+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <StrNLen32+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrNLen32>:
test   %esi,%esi
je     111f <StrNLen32+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <StrNLen32+0x22>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <StrNLen32+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @StrNLen32(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %11
%5 = phi i32 [ %8, %11 ], [ %1, %2 ]
%6 = phi i32 [ %13, %11 ], [ 0, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
%8 = add nsw i32 %5, -1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %8, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %11, %2
%16 = phi i32 [ 0, %2 ], [ %1, %11 ], [ %6, %4 ]
ret i32 %16
}
/* Type definitions */
struct intel_gt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intel_gt_retire_requests_timeout(struct intel_gt *,
                                                    int /*<<< orphan*/);
void intel_gt_retire_requests(struct intel_gt *gt) {
  intel_gt_retire_requests_timeout(gt, 0);
}


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

x86 assembly (clang, -O2):
<intel_gt_retire_requests>:
xor    %esi,%esi
jmp    1030 <intel_gt_retire_requests_timeout@plt>

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

LLVM IR (-O2):
%struct.intel_gt = type { i32 }
define void @intel_gt_retire_requests(%struct.intel_gt* %0) {
%2 = tail call i32 @intel_gt_retire_requests_timeout(%struct.intel_gt* %0, i32 0)
ret void
}
twrblk(blk, len, fn) register char *blk;
{ return write(fn, blk, len); }


x86 assembly (clang, -O0):
<twrblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twrblk>:
mov    %edx,%eax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %eax,%edi
xor    %eax,%eax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @twrblk(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
void clear() {
  system("cls");
  fflush(stdin);
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@stdin = global i32 0
define void @clear() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@stdin = global i32 0
define void @clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void cpu_init() {}


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

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

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

LLVM IR (-O2):
define void @cpu_init() {
ret void
}
/* Variables and functions */
int bar();
int main() { return bar() - 42; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, -42
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lappend(void ***, size_t *, void *);
void lcat(void *dst, size_t *ndst, void *src, size_t nsrc) {
  size_t i;
  void ***d, **s;
  d = dst;
  s = src;
  for (i = 0; i < nsrc; i++)
    lappend(d, ndst, s[i]);
}


x86 assembly (clang, -O0):
<lcat>:
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    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1178 <lcat+0x68>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
call   1030 <lappend@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1140 <lcat+0x30>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcat>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rcx,%rcx
je     1148 <lcat+0x38>
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdx
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <lappend@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <lcat+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @lcat(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8***
%11 = alloca i8**
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i8***
store i8*** %13, i8**** %10
%14 = load i8*, i8** %7
%15 = bitcast i8* %14 to i8**
store i8** %15, i8*** %11
store i64 0, i64* %9
br label %16
16: ; preds = %28, %4
%17 = load i64, i64* %9
%18 = load i64, i64* %8
%19 = icmp ult i64 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load i8***, i8**** %10
%22 = load i64*, i64** %6
%23 = load i8**, i8*** %11
%24 = load i64, i64* %9
%25 = getelementptr inbounds i8*, i8** %23, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @lappend(i8*** %21, i64* %22, i8* %26)
br label %28
28: ; preds = %20
%29 = load i64, i64* %9
%30 = add i64 %29, 1
store i64 %30, i64* %9
br label %16
31: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @lcat(i8* %0, i64* %1, i8* nocapture %2, i64 %3) {
%5 = bitcast i8* %0 to i8***
%6 = bitcast i8* %2 to i8**
%7 = icmp eq i64 %3, 0
br i1 %7, label %15, label %8
8: ; preds = %4, %8
%9 = phi i64 [ %13, %8 ], [ 0, %4 ]
%10 = getelementptr inbounds i8*, i8** %6, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @lappend(i8*** %5, i64* %1, i8* %11)
%13 = add nuw i64 %9, 1
%14 = icmp eq i64 %13, %3
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 8;
  printf("\n%d", (i == 0 ? 1 : i * (i - 1 * (i - 1 - 1))));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <main+0x2d>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <main+0x47>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
sub    $0x1,%edx
shl    $0x0,%edx
sub    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 16)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite_unlocked(char const *, int, int /*<<< orphan*/,
                    int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
int stub1(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int fputs_unlocked(const char *str, FILE *stream) {
  return (*fwrite_unlocked)(str, 1, strlen(str), stream);
}


x86 assembly (clang, -O0):
<fputs_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite_unlocked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs_unlocked>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite_unlocked@plt>

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

LLVM IR (-O2):
define i32 @fputs_unlocked(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @fwrite_unlocked(i8* %0, i32 1, i32 %3, i32* %1)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char *pd9p_enc4(char *buf, uint32_t val) {
  buf[0] = val % (1 << 8);
  buf[1] = (val >> 8) % (1 << 8);
  buf[2] = (val >> 16) % (1 << 8);
  buf[3] = val >> 24;
  return buf + 4;
}


x86 assembly (clang, -O0):
<pd9p_enc4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd9p_enc4>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @pd9p_enc4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 256
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = srem i32 %11, 256
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = srem i32 %17, 256
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 4
ret i8* %28
}

LLVM IR (-O2):
define i8* @pd9p_enc4(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int benchmark_initbatch(void *tsd) {
  (void)fprintf(stderr, "benchmark_initbatch: entry\n");
  return (0);
}


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

x86 assembly (clang, -O2):
<benchmark_initbatch>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"benchmark_initbatch: entry\0A\00"
define i32 @benchmark_initbatch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"benchmark_initbatch: entry\0A\00"
define i32 @benchmark_initbatch(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void DebugBreak(void) { __coverity_panic__(); }


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

x86 assembly (clang, -O2):
<DebugBreak>:
xor    %eax,%eax
jmp    1030 <__coverity_panic__@plt>

LLVM IR (-O0):
define void @DebugBreak() {
%1 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @DebugBreak() {
%1 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rdp_filestream_close();
int /*<<< orphan*/ rdp_filestream_open(char *, char *);
int /*<<< orphan*/ rdp_receiver(char *, char *);
int /*<<< orphan*/ rdp_receiver_receive();
int /*<<< orphan*/ rdp_receiver_stats();
void rdpr_test() {
  rdp_filestream_open("receive/test.dat", "w");
  rdp_receiver("10.10.1.100", "9001");
  rdp_receiver_receive();
  rdp_filestream_close();
  rdp_receiver_stats();
}


x86 assembly (clang, -O0):
<rdpr_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <rdp_filestream_open@plt>
lea    0xea5(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <rdp_receiver@plt>
mov    $0x0,%al
call   1040 <rdp_receiver_receive@plt>
mov    $0x0,%al
call   1030 <rdp_filestream_close@plt>
mov    $0x0,%al
call   1070 <rdp_receiver_stats@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpr_test>:
push   %rax
lea    0xea8(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <rdp_filestream_open@plt>
lea    0xea8(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <rdp_receiver@plt>
xor    %eax,%eax
call   1040 <rdp_receiver_receive@plt>
xor    %eax,%eax
call   1030 <rdp_filestream_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <rdp_receiver_stats@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"receive/test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [12 x i8] c"10.10.1.100\00"
@.str.3 = [5 x i8] c"9001\00"
define void @rdpr_test() {
%1 = call i32 @rdp_filestream_open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @rdp_receiver(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (...) @rdp_receiver_receive()
%4 = call i32 (...) @rdp_filestream_close()
%5 = call i32 (...) @rdp_receiver_stats()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"receive/test.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [12 x i8] c"10.10.1.100\00"
@.str.3 = [5 x i8] c"9001\00"
define void @rdpr_test() {
%1 = tail call i32 @rdp_filestream_open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @rdp_receiver(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (...) @rdp_receiver_receive()
%4 = tail call i32 (...) @rdp_filestream_close()
%5 = tail call i32 (...) @rdp_receiver_stats()
ret void
}
int hash_val(int key) { return key; }


x86 assembly (clang, -O0):
<hash_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hash_val(i32 returned %0) {
ret i32 %0
}
unsigned short rotateR_fun_ushort(unsigned short x, int i) {
  if ((i %= 16) == 0)
    return x;
  return (x << (16 - i)) | (x >> i);
}


x86 assembly (clang, -O0):
<rotateR_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    1132 <rotateR_fun_ushort+0x32>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1151 <rotateR_fun_ushort+0x51>
movzwl -0x4(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_ushort>:
mov    %esi,%ecx
lea    0xf(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff0,%eax
sub    %eax,%ecx
mov    %edi,%eax
ror    %cl,%ax
test   %ecx,%ecx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @rotateR_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 16
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i16, i16* %4
store i16 %10, i16* %3
br label %23
11: ; preds = %2
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = load i32, i32* %5
%15 = sub nsw i32 16, %14
%16 = shl i32 %13, %15
%17 = load i16, i16* %4
%18 = zext i16 %17 to i32
%19 = load i32, i32* %5
%20 = ashr i32 %18, %19
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
br label %23
23: ; preds = %11, %9
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @rotateR_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = srem i32 %1, 16
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %3 to i16
%6 = tail call i16 @llvm.fshr.i16(i16 %0, i16 %0, i16 %5)
%7 = select i1 %4, i16 %0, i16 %6
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ Xil_ICacheInvalidate();
int /*<<< orphan*/ xil_printf(char *);
int Xil_TestICacheAll(void) {
  Xil_ICacheInvalidate();
  xil_printf("-- Invalidate icache all done --\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<Xil_TestICacheAll>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Xil_ICacheInvalidate@plt>
lea    0xece(%rip),%rdi
call   1030 <xil_printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xil_TestICacheAll>:
push   %rax
xor    %eax,%eax
call   1040 <Xil_ICacheInvalidate@plt>
lea    0xed1(%rip),%rdi
call   1030 <xil_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"-- Invalidate icache all done --\0D\0A\00"
define i32 @Xil_TestICacheAll() {
%1 = call i32 (...) @Xil_ICacheInvalidate()
%2 = call i32 @xil_printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"-- Invalidate icache all done --\0D\0A\00"
define i32 @Xil_TestICacheAll() {
%1 = tail call i32 (...) @Xil_ICacheInvalidate()
%2 = tail call i32 @xil_printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1207() { return 1207; }


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

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

LLVM IR (-O0):
define i32 @fun1207() {
ret i32 1207
}

LLVM IR (-O2):
define i32 @fun1207() {
ret i32 1207
}
/* Variables and functions */
int /*<<< orphan*/ SetSys(char const *);
void OptTarget(const char *Opt __attribute__((unused)), const char *Arg) {
  SetSys(Arg);
}


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

x86 assembly (clang, -O2):
<OptTarget>:
mov    %rsi,%rdi
jmp    1030 <SetSys@plt>

LLVM IR (-O0):
define void @OptTarget(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 = call i32 @SetSys(i8* %5)
ret void
}

LLVM IR (-O2):
define void @OptTarget(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @SetSys(i8* %1)
ret void
}
void BusFaultISR(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<BusFaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFaultISR+0x9>
jmp    1109 <BusFaultISR+0x9>

x86 assembly (clang, -O2):
<BusFaultISR>:
jmp    1100 <BusFaultISR>

LLVM IR (-O0):
define void @BusFaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @BusFaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ emitanoperand(int, char *, int);
int /*<<< orphan*/ printf(char *);
void emitoneoperandw(void) {
  printf(" ");
  emitanoperand(1, "ds:word ptr", 1);
}


x86 assembly (clang, -O0):
<emitoneoperandw>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edx
lea    0xec6(%rip),%rsi
mov    %edx,%edi
call   1040 <emitanoperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitoneoperandw>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1040 <emitanoperand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [12 x i8] c"ds:word ptr\00"
define void @emitoneoperandw() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"ds:word ptr\00"
define void @emitoneoperandw() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void op0xE7(void) { rst(0x20); }


x86 assembly (clang, -O0):
<op0xE7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <rst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op0xE7>:
mov    $0x20,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @op0xE7() {
%1 = call i32 @rst(i32 32)
ret void
}

LLVM IR (-O2):
define void @op0xE7() {
%1 = tail call i32 @rst(i32 32)
ret void
}
/* Variables and functions */
int access(char const *, int);
int platform_access(const char *path, int mode) { return access(path, mode); }


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

x86 assembly (clang, -O2):
<platform_access>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @platform_access(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool onlyonebitset(uint8_t x) { return (x && !(x & (x - 1))); }


x86 assembly (clang, -O0):
<onlyonebitset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <onlyonebitset+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyonebitset>:
test   %edi,%edi
je     110f <onlyonebitset+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @onlyonebitset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @onlyonebitset(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ is_my_file(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
uint64_t offset_from_filename(const char *filename) {
  char str[5];
  uint64_t number;
  assert(is_my_file(filename));
  strncpy(str, filename, 4);
  str[4] = '\0';
  number = (uint64_t)strtol(str, NULL, 10) - 1;
  return number * (1024 * 1024 * 1024);
}


x86 assembly (clang, -O0):
<offset_from_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_my_file@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1e,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_from_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <is_my_file@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0x3(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtol@plt>
shl    $0x1e,%eax
add    $0xc0000000,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @offset_from_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @is_my_file(i8* %5)
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 4)
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %11
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%13 = call i64 @strtol(i8* %12, i32* null, i32 10)
%14 = trunc i64 %13 to i32
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 1073741824
ret i32 %17
}

LLVM IR (-O2):
define i32 @offset_from_filename(i8* %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @is_my_file(i8* %0)
%5 = tail call i32 @assert(i32 %4)
%6 = call i32 @strncpy(i8* %3, i8* %0, i32 4)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
store i8 0, i8* %7
%8 = call i64 @strtol(i8* nocapture %3, i32* null, i32 10)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 30
%11 = add i32 %10, -1073741824
ret i32 %11
}
unsigned int ixp2000_has_flash(void) {
  return ((*(volatile unsigned long *)((0xfef04000 + 0x0a00) | (0x18))) &
          ((1 << 1)));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0xfef04a18,%eax
mov    (%rax),%rax
and    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xfef04a18,%eax
mov    (%rax),%rax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @ixp2000_has_flash() {
%1 = load volatile i64, i64* inttoptr (i64 4277160472 to i64*)
%2 = and i64 %1, 2
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @ixp2000_has_flash() {
%1 = load volatile i64, i64* inttoptr (i64 4277160472 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 2
ret i32 %3
}
/* Type definitions */
struct ps_summary {
  int dummy;
};
struct obus_object {
  int dummy;
};

/* Variables and functions */
int obus_object_is_registered(struct obus_object const *);
int ps_summary_is_registered(const struct ps_summary *object) {
  const struct obus_object *obj = (const struct obus_object *)object;
  return obus_object_is_registered(obj);
}


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

x86 assembly (clang, -O2):
<ps_summary_is_registered>:
jmp    1030 <obus_object_is_registered@plt>

LLVM IR (-O0):
%struct.ps_summary = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_summary_is_registered(%struct.ps_summary* %0) {
%2 = alloca %struct.ps_summary*
%3 = alloca %struct.obus_object*
store %struct.ps_summary* %0, %struct.ps_summary** %2
%4 = load %struct.ps_summary*, %struct.ps_summary** %2
%5 = bitcast %struct.ps_summary* %4 to %struct.obus_object*
store %struct.obus_object* %5, %struct.obus_object** %3
%6 = load %struct.obus_object*, %struct.obus_object** %3
%7 = call i32 @obus_object_is_registered(%struct.obus_object* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ps_summary = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_summary_is_registered(%struct.ps_summary* %0) {
%2 = bitcast %struct.ps_summary* %0 to %struct.obus_object*
%3 = tail call i32 @obus_object_is_registered(%struct.obus_object* %2)
ret i32 %3
}