xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ os_gettimeofday(struct timeval *);
double exaperf_gettime(void) {
  struct timeval tv;
  double result;
  os_gettimeofday(&tv);
  result = tv.tv_sec * 1.0 + tv.tv_usec / 1000000.0;
  return result;
}


x86 assembly (clang, -O0):
<exaperf_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <os_gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exaperf_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <os_gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @exaperf_gettime() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @os_gettimeofday(%struct.timeval* %1)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+00, double %8)
store double %9, double* %2
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @exaperf_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @os_gettimeofday(%struct.timeval* %1)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ send_user_interrupt(int);
void send_software_interrupt(int intrno) {
  int intrsrc = intrno + 3;
  if (!(3 <= intrsrc < 6))
    error("Invalid user interrupt number");
  send_user_interrupt(intrsrc);
}


x86 assembly (clang, -O0):
<send_software_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x6,%eax
jl     1159 <send_software_interrupt+0x39>
lea    0xeac(%rip),%rdi
call   1040 <error@plt>
mov    -0x8(%rbp),%edi
call   1030 <send_user_interrupt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_software_interrupt>:
add    $0x3,%edi
jmp    1030 <send_user_interrupt@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Invalid user interrupt number\00"
define void @send_software_interrupt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 3, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %8, 6
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
%14 = call i32 @send_user_interrupt(i32 %13)
ret void
}

LLVM IR (-O2):
define void @send_software_interrupt(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = tail call i32 @send_user_interrupt(i32 %2)
ret void
}
hello() {}


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

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

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

LLVM IR (-O2):
define i32 @hello() {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0xFFFF8030))) |=
      (ui32IntFlags & 0x00070000) >> 16;
  (*((volatile unsigned long *)(ui32Base + 0x00000040))) |=
      ui32IntFlags & 0x0000ffff;
}


x86 assembly (clang, -O0):
<DESIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x70000,%eax
sar    $0x10,%eax
movslq %eax,%rdx
mov    -0x4(%rbp),%eax
add    $0xffff8030,%eax
mov    %eax,%eax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
movslq %eax,%rdx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntEnable>:
movzwl %si,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
and    $0x7,%ecx
lea    -0x7fd0(%rdi),%edx
or     %rcx,(%rdx)
movslq %edi,%rcx
or     %rax,0x40(%rcx)
ret

LLVM IR (-O0):
define void @DESIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = sext i32 %7 to i64
%9 = load i32, i32* %3
%10 = add i32 %9, -32720
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %8
store volatile i64 %14, i64* %12
%15 = load i32, i32* %4
%16 = and i32 %15, 65535
%17 = sext i32 %16 to i64
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 64
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = or i64 %22, %17
store volatile i64 %23, i64* %21
ret void
}

LLVM IR (-O2):
define void @DESIntEnable(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = zext i32 %4 to i64
%6 = add i32 %0, -32720
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
%11 = and i32 %1, 65535
%12 = zext i32 %11 to i64
%13 = add nsw i32 %0, 64
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = or i64 %16, %12
store volatile i64 %17, i64* %15
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ check;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _udphdr_check_ntohs(struct udphdr *h) { return ntohs(h->check); }


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

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

LLVM IR (-O0):
%struct.udphdr = type { i32 }
define i32 @_udphdr_check_ntohs(%struct.udphdr* %0) {
%2 = alloca %struct.udphdr*
store %struct.udphdr* %0, %struct.udphdr** %2
%3 = load %struct.udphdr*, %struct.udphdr** %2
%4 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32 @_udphdr_check_ntohs(%struct.udphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wFilePosition(int);
scalar_t__ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinLoc() { wStackPushNumber(wFilePosition((int)wStackPopNumber())); }


x86 assembly (clang, -O0):
<wBuiltinLoc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <wFilePosition@plt>
mov    %eax,%edi
call   1040 <wStackPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinLoc>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <wFilePosition@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumber@plt>

LLVM IR (-O0):
define void @wBuiltinLoc() {
%1 = call i64 (...) @wStackPopNumber()
%2 = trunc i64 %1 to i32
%3 = call i32 @wFilePosition(i32 %2)
%4 = call i32 @wStackPushNumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @wBuiltinLoc() {
%1 = tail call i64 (...) @wStackPopNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @wFilePosition(i32 %2)
%4 = tail call i32 @wStackPushNumber(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, void *);
int fgetc(void *hf) {
  int i = 0;
  if (!fread(&i, 1, 1, hf))
    return -1;
  return i;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x0,%eax
jne    114c <fgetc+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <fgetc+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fgetc(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @fread(i32* %2, i32 1, i32 1, i8* %0)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
unsigned int hashatom(const void *key) { return (unsigned long)key >> 2; }


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

x86 assembly (clang, -O2):
<hashatom>:
mov    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @hashatom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hashatom(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int stat(char *, struct stat *);
void ensurePath(char *path) {
  struct stat st = {0};
  if (stat(path, &st) == -1) {
    mkdir(path, 0777);
  }
}


x86 assembly (clang, -O0):
<ensurePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0xffffffff,%eax
jne    1170 <ensurePath+0x40>
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensurePath>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1145 <ensurePath+0x25>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1ff,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @ensurePath(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = bitcast %struct.stat* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @mkdir(i8* %9, i32 511)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @ensurePath(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @mkdir(i8* %0, i32 511)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
struct filter_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct filter_args_info *);
int /*<<< orphan*/ clear_given(struct filter_args_info *);
int /*<<< orphan*/ init_args_info(struct filter_args_info *);
void filter_cmdline_parser_init(struct filter_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<filter_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.filter_args_info = type { i32 }
define void @filter_cmdline_parser_init(%struct.filter_args_info* %0) {
%2 = alloca %struct.filter_args_info*
store %struct.filter_args_info* %0, %struct.filter_args_info** %2
%3 = load %struct.filter_args_info*, %struct.filter_args_info** %2
%4 = call i32 @clear_given(%struct.filter_args_info* %3)
%5 = load %struct.filter_args_info*, %struct.filter_args_info** %2
%6 = call i32 @clear_args(%struct.filter_args_info* %5)
%7 = load %struct.filter_args_info*, %struct.filter_args_info** %2
%8 = call i32 @init_args_info(%struct.filter_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.filter_args_info = type { i32 }
define void @filter_cmdline_parser_init(%struct.filter_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.filter_args_info* %0)
%3 = tail call i32 @clear_args(%struct.filter_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.filter_args_info* %0)
ret void
}
long IS_ERR(const void *ptr) {
  return (((unsigned long)ptr) > (unsigned long)-1000L);
}


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffffc18,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR>:
xor    %eax,%eax
cmp    $0xfffffffffffffc19,%rdi
setae  %al
ret

LLVM IR (-O0):
define i64 @IS_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp ugt i64 %4, -1000
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @IS_ERR(i8* readnone %0) {
%2 = icmp ugt i8* %0, inttoptr (i64 -1000 to i8*)
%3 = zext i1 %2 to i64
ret i64 %3
}
void nrf_802154_priority_drop_timeslot_exit_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_priority_drop_timeslot_exit_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hzf_col(int column) {
  if (column > 0)
    printf("@%ld,", column);
  else if (column < 0)
    printf("+%ld,", -column);
  else
    printf(";");
}


x86 assembly (clang, -O0):
<hzf_col>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113b <hzf_col+0x2b>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <hzf_col+0x60>
cmpl   $0x0,-0x4(%rbp)
jge    115d <hzf_col+0x4d>
xor    %esi,%esi
sub    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116b <hzf_col+0x5b>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <hzf_col+0x60>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hzf_col>:
mov    %edi,%esi
test   %edi,%edi
jle    1134 <hzf_col+0x14>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
js     1140 <hzf_col+0x20>
mov    $0x3b,%edi
jmp    1030 <putchar@plt>
neg    %esi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"@%ld,\00"
@.str.1 = [6 x i8] c"+%ld,\00"
define void @hzf_col(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %12
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = sub nsw i32 0, %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %12
10: ; preds = %5
%11 = tail call i32 @putchar(i32 59)
br label %12
12: ; preds = %7, %10, %3
ret void
}
/* Variables and functions */
scalar_t__ work();
int main() {
  while (work())
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <work@plt>
cmp    $0x0,%rax
je     1135 <main+0x25>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <work@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @work()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @work()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
void ub_dentry_uncharge_locked(struct dentry *d) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @ub_dentry_uncharge_locked(%struct.dentry* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int determ_isneg_float(uint32_t a) { return !!(a & 0x80000000); }


x86 assembly (clang, -O0):
<determ_isneg_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_isneg_float>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @determ_isneg_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -2147483648
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @determ_isneg_float(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *nstrcat(char *str1, char *str2) {
  char *res = malloc(strlen(str1) + strlen(str2));
  strcpy(res, str1);
  strcat(res, str2);
}


x86 assembly (clang, -O0):
<nstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nstrcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @nstrcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %8, %10
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %6
%17 = load i8*, i8** %5
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @nstrcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, %3
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
%8 = tail call i32 @strcat(i8* %6, i8* %1)
ret i8* undef
}
/* Variables and functions */
float ceilf(float);
float __ocl_ceil_float(float src) { return ceilf(src); }


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

x86 assembly (clang, -O2):
<__ocl_ceil_float>:
jmp    1030 <ceilf@plt>

LLVM IR (-O0):
define float @__ocl_ceil_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.ceil.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__ocl_ceil_float(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
int g(int a, int b, int c) {
  if (a == 42 && b > c)
    return 42;
  return a;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jne    112f <g+0x2f>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    112f <g+0x2f>
movl   $0x2a,-0x4(%rbp)
jmp    1135 <g+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    %edx,%esi
mov    $0x2a,%eax
cmovle %edi,%eax
cmp    $0x2a,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 42
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
%7 = select i1 %6, i32 42, i32 %0
ret i32 %7
}
/* Variables and functions */
int bar();
int foo();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (foo() != 42)
    return 1;
  if (bar() != 42)
    return 1;
  fprintf(stderr, "ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x2a,%eax
je     1162 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    119a <main+0x6a>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x2a,%eax
je     117e <main+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    119a <main+0x6a>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <foo@plt>
mov    $0x1,%ebx
cmp    $0x2a,%eax
jne    1165 <main+0x35>
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x2a,%eax
jne    1165 <main+0x35>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"ok\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @foo()
%7 = icmp ne i32 %6, 42
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = call i32 (...) @bar()
%11 = icmp ne i32 %10, 42
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %3
br label %16
13: ; preds = %9
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %16
16: ; preds = %13, %12, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"ok\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i32 (...) @bar()
%7 = icmp eq i32 %6, 42
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %5, %2, %8
%12 = phi i32 [ 0, %8 ], [ 1, %2 ], [ 1, %5 ]
ret i32 %12
}
/* Variables and functions */
int errno;
int syscall(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/);
int kill(int pid, int sig) {
  int ret = syscall(12, pid, sig, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xc,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115e <kill+0x4e>
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <kill+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0xc,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <kill+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @kill(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @syscall(i32 12, i32 %7, i32 %8, i32 0, i32 0, i32 0)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %6
%14 = sub nsw i32 0, %13
store i32 %14, i32* @errno
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 12, i32 %0, i32 %1, i32 0, i32 0, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
int sumofsquare(int n) {
  int i, sum = 0;
  for (i = 1; i <= n; i++) {
    sum += i * i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumofsquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <sumofsquare+0x3c>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sumofsquare+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumofsquare>:
test   %edi,%edi
jle    112d <sumofsquare+0x2d>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
lea    -0x3(%rdi),%eax
imul   %rcx,%rax
shr    %rax
imul   $0x55555556,%eax,%eax
shr    %rcx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
lea    (%rcx,%rdi,4),%eax
add    $0xfffffffd,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumofsquare(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = add nsw i32 %0, -3
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = mul i32 %13, 1431655766
%15 = lshr i33 %8, 1
%16 = trunc i33 %15 to i32
%17 = mul i32 %16, 5
%18 = add i32 %14, %17
%19 = shl i32 %0, 2
%20 = add i32 %18, %19
%21 = add i32 %20, -3
br label %22
22: ; preds = %3, %1
%23 = phi i32 [ 0, %1 ], [ %21, %3 ]
ret i32 %23
}
char *skipsp(char *s) {
  while (((*s) == ' ' || (*s) == '\t'))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skipsp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skipsp+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skipsp+0x3d>
jmp    114e <skipsp+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipsp+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipsp>:
mov    %rdi,%rax
jmp    1114 <skipsp+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipsp+0x10>
cmp    $0x9,%cl
je     1110 <skipsp+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipsp(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void st_thread_yield(void) {}


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

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

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

LLVM IR (-O2):
define void @st_thread_yield() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  int j;
  i = (-98 < 0 ? (- -98) : (-98)) * 10;
  j = (98 < 0 ? (-98) : (98)) * 10;
  printf("%d, %d\n", i, j);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3d4,-0x8(%rbp)
movl   $0x3d4,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%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    $0x3d4,%esi
mov    $0x3d4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 980, i32 980)
ret i32 0
}
int main(int argc, char **argv, char **envp) {
  __asm__ __volatile__("label:nop;nop;nop;"
                       "jmp label;");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)

x86 assembly (clang, -O2):
<main>:
nop
nop
nop
jmp    1100 <main>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
tail call void asm sideeffect "label:nop;nop;nop;jmp label;", "~{dirflag},~{fpsr},~{flags}"()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xd6() {
  Assert_real((isascii(214) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1075, ("isascii should be 0 for 0xd6"));
}


x86 assembly (clang, -O0):
<t_isascii_0xd6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd6,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x433,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xd6>:
push   %rax
mov    $0xd6,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x433,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd6\00"
define void @t_isascii_0xd6() {
%1 = call i64 @isascii(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd6\00"
define void @t_isascii_0xd6() {
%1 = tail call i64 @isascii(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void IntIfClkFreeRunSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x10)))) &= ~(0x1);
}


x86 assembly (clang, -O0):
<IntIfClkFreeRunSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200010,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x48200010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntIfClkFreeRunSet>:
andl   $0xfffffffe,0x48200010
fe
ret

LLVM IR (-O0):
define void @IntIfClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntIfClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}
/* Type definitions */
struct DListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct DListNode *const);
void dlistNodeDelete(struct DListNode *const node) { free(node); }


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

x86 assembly (clang, -O2):
<dlistNodeDelete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.DListNode = type { i32 }
define void @dlistNodeDelete(%struct.DListNode* nocapture %0) {
%2 = tail call i32 @free(%struct.DListNode* %0)
ret void
}
int test_imm_55uint16_reg(unsigned short val) {
  return ((val) & (-0x55 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_55uint16_reg>:
test   $0xffab,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_55uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -85
%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_55uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -85
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void primary_reference(void) {
  printf("INFO: Called primary_reference function.\n");
}


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

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

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

LLVM IR (-O2):
@str = [41 x i8] c"INFO: Called primary_reference function.\00"
define void @primary_reference() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
double radius_effective(int mode, double radius, double thick_shell,
                        double thick_solvent, double fp_n_shells) {
  return radius + fp_n_shells * thick_shell +
         (fp_n_shells - 1.0) * thick_solvent;
}


x86 assembly (clang, -O0):
<radius_effective>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xec1(%rip),%xmm2
subsd  %xmm2,%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_effective>:
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @radius_effective(i32 %0, double %1, double %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %7
%12 = load double, double* %10
%13 = load double, double* %8
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %11)
%15 = load double, double* %10
%16 = fsub double %15, 1.000000e+00
%17 = load double, double* %9
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double %14)
ret double %18
}

LLVM IR (-O2):
define double @radius_effective(i32 %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %1)
%7 = fadd double %4, -1.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %7, double %3, double %6)
ret double %8
}
/* Variables and functions */
int atoi(char *);
int const optind;
int get_argv_int(char **argv, const int index) {
  return atoi(argv[index + optind]);
}


x86 assembly (clang, -O0):
<get_argv_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    0x2ebb(%rip),%rdx
add    (%rdx),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_argv_int>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <atoi@plt>

LLVM IR (-O0):
@optind = constant i32 0
define i32 @get_argv_int(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @optind
%8 = add nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %5, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@optind = constant i32 0
define i32 @get_argv_int(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
ret i32 %6
}
void foo(int k) {
  int i = 0;
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
void byte2hex(char *dst, unsigned char byte) {
  static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7',
                          '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  *dst = digits[byte >> 4];
  *(dst + 1) = digits[byte & 0xf];
}


x86 assembly (clang, -O0):
<byte2hex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f11(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ef7(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte2hex>:
mov    %esi,%eax
mov    %rax,%rcx
shr    $0x4,%rcx
lea    0xef0(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rdi)
and    $0xf,%eax
mov    (%rax,%rdx,1),%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
@byte2hex.digits = internal global [16 x i8] c"0123456789abcdef"
define void @byte2hex(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* @byte2hex.digits, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
store i8 %10, i8* %11
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i8], [16 x i8]* @byte2hex.digits, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
@byte2hex.digits = internal unnamed_addr constant [16 x i8] c"0123456789abcdef"
define void @byte2hex(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 4
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @byte2hex.digits, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %0
%8 = and i32 %3, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* @byte2hex.digits, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear_line() {
  int i;
  for (i = 0; i < 100; ++i) {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1143 <clear_line+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clear_line+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <clear_line+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clear_line() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 10)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}