xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_prefetch(int /*<<< orphan*/, int, int, int,
                                          int);
void prefetch() {
  __builtin_arm_prefetch(0, 1, 2, 0, 1);
  __builtin_arm_prefetch(0, 0, 0, 1, 1);
  __builtin_arm_prefetch(0, 0, 0, 1, 1);
  __builtin_arm_prefetch(0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<prefetch>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x2,%edx
mov    %ecx,%edi
mov    %r8d,%esi
call   1030 <__builtin_arm_prefetch@plt>
xor    %edx,%edx
mov    $0x1,%r8d
mov    %edx,%edi
mov    %edx,%esi
mov    %r8d,%ecx
call   1030 <__builtin_arm_prefetch@plt>
xor    %edx,%edx
mov    $0x1,%r8d
mov    %edx,%edi
mov    %edx,%esi
mov    %r8d,%ecx
call   1030 <__builtin_arm_prefetch@plt>
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <__builtin_arm_prefetch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefetch>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <__builtin_arm_prefetch@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <__builtin_arm_prefetch@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <__builtin_arm_prefetch@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rax
jmp    1030 <__builtin_arm_prefetch@plt>

LLVM IR (-O0):
define void @prefetch() {
%1 = call i32 @__builtin_arm_prefetch(i32 0, i32 1, i32 2, i32 0, i32 1)
%2 = call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 1, i32 1)
%3 = call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 1, i32 1)
%4 = call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @prefetch() {
%1 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 1, i32 2, i32 0, i32 1)
%2 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 1, i32 1)
%3 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 1, i32 1)
%4 = tail call i32 @__builtin_arm_prefetch(i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int, int);
void MC_avg_y_8_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                      int height) {
  MC_avg2_8(height, dest, ref, stride, stride, 1);
}


x86 assembly (clang, -O0):
<MC_avg_y_8_3dnow>:
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    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <MC_avg2_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_y_8_3dnow>:
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %r8d,%ecx
mov    $0x1,%r9d
jmp    1030 <MC_avg2_8@plt>

LLVM IR (-O0):
define void @MC_avg_y_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @MC_avg2_8(i32 %9, i32* %10, i32* %11, i32 %12, i32 %13, i32 1)
ret void
}

LLVM IR (-O2):
define void @MC_avg_y_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void w_clear_nonblock(int fd) {
  fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK);
}


x86 assembly (clang, -O0):
<w_clear_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_clear_nonblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @w_clear_nonblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
%8 = load i32, i32* @O_NONBLOCK
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = call i32 (i32, i32, ...) @fcntl(i32 %3, i32 %4, i32 %10)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @w_clear_nonblock(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = load i32, i32* @O_NONBLOCK
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
%8 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void connect_alarm(int signo) {
  printf("connect_alarm.\n");
  return;
}


x86 assembly (clang, -O0):
<connect_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [15 x i8] c"connect_alarm.\00"
define void @connect_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int d(int);
int /*<<< orphan*/ niceprint(char *);
void island(void) {
  niceprint("A small island rises from the water ahead. If it has no hostile "
            "creatures, it could "
            "make a good place for the party to take a long rest\n\n");
  if (d(2) == 1)
    niceprint("The island has one or more types of fungi growing atop it.\n\n");
  else
    niceprint("The island is barren rock.\n\n");
}


x86 assembly (clang, -O0):
<island>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <niceprint@plt>
mov    $0x2,%edi
call   1030 <d@plt>
cmp    $0x1,%eax
jne    1154 <island+0x34>
lea    0xf40(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1160 <island+0x40>
lea    0xf6c(%rip),%rdi
call   1040 <niceprint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<island>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <niceprint@plt>
mov    $0x2,%edi
call   1030 <d@plt>
cmp    $0x1,%eax
lea    0xf49(%rip),%rax
lea    0xf7f(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <niceprint@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"A small island rises from the water ahead. If it has no hostile creatures, it could make a good place for the party to take a long rest\0A\0A\00"
@.str.1 = [61 x i8] c"The island has one or more types of fungi growing atop it.\0A\0A\00"
@.str.2 = [29 x i8] c"The island is barren rock.\0A\0A\00"
define void @island() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @d(i32 2)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @niceprint(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @niceprint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"A small island rises from the water ahead. If it has no hostile creatures, it could make a good place for the party to take a long rest\0A\0A\00"
@.str.1 = [61 x i8] c"The island has one or more types of fungi growing atop it.\0A\0A\00"
@.str.2 = [29 x i8] c"The island is barren rock.\0A\0A\00"
define void @island() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @d(i32 2)
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @niceprint(i8* %4)
ret void
}
void gdk_region_copy() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void test(char *(*func4test)(char *), char *str) {
  printf("The compressed string of \"%s\" is \"%s\"\n", str, func4test(str));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
call   *%rax
lea    0xedd(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"The compressed string of \22%s\22 is \22%s\22\0A\00"
define void @test(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8* (i8*)*, i8* (i8*)** %3
%7 = load i8*, i8** %4
%8 = call i8* %6(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"The compressed string of \22%s\22 is \22%s\22\0A\00"
define void @test(i8* (i8*)* nocapture %0, i8* %1) {
%3 = tail call i8* %0(i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char **);
void g(char **o) {
  static const char *const multilib_exclusions_raw[] = {0};
  const char *const *q = multilib_exclusions_raw;
  f(o);
  while (*q++)
    f(o);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
je     1157 <g+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <f@plt>
jmp    1130 <g+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

LLVM IR (-O0):
@g.multilib_exclusions_raw = internal constant [1 x i8*] zeroinitializer
define void @g(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
store i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @g.multilib_exclusions_raw, i64 0, i64 0), i8*** %3
%4 = load i8**, i8*** %2
%5 = call i32 @f(i8** %4)
br label %6
6: ; preds = %11, %1
%7 = load i8**, i8*** %3
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %3
%9 = load i8*, i8** %7
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8**, i8*** %2
%13 = call i32 @f(i8** %12)
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @g(i8** %0) {
%2 = tail call i32 @f(i8** %0)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void monotime_ts(struct timespec *ts) { clock_gettime(CLOCK_MONOTONIC, ts); }


x86 assembly (clang, -O0):
<monotime_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotime_ts>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @monotime_ts(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define void @monotime_ts(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret void
}
/* Variables and functions */
int memoized_cut_rod(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int p[] = {0, 1, 5, 8, 9, 10, 17, 17, 20, 24, 30};
  int max;
  max = memoized_cut_rod(p, 5);
  printf("the max:%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <memoized_cut_rod@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <memoized_cut_rod@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
@.str = [12 x i8] c"the max:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [11 x i32]* %2 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%6 = call i32 @memoized_cut_rod(i32* %5, i32 5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
@.str = [12 x i8] c"the max:%d\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @memoized_cut_rod(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MV_SetVolume(int);
void FX_SetVolume(int volume) {
  int status;
  MV_SetVolume(volume);
}


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

x86 assembly (clang, -O2):
<FX_SetVolume>:
jmp    1030 <MV_SetVolume@plt>

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

LLVM IR (-O2):
define void @FX_SetVolume(i32 %0) {
%2 = tail call i32 @MV_SetVolume(i32 %0)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ log_unix_error(char *);
void Close(int fd) {
  int rc;
  if ((rc = close(fd)) < 0)
    log_unix_error("Close error");
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Close+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <log_unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1040 <close@plt>
test   %eax,%eax
js     112c <Close+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <log_unix_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Close error\00"
define void @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @log_unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Close error\00"
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @log_unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strlen(char *);
void remove_newline_ch(char *line) {
  int new_line = strlen(line) - 1;
  if (line[new_line] == '\n') {
    line[new_line] = '\0';
  }
}


x86 assembly (clang, -O0):
<remove_newline_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <remove_newline_ch+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline_ch>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <remove_newline_ch+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_newline_ch(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
char *mempcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *stpcpy(char *dest, const char *src) {
  size_t len = strlen(src);
  dest[len] = 0;
  return mempcpy(dest, src, len);
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rdx,-0x28(%rbp)
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%r15
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stpcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i8* @mempcpy(i8* %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %3, i1 false)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void get_input(char *dst) {
  puts("Enter the card name: ");
  scanf("%2s", dst);
}


x86 assembly (clang, -O0):
<get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the card name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @get_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the card name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @get_input(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ con_putc(scalar_t__);
void con_puts(const char *s) {
  uint8_t c;
  while (c = (uint8_t)*s++)
    con_putc(c);
}


x86 assembly (clang, -O0):
<con_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     114b <con_puts+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <con_putc@plt>
jmp    111c <con_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1134 <con_puts+0x24>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbq %al,%rdi
call   1030 <con_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <con_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @con_puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i64
store i64 %8, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i64, i64* %3
%12 = call i32 @con_putc(i64 %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @con_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @con_putc(i64 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_print_char(char);
void ft_print_str(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    ft_print_char(str[i]);
    i++;
  }
  return;
}


x86 assembly (clang, -O0):
<ft_print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_print_str+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_print_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_print_str+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_print_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_print_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_print_char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int ld_blg_rm2(long double a1, long double *a2) {
  return !(__builtin_islessgreater(a1, *a2));
}


x86 assembly (clang, -O0):
<ld_blg_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
sete   %al
ret

LLVM IR (-O0):
define i32 @ld_blg_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp one x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_blg_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ueq x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void cpuNoAction(uint8_t *reg) { (void)reg; }


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

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

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

LLVM IR (-O2):
define void @cpuNoAction(i32* nocapture %0) {
ret void
}
int check(struct Xploit *xp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.Xploit = type opaque
define i32 @check(%struct.Xploit* nocapture readnone %0) {
ret i32 0
}
void foo446(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo446(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int,
                          int /*<<< orphan*/, int);
main() {
  int i = 5;
  printf("%d %d %d %d %d\n", i, i++, ++i, i++, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%r8d
mov    %r8d,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%r9d
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %6, i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 5, i32 5, i32 7, i32 7, i32 8)
ret i32 0
}
void f_acc_parallel(void) {
#pragma acc parallel
  {
#pragma acc parallel
    ;
#pragma acc kernels
    ;
#pragma acc data
    ;
#pragma acc update host(i)
#pragma acc enter data copyin(i)
#pragma acc exit data delete (i)
  }
}


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

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

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

LLVM IR (-O2):
define void @f_acc_parallel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ disp_str(char *);
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A");
    disp_int(i++);
    disp_str(".");
    delay(100);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <disp_str@plt>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
call   1050 <disp_int@plt>
lea    0xe9d(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x64,%edi
call   1040 <delay@plt>
jmp    113f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xec0(%rip),%r14
lea    0xebb(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <disp_str@plt>
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1050 <disp_int@plt>
mov    %r15,%rdi
call   1030 <disp_str@plt>
mov    $0x64,%edi
call   1040 <delay@plt>
mov    %ebp,%ebx
jmp    1150 <TestA+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @disp_int(i32 %4)
%7 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @delay(i32 100)
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = tail call i32 @disp_int(i32 %2)
%6 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @delay(i32 100)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ activate_help(char *);
int /*<<< orphan*/ select_slow();
void slow_handler(int x, int y, int button) {
  if (button == 3) {
    activate_help("slow.hlp");
  } else {
    select_slow();
  }
}


x86 assembly (clang, -O0):
<slow_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    114c <slow_handler+0x2c>
lea    0xebe(%rip),%rdi
call   1030 <activate_help@plt>
jmp    1153 <slow_handler+0x33>
mov    $0x0,%al
call   1040 <select_slow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slow_handler>:
cmp    $0x3,%edx
jne    1131 <slow_handler+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <activate_help@plt>
xor    %eax,%eax
jmp    1040 <select_slow@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"slow.hlp\00"
define void @slow_handler(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @activate_help(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = call i32 (...) @select_slow()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"slow.hlp\00"
define void @slow_handler(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 3
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @activate_help(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @select_slow()
br label %9
9: ; preds = %7, %5
ret void
}
void *int_copy(void *to_copy) {
  int *i = (int *)calloc(1, sizeof(int));
  *i = *(int *)to_copy;
  return i;
}


x86 assembly (clang, -O0):
<int_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_copy>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @int_copy(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(4) i8* @calloc(i64 1, i64 4)
%3 = bitcast i8* %2 to i32*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %3
ret i8* %2
}
char fib(char n) {
  if (n == 0)
    return 1;
  if (n == 1)
    return 1;
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1134 <fib+0x24>
movb   $0x1,-0x1(%rbp)
jmp    117b <fib+0x6b>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    114a <fib+0x3a>
movb   $0x1,-0x1(%rbp)
jmp    117b <fib+0x6b>
movsbl -0x2(%rbp),%eax
sub    $0x1,%eax
movsbl %al,%edi
call   1030 <fib@plt>
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
sub    $0x2,%eax
movsbl %al,%edi
call   1030 <fib@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movsbl %cl,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%bpl
cmp    $0x2,%bl
jb     113a <fib+0x2a>
xor    %ebp,%ebp
nop
lea    -0x1(%rbx),%eax
movsbl %al,%edi
call   1030 <fib@plt>
add    $0xfe,%bl
add    %al,%bpl
cmp    $0x1,%bl
ja     1120 <fib+0x10>
add    $0x1,%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @fib(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %28
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 1, i8* %2
br label %28
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 1
%17 = trunc i32 %16 to i8
%18 = call signext i8 @fib(i8 signext %17)
%19 = sext i8 %18 to i32
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 2
%23 = trunc i32 %22 to i8
%24 = call signext i8 @fib(i8 signext %23)
%25 = sext i8 %24 to i32
%26 = add nsw i32 %19, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
br label %28
28: ; preds = %13, %12, %7
%29 = load i8, i8* %2
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @fib(i8 signext %0) {
%2 = icmp ult i8 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i8 [ %8, %3 ], [ %0, %1 ]
%5 = phi i8 [ %9, %3 ], [ 0, %1 ]
%6 = add i8 %4, -1
%7 = tail call signext i8 @fib(i8 signext %6)
%8 = add i8 %4, -2
%9 = add i8 %7, %5
%10 = icmp ult i8 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i8 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i8 [ 1, %1 ], [ %12, %11 ]
ret i8 %14
}
void signed_char_add_signed_char_unsigned_int(signed char *LHS,
                                              unsigned int RHS) {
  (*LHS) += RHS;
}


x86 assembly (clang, -O0):
<signed_char_add_signed_char_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_add_signed_char_unsigned_int>:
add    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_add_signed_char_unsigned_int(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 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_add_signed_char_unsigned_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = add i8 %3, %4
store i8 %5, i8* %0
ret void
}
main() {
  int x = {{{1}}};
  int y = 2, k = 3;
  return x + y + k;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
double MAX(double a, double b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <MAX+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <MAX+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @MAX(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @MAX(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ readCompilationEngineInput();
int /*<<< orphan*/ writeTerminalElement(int const, char const *);
void readWriteTerminalElement(const int type, const char *model) {
  readCompilationEngineInput();
  writeTerminalElement(type, model);
}


x86 assembly (clang, -O0):
<readWriteTerminalElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <readCompilationEngineInput@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <writeTerminalElement@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readWriteTerminalElement>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <readCompilationEngineInput@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writeTerminalElement@plt>

LLVM IR (-O0):
define void @readWriteTerminalElement(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @readCompilationEngineInput()
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @writeTerminalElement(i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @readWriteTerminalElement(i32 %0, i8* %1) {
%3 = tail call i32 (...) @readCompilationEngineInput()
%4 = tail call i32 @writeTerminalElement(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertNoEmpty(int *, int);
char *test_assertNoEmpty() {
  static int a[2] = {1, 5};
  do {
    if (!(assertNoEmpty(a, 2)))
      return "e: test_assertNoEmpty";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_assertNoEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f09(%rip),%rdi
mov    $0x2,%esi
call   1030 <assertNoEmpty@plt>
cmp    $0x0,%eax
jne    1142 <test_assertNoEmpty+0x32>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <test_assertNoEmpty+0x3f>
jmp    1147 <test_assertNoEmpty+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assertNoEmpty>:
push   %rax
lea    0x2f10(%rip),%rdi
mov    $0x2,%esi
call   1030 <assertNoEmpty@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xed3(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@test_assertNoEmpty.a = internal global [2 x i32] [i32 1, i32 5]
@.str = [22 x i8] c"e: test_assertNoEmpty\00"
define i8* @test_assertNoEmpty() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @assertNoEmpty(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertNoEmpty.a, i64 0, i64 0), i32 2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@test_assertNoEmpty.a = internal global [2 x i32] [i32 1, i32 5]
@.str = [22 x i8] c"e: test_assertNoEmpty\00"
define i8* @test_assertNoEmpty() {
%1 = tail call i32 @assertNoEmpty(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertNoEmpty.a, i64 0, i64 0), i32 2)
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
float __gammaf_r_finite(float, int *);
float tgammaf(float __d) {
  signed int __local_signgam = 0;
  float __res;
  __res = __gammaf_r_finite(__d, &__local_signgam);
  return __local_signgam < 0 ? -__res : __res;
}


x86 assembly (clang, -O0):
<tgammaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <__gammaf_r_finite@plt>
movss  %xmm0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115d <tgammaf+0x4d>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <tgammaf+0x57>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgammaf>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <__gammaf_r_finite@plt>
cmpl   $0x0,0x4(%rsp)
jns    1131 <tgammaf+0x21>
xorps  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tgammaf(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store float %0, float* %2
store i32 0, i32* %3
%5 = load float, float* %2
%6 = call float @__gammaf_r_finite(float %5, i32* %3)
store float %6, float* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load float, float* %4
%11 = fneg float %10
br label %14
12: ; preds = %1
%13 = load float, float* %4
br label %14
14: ; preds = %12, %9
%15 = phi float [ %11, %9 ], [ %13, %12 ]
ret float %15
}

LLVM IR (-O2):
define float @tgammaf(float %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call float @__gammaf_r_finite(float %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
%7 = fneg float %4
%8 = select i1 %6, float %7, float %4
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("test"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define void @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void lldt(unsigned val) { asm volatile("lldt %0" : : "rm"(val)); }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @lldt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret void
}

LLVM IR (-O2):