xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ GetClockTicks(double *);
int /*<<< orphan*/ sleep(int);
float Sys_GetCPUSpeed(void) {
  double t0, t1;
  GetClockTicks(&t0);
  sleep(1);
  GetClockTicks(&t1);
  return (float)((t1 - t0) / 1000000.0);
}


x86 assembly (clang, -O0):
<Sys_GetCPUSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <GetClockTicks@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    -0x10(%rbp),%rdi
call   1030 <GetClockTicks@plt>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_GetCPUSpeed>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1030 <GetClockTicks@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0x8(%rsp),%rdi
call   1030 <GetClockTicks@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
divsd  0xeaa(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @Sys_GetCPUSpeed() {
%1 = alloca double
%2 = alloca double
%3 = call i32 @GetClockTicks(double* %1)
%4 = call i32 @sleep(i32 1)
%5 = call i32 @GetClockTicks(double* %2)
%6 = load double, double* %2
%7 = load double, double* %1
%8 = fsub double %6, %7
%9 = fdiv double %8, 1.000000e+06
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @Sys_GetCPUSpeed() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @GetClockTicks(double* %1)
%6 = call i32 @sleep(i32 1)
%7 = call i32 @GetClockTicks(double* %2)
%8 = load double, double* %2
%9 = load double, double* %1
%10 = fsub double %8, %9
%11 = fdiv double %10, 1.000000e+06
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ output_token();
int /*<<< orphan*/ printf(char *);
void decode_default(void) {
  output_token();
  printf("\n");
}


x86 assembly (clang, -O0):
<decode_default>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <output_token@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_default>:
push   %rax
xor    %eax,%eax
call   1040 <output_token@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @decode_default() {
%1 = tail call i32 (...) @output_token()
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int rcsdatetotm(char const *, struct tm *);
int timegm(struct tm *);
time_t rcsdatetotime(const char *revdate) {
  struct tm tm;
  time_t t;
  int error;
  error = rcsdatetotm(revdate, &tm);
  if (error)
    return (error);
  t = timegm(&tm);
  return (t);
}


x86 assembly (clang, -O0):
<rcsdatetotime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <rcsdatetotm@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1151 <rcsdatetotime+0x31>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <rcsdatetotime+0x43>
lea    -0x18(%rbp),%rdi
call   1030 <timegm@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsdatetotime>:
push   %rax
mov    %rsp,%rsi
call   1040 <rcsdatetotm@plt>
test   %eax,%eax
je     112f <rcsdatetotime+0xf>
pop    %rcx
ret
mov    %rsp,%rdi
call   1030 <timegm@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @rcsdatetotime(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i32 @rcsdatetotm(i8* %0, %struct.tm* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @timegm(%struct.tm* %2)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ %4, %1 ]
ret i32 %9
}
void rsync_signature_free(struct rsync_signature *rs) { rs = rs; }


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

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

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

LLVM IR (-O2):
%struct.rsync_signature = type opaque
define void @rsync_signature_free(%struct.rsync_signature* nocapture %0) {
ret void
}
void gtk_icon_view_get_markup_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_markup_column() {
ret void
}
void initCPU(void) {}


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

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

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

LLVM IR (-O2):
define void @initCPU() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *pointer) {
  if (pointer != NULL)
    free(pointer);
}


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

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

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

LLVM IR (-O2):
define void @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
unsigned long long ilog2_64(unsigned long long);
uint64_t next_p2_64(uint64_t x) { return 2ULL << ilog2_64(x - 1); }


x86 assembly (clang, -O0):
<next_p2_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <ilog2_64@plt>
mov    %rax,%rcx
mov    $0x2,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_p2_64>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <ilog2_64@plt>
mov    $0x2,%edx
mov    %eax,%ecx
shl    %cl,%rdx
mov    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @next_p2_64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @ilog2_64(i64 %4)
%6 = shl i64 2, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @next_p2_64(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @ilog2_64(i64 %2)
%4 = shl i64 2, %3
ret i64 %4
}
int test_imm_F7int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7int64_midword_mem>:
testb  $0xf7,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F7int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16187392
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mem2file(int numWds, int *src, int dst, int do_interrupt) {
  int ctrl, int_req;
  volatile int *IO = (int *)(0x3c000000 + 13 * 0x00000020);
  int_req = (do_interrupt ? 0x40000000 : 0);
  ctrl = 0x00000000 | (numWds & 0x03ff) | int_req;
  *(IO + 0) = ctrl;
  *(IO + 2) = (int)src;
  *(IO + 3) = dst & 0x01;
  return ctrl;
}


x86 assembly (clang, -O0):
<mem2file>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0x3c0001a0,%eax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%edx
xor    %eax,%eax
mov    $0x40000000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
or     $0x0,%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%ecx
and    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem2file>:
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
shl    $0x1e,%eax
and    $0x3ff,%edi
or     %edi,%eax
mov    %eax,0x3c0001a0
mov    %esi,0x3c0001a8
and    $0x1,%edx
mov    %edx,0x3c0001ac
ret

LLVM IR (-O0):
define i32 @mem2file(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32* inttoptr (i64 1006633376 to i32*), i32** %11
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1073741824, i32 0
store i32 %15, i32* %10
%16 = load i32, i32* %5
%17 = and i32 %16, 1023
%18 = or i32 0, %17
%19 = load i32, i32* %10
%20 = or i32 %18, %19
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = load i32*, i32** %11
%23 = getelementptr inbounds i32, i32* %22, i64 0
store volatile i32 %21, i32* %23
%24 = load i32*, i32** %6
%25 = ptrtoint i32* %24 to i32
%26 = load i32*, i32** %11
%27 = getelementptr inbounds i32, i32* %26, i64 2
store volatile i32 %25, i32* %27
%28 = load i32, i32* %7
%29 = and i32 %28, 1
%30 = load i32*, i32** %11
%31 = getelementptr inbounds i32, i32* %30, i64 3
store volatile i32 %29, i32* %31
%32 = load i32, i32* %9
ret i32 %32
}

LLVM IR (-O2):
define i32 @mem2file(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i32 0, i32 1073741824
%7 = and i32 %0, 1023
%8 = or i32 %6, %7
store volatile i32 %8, i32* inttoptr (i64 1006633376 to i32*)
%9 = ptrtoint i32* %1 to i64
%10 = trunc i64 %9 to i32
store volatile i32 %10, i32* inttoptr (i64 1006633384 to i32*)
%11 = and i32 %2, 1
store volatile i32 %11, i32* inttoptr (i64 1006633388 to i32*)
ret i32 %8
}
int icmp(const void *p, const void *q) {
  const int *m = p, *n = q;
  return *m > *n ? 1 : (*m == *n ? 0 : -1);
}


x86 assembly (clang, -O0):
<icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jle    113b <icmp+0x3b>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <icmp+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int strCRC32add(int /*<<< orphan*/, char const *, int);
int strCRC32end(int, int);
int strCRC32(const char *str, int len) {
  int crc;
  crc = strCRC32add(0, str, len);
  crc = strCRC32end(crc, len);
  return crc;
}


x86 assembly (clang, -O0):
<strCRC32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <strCRC32add@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <strCRC32end@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCRC32>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
xor    %edi,%edi
mov    %ebx,%edx
call   1030 <strCRC32add@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <strCRC32end@plt>

LLVM IR (-O0):
define i32 @strCRC32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @strCRC32add(i32 0, i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @strCRC32end(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @strCRC32(i8* %0, i32 %1) {
%3 = tail call i32 @strCRC32add(i32 0, i8* %0, i32 %1)
%4 = tail call i32 @strCRC32end(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
long long PAPI_get_virt_cyc();
void PAPIF_GET_VIRT_CYC(long long *virt_cyc) {
  *virt_cyc = PAPI_get_virt_cyc();
}


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

x86 assembly (clang, -O2):
<PAPIF_GET_VIRT_CYC>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_virt_cyc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_GET_VIRT_CYC(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_virt_cyc()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @PAPIF_GET_VIRT_CYC(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_virt_cyc()
store i64 %2, i64* %0
ret void
}
void g_io_channel_get_line_term() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_get_line_term() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_help(void) {
  printf("For everything type pcalc e\nFor functions  type pcalc f\nFor "
         "controls   type pcalc l\nFor operators  type pcalc o\nFor constants  "
         "type pcalc c\n");
}


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

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

LLVM IR (-O0):
@.str = [141 x i8] c"For everything type pcalc e\0AFor functions type pcalc f\0AFor controls type pcalc l\0AFor operators type pcalc o\0AFor constants type pcalc c\0A\00"
define void @help_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [140 x i8] c"For everything type pcalc e\0AFor functions type pcalc f\0AFor controls type pcalc l\0AFor operators type pcalc o\0AFor constants type pcalc c\00"
define void @help_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([140 x i8], [140 x i8]* @str, i64 0, i64 0))
ret void
}
short to_sign_short(__float128 a) { return (short)a; }


x86 assembly (clang, -O0):
<to_sign_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
call   1120 <__fixtfsi>
cwtl
add    $0x10,%rsp
pop    %rbp
ret
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_sign_short>:
push   %rax
call   1110 <__fixtfsi>
pop    %rcx
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define signext i16 @to_sign_short(fp128 %0) {
%2 = alloca fp128
store fp128 %0, fp128* %2
%3 = load fp128, fp128* %2
%4 = fptosi fp128 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @to_sign_short(fp128 %0) {
%2 = fptosi fp128 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
char *ft_strdup(char *);
void cut_stock(char **stock, char *str) {
  char *tmp;
  tmp = ft_strdup(str + 1);
  ft_strdel(stock);
  *stock = tmp;
}


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

x86 assembly (clang, -O2):
<cut_stock>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x1(%rsi),%rdi
call   1040 <ft_strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <ft_strdel@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cut_stock(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i8* @ft_strdup(i8* %7)
store i8* %8, i8** %5
%9 = load i8**, i8*** %3
%10 = call i32 @ft_strdel(i8** %9)
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @cut_stock(i8** %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = tail call i8* @ft_strdup(i8* %3)
%5 = tail call i32 @ft_strdel(i8** %0)
store i8* %4, i8** %0
ret void
}
int aboveZero(int n) {
  int out = (n > 0) ? n : 0;
  return out;
}


x86 assembly (clang, -O0):
<aboveZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <aboveZero+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <aboveZero+0x26>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <aboveZero+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aboveZero>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @aboveZero(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 0, %8 ]
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @aboveZero(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
ret i32 %3
}
/* Variables and functions */
char isspace(unsigned char c) {
  if (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
je     1158 <isspace+0x58>
movzbl -0x2(%rbp),%eax
cmp    $0xc,%eax
je     1158 <isspace+0x58>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
je     1158 <isspace+0x58>
movzbl -0x2(%rbp),%eax
cmp    $0xd,%eax
je     1158 <isspace+0x58>
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
je     1158 <isspace+0x58>
movzbl -0x2(%rbp),%eax
cmp    $0xb,%eax
jne    1161 <isspace+0x61>
movb   $0x1,-0x1(%rbp)
jmp    1165 <isspace+0x65>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%al
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110b <isspace+0xb>
ret
cmp    $0x20,%dil
je     110a <isspace+0xa>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @isspace(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i8 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_type();
int /*<<< orphan*/ printf(char *);
void check_load() {
  char user_name[100];
  char passwd[20];
  printf("server IP address : ");
  printf("user name : ");
  printf("password : ");
  clear_type();
}


x86 assembly (clang, -O0):
<check_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <clear_type@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_load>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear_type@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"server IP address : \00"
@.str.1 = [13 x i8] c"user name : \00"
@.str.2 = [12 x i8] c"password : \00"
define void @check_load() {
%1 = alloca [100 x i8]
%2 = alloca [20 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @clear_type()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"server IP address : \00"
@.str.1 = [13 x i8] c"user name : \00"
@.str.2 = [12 x i8] c"password : \00"
define void @check_load() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @clear_type()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ correctnessTest();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ speedTest();
int main() {
  correctnessTest();
  printf("All correctness tests succeeded! Press enter to continue!\n");
  getchar();
  speedTest();
  printf("Test completed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <correctnessTest@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1050 <speedTest@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <correctnessTest@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1050 <speedTest@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"All correctness tests succeeded! Press enter to continue!\0A\00"
@.str.1 = [17 x i8] c"Test completed.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @correctnessTest()
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
%5 = call i32 (...) @speedTest()
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"All correctness tests succeeded! Press enter to continue!\00"
@str.2 = [16 x i8] c"Test completed.\00"
define i32 @main() {
%1 = tail call i32 (...) @correctnessTest()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @speedTest()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void zap_relinquish(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @zap_relinquish() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
int h() {}


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

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

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

LLVM IR (-O2):
define i32 @h() {
ret i32 undef
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *LinkedList_Create(int);
int /*<<< orphan*/ LinkedList_Destroy(struct node *);
int /*<<< orphan*/ LinkedList_Print(struct node *);
struct node *reverse(struct node *);
int main(void) {
  struct node *list = LinkedList_Create(8);
  struct node *head = list;
  LinkedList_Print(head);
  head = reverse(head);
  LinkedList_Print(head);
  LinkedList_Destroy(list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <LinkedList_Print@plt>
mov    -0x18(%rbp),%rdi
call   1030 <reverse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <LinkedList_Print@plt>
mov    -0x10(%rbp),%rdi
call   1060 <LinkedList_Destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <LinkedList_Print@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %rax,%rdi
call   1040 <LinkedList_Print@plt>
mov    %rbx,%rdi
call   1060 <LinkedList_Destroy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
%4 = call %struct.node* @LinkedList_Create(i32 8)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
store %struct.node* %5, %struct.node** %3
%6 = load %struct.node*, %struct.node** %3
%7 = call i32 @LinkedList_Print(%struct.node* %6)
%8 = load %struct.node*, %struct.node** %3
%9 = call %struct.node* @reverse(%struct.node* %8)
store %struct.node* %9, %struct.node** %3
%10 = load %struct.node*, %struct.node** %3
%11 = call i32 @LinkedList_Print(%struct.node* %10)
%12 = load %struct.node*, %struct.node** %2
%13 = call i32 @LinkedList_Destroy(%struct.node* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* @LinkedList_Create(i32 8)
%2 = tail call i32 @LinkedList_Print(%struct.node* %1)
%3 = tail call %struct.node* @reverse(%struct.node* %1)
%4 = tail call i32 @LinkedList_Print(%struct.node* %3)
%5 = tail call i32 @LinkedList_Destroy(%struct.node* %1)
ret i32 0
}
/* Variables and functions */
bool is_whitespace(int c) { return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_whitespace+0x2f>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <is_whitespace+0x2f>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0x9,%edi
je     110f <is_whitespace+0xf>
cmp    $0x20,%edi
jne    1110 <is_whitespace+0x10>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_whitespace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ get_pid();
int /*<<< orphan*/ printf(char *);
report_start() {
  if (!get_pid())
    printf("\nStarting test ...\n");
  return (0);
}


x86 assembly (clang, -O0):
<report_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_pid@plt>
cmp    $0x0,%eax
jne    1140 <report_start+0x20>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_start>:
push   %rax
xor    %eax,%eax
call   1040 <get_pid@plt>
test   %eax,%eax
jne    1138 <report_start+0x18>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0AStarting test ...\0A\00"
define i32 @report_start() {
%1 = call i32 (...) @get_pid()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\0AStarting test ...\00"
define i32 @report_start() {
%1 = tail call i32 (...) @get_pid()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
__typeof__(strncat(1, 1, (void *)1)) test_strncat_168(void) {
  return strncat(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strncat_168>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <strncat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strncat_168>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define i8* @test_strncat_168() {
%1 = call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strncat_168() {
%1 = tail call i8* @strncat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int peek(void) {
  int c = getchar();
  ungetc(c, stdin);
  return c;
}


x86 assembly (clang, -O0):
<peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <ungetc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @peek() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @stdin
%5 = call i32 @ungetc(i32 %3, i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @peek() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @stdin
%3 = tail call i32 @ungetc(i32 %1, i32 %2)
ret i32 %1
}
int live(int *generation, int lenge) {
  int p;
  for (p = 0; p < lenge; p++) {
    if (generation[p]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<live>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <live+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113c <live+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <live+0x56>
jmp    1141 <live+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <live+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @live(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
/* Variables and functions */
char toupper(char);
void upperstring(char *str) {
  char *pts;
  for (pts = str; *pts; pts++) {
    *pts = toupper(*pts);
  }
}


x86 assembly (clang, -O0):
<upperstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <upperstring+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <upperstring+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @upperstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
float log(float);
double loglineal(float t) {
  float resultado;
  resultado = t * log(t);
  return resultado;
}


x86 assembly (clang, -O0):
<loglineal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loglineal>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <log@plt>
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @loglineal(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @log(float %5)
%7 = fmul float %4, %6
store float %7, float* %3
%8 = load float, float* %3
%9 = fpext float %8 to double
ret double %9
}

LLVM IR (-O2):
define double @loglineal(float %0) {
%2 = tail call float @log(float %0)
%3 = fmul float %2, %0
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ report_and_exit();
int /*<<< orphan*/ test_block_source();
int /*<<< orphan*/ test_unblock_source();
int main() {
  initialize();
  test_block_source();
  test_unblock_source();
  report_and_exit();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <initialize@plt>
xor    %eax,%eax
call   1060 <test_block_source@plt>
xor    %eax,%eax
call   1030 <test_unblock_source@plt>
xor    %eax,%eax
call   1040 <report_and_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @test_block_source()
%4 = call i32 (...) @test_unblock_source()
%5 = call i32 (...) @report_and_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @test_block_source()
%3 = tail call i32 (...) @test_unblock_source()
%4 = tail call i32 (...) @report_and_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
void eeh_memcpy_toio(void *dest, void *src, unsigned long n) {
  void *vdest =
      (void *)((((unsigned long)(dest)) & 0xFFFFFFFF) | (0xEUL << 60));
  memcpy(vdest, src, n);
}


x86 assembly (clang, -O0):
<eeh_memcpy_toio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
movabs $0xe000000000000000,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeh_memcpy_toio>:
mov    %edi,%eax
movabs $0xe000000000000000,%rdi
or     %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @eeh_memcpy_toio(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, 4294967295
%11 = or i64 %10, -2305843009213693952
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @eeh_memcpy_toio(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = and i64 %4, 4294967295
%6 = or i64 %5, -2305843009213693952
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %1, i64 %2)
ret void
}
int test_imm_57int16_reg(short val) {
  return ((val) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x57,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_57int16_reg(i16 signext %0) {
%2 = and i16 %0, 87
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) {
  die("Usage: build [-b] bootsect setup system rootdev vmlinux [> image]");
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"Usage: build [-b] bootsect setup system rootdev vmlinux [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"Usage: build [-b] bootsect setup system rootdev vmlinux [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int remove(char const *);
__attribute__((__weak__, __always___)) int
softboundcets_remove(const char *pathname) {
  return remove(pathname);
}


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

x86 assembly (clang, -O2):
<softboundcets_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_remove(i8* %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
__attribute((__gnu___)) extern int g(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    return (c + ('a' - 'A'));
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void RTSha1ToString(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha1ToString() {
ret void
}