xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int isupper(scalar_t__);
int iswupper(wint_t wc) { return ((wc < (wint_t)0x100 ? isupper(wc) : 0)); }


x86 assembly (clang, -O0):
<iswupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x100,-0x8(%rbp)
jge    113b <iswupper+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <isupper@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <iswupper+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <iswupper+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswupper>:
cmp    $0xff,%rdi
jg     111e <iswupper+0xe>
jmp    1030 <isupper@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswupper(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isupper(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int CLOCK_MONOTONIC;
int /*<<< orphan*/ __NR_clock_gettime;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ syscall(int /*<<< orphan*/, int, struct timespec *);
void get_time(struct timespec *ts) {
  int clock_type = CLOCK_MONOTONIC;
  if (syscall(__NR_clock_gettime, clock_type, ts)) {
    printf("clock_gettime(MONOTONIC/REALTIME) failed");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1040 <syscall@plt>
cmp    $0x0,%rax
je     117d <get_time+0x4d>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
test   %rax,%rax
jne    1152 <get_time+0x22>
pop    %rax
ret
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@__NR_clock_gettime = global i32 0
@.str = [41 x i8] c"clock_gettime(MONOTONIC/REALTIME) failed\00"
define void @get_time(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca i32
store %struct.timespec* %0, %struct.timespec** %2
%4 = load i32, i32* @CLOCK_MONOTONIC
store i32 %4, i32* %3
%5 = load i32, i32* @__NR_clock_gettime
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = call i64 @syscall(i32 %5, i32 %6, %struct.timespec* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@__NR_clock_gettime = global i32 0
@.str = [41 x i8] c"clock_gettime(MONOTONIC/REALTIME) failed\00"
define void @get_time(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = load i32, i32* @__NR_clock_gettime
%4 = tail call i64 @syscall(i32 %3, i32 %2, %struct.timespec* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t letohll(uint64_t value) {
  return (((uint64_t)((uint8_t *)&value)[7]) << 56) |
         (((uint64_t)((uint8_t *)&value)[6]) << 48) |
         (((uint64_t)((uint8_t *)&value)[5]) << 40) |
         (((uint64_t)((uint8_t *)&value)[4]) << 32) |
         (((uint64_t)((uint8_t *)&value)[3]) << 24) |
         (((uint64_t)((uint8_t *)&value)[2]) << 16) |
         (((uint64_t)((uint8_t *)&value)[1]) << 8) |
         (((uint64_t)((uint8_t *)&value)[0]) << 0);
}


x86 assembly (clang, -O0):
<letohll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x34(%rbp),%rax
mov    $0x38,%ecx
shl    %cl,%eax
mov    0x2c(%rbp),%rcx
mov    %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x24(%rbp),%rcx
mov    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x1c(%rbp),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x14(%rbp),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    0xc(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    0x4(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @letohll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 7
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 56
%8 = bitcast i32* %2 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 6
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 48
%13 = or i32 %7, %12
%14 = bitcast i32* %2 to i64*
%15 = getelementptr inbounds i64, i64* %14, i64 5
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 40
%19 = or i32 %13, %18
%20 = bitcast i32* %2 to i64*
%21 = getelementptr inbounds i64, i64* %20, i64 4
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %23, 32
%25 = or i32 %19, %24
%26 = bitcast i32* %2 to i64*
%27 = getelementptr inbounds i64, i64* %26, i64 3
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = shl i32 %29, 24
%31 = or i32 %25, %30
%32 = bitcast i32* %2 to i64*
%33 = getelementptr inbounds i64, i64* %32, i64 2
%34 = load i64, i64* %33
%35 = trunc i64 %34 to i32
%36 = shl i32 %35, 16
%37 = or i32 %31, %36
%38 = bitcast i32* %2 to i64*
%39 = getelementptr inbounds i64, i64* %38, i64 1
%40 = load i64, i64* %39
%41 = trunc i64 %40 to i32
%42 = shl i32 %41, 8
%43 = or i32 %37, %42
%44 = bitcast i32* %2 to i64*
%45 = getelementptr inbounds i64, i64* %44, i64 0
%46 = load i64, i64* %45
%47 = trunc i64 %46 to i32
%48 = shl i32 %47, 0
%49 = or i32 %43, %48
ret i32 %49
}

LLVM IR (-O2):
define i32 @letohll(i32 %0) {
ret i32 poison
}
/* Variables and functions */
double sin(double);
double fpu_fsin(double a) {
  double b;
  b = sin(a);
  return b;
}


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

x86 assembly (clang, -O2):
<fpu_fsin>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @fpu_fsin(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sin(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @fpu_fsin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
scalar_t__ strlen(char const *);
size_t utf8to16(const char *unicode8, u_int16_t *buf, size_t buflen) {
  size_t len = 0;
  char *pstr;
  errno = EIO;
  return -1;
  if (!unicode8 || !buf || !buflen)
    return 0;
  pstr = (char *)malloc(strlen(unicode8) + 1);
  if (!pstr)
    return -1;
  len = *pstr;
  free(pstr);
  return len;
}


x86 assembly (clang, -O0):
<utf8to16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8to16>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i64 @utf8to16(i8* %0, i32* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i64 0, i64* %7
%9 = load i32, i32* @EIO
store i32 %9, i32* @errno
ret i64 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i64 @utf8to16(i8* nocapture readnone %0, i32* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @EIO
store i32 %4, i32* @errno
ret i64 -1
}
void Seq(void) {
#pragma acc loop auto
  for (int ix = 0; ix < 10; ix++) {
  }
}


x86 assembly (clang, -O0):
<Seq>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <Seq+0x28>
jmp    111a <Seq+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <Seq+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Seq() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @Seq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void sys_err(const char *str) {
  perror(str);
  exit(1);
}


x86 assembly (clang, -O0):
<sys_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sys_err>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sys_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sys_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
extern double s1d1s2s3(float s1, double d1, float s2, float s3) {
  return s1 + d1 + s2 + s3;
}


x86 assembly (clang, -O0):
<s1d1s2s3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1d1s2s3>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @s1d1s2s3(float %0, double %1, float %2, float %3) {
%5 = alloca float
%6 = alloca double
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store double %1, double* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = load double, double* %6
%12 = fadd double %10, %11
%13 = load float, float* %7
%14 = fpext float %13 to double
%15 = fadd double %12, %14
%16 = load float, float* %8
%17 = fpext float %16 to double
%18 = fadd double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @s1d1s2s3(float %0, double %1, float %2, float %3) {
%5 = fpext float %0 to double
%6 = fadd double %5, %1
%7 = fpext float %2 to double
%8 = fadd double %6, %7
%9 = fpext float %3 to double
%10 = fadd double %8, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ CMT1_delay_10us(int);
int /*<<< orphan*/ CMT1_delay_ms(int);
int /*<<< orphan*/ LCD_AQM_contrast_and_power(int);
int /*<<< orphan*/ LCD_AQM_wrcmd(int);
void LCD_AQM_init(void) {
  LCD_AQM_contrast_and_power(0);
  LCD_AQM_wrcmd(0x01);
  CMT1_delay_ms(2);
  LCD_AQM_wrcmd(0x02);
  CMT1_delay_ms(2);
  LCD_AQM_wrcmd(0x0C);
  CMT1_delay_10us(3);
  LCD_AQM_contrast_and_power(32);
}


x86 assembly (clang, -O0):
<LCD_AQM_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_AQM_contrast_and_power@plt>
mov    $0x1,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x2,%edi
call   1060 <CMT1_delay_ms@plt>
mov    $0x2,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x2,%edi
call   1060 <CMT1_delay_ms@plt>
mov    $0xc,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1050 <CMT1_delay_10us@plt>
mov    $0x20,%edi
call   1030 <LCD_AQM_contrast_and_power@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_AQM_init>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_AQM_contrast_and_power@plt>
mov    $0x1,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x2,%edi
call   1060 <CMT1_delay_ms@plt>
mov    $0x2,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x2,%edi
call   1060 <CMT1_delay_ms@plt>
mov    $0xc,%edi
call   1040 <LCD_AQM_wrcmd@plt>
mov    $0x3,%edi
call   1050 <CMT1_delay_10us@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <LCD_AQM_contrast_and_power@plt>

LLVM IR (-O0):
define void @LCD_AQM_init() {
%1 = call i32 @LCD_AQM_contrast_and_power(i32 0)
%2 = call i32 @LCD_AQM_wrcmd(i32 1)
%3 = call i32 @CMT1_delay_ms(i32 2)
%4 = call i32 @LCD_AQM_wrcmd(i32 2)
%5 = call i32 @CMT1_delay_ms(i32 2)
%6 = call i32 @LCD_AQM_wrcmd(i32 12)
%7 = call i32 @CMT1_delay_10us(i32 3)
%8 = call i32 @LCD_AQM_contrast_and_power(i32 32)
ret void
}

LLVM IR (-O2):
define void @LCD_AQM_init() {
%1 = tail call i32 @LCD_AQM_contrast_and_power(i32 0)
%2 = tail call i32 @LCD_AQM_wrcmd(i32 1)
%3 = tail call i32 @CMT1_delay_ms(i32 2)
%4 = tail call i32 @LCD_AQM_wrcmd(i32 2)
%5 = tail call i32 @CMT1_delay_ms(i32 2)
%6 = tail call i32 @LCD_AQM_wrcmd(i32 12)
%7 = tail call i32 @CMT1_delay_10us(i32 3)
%8 = tail call i32 @LCD_AQM_contrast_and_power(i32 32)
ret void
}
/* Variables and functions */
scalar_t__ job_pool_jobs_count();
int job_canexit(void) { return (job_pool_jobs_count() > 0) ? 0 : 1; }


x86 assembly (clang, -O0):
<job_canexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <job_pool_jobs_count@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<job_canexit>:
push   %rax
xor    %eax,%eax
call   1030 <job_pool_jobs_count@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @job_canexit() {
%1 = call i64 (...) @job_pool_jobs_count()
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @job_canexit() {
%1 = tail call i64 (...) @job_pool_jobs_count()
%2 = icmp slt i64 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ abort();
int test(int);
int main() {
  int x = INT_MAX;
  if (test(x) != x)
    abort();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1040 <test@plt>
cmp    %ebx,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @test(i32 %1)
%3 = icmp eq i32 %2, %1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}
unsigned long buf_get_uint32_be(const void *buf, unsigned long addr) {
  const unsigned char *tmp = (const unsigned char *)buf + addr;
  unsigned long ret;
  ret = tmp[0];
  ret = (ret << 8) | tmp[1];
  ret = (ret << 8) | tmp[2];
  ret = (ret << 8) | tmp[3];
  return (ret);
}


x86 assembly (clang, -O0):
<buf_get_uint32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
mov    -0x18(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_get_uint32_be>:
mov    (%rdi,%rsi,1),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @buf_get_uint32_be(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
store i64 %13, i64* %6
%14 = load i64, i64* %6
%15 = shl i64 %14, 8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = or i64 %15, %19
store i64 %20, i64* %6
%21 = load i64, i64* %6
%22 = shl i64 %21, 8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i64
%27 = or i64 %22, %26
store i64 %27, i64* %6
%28 = load i64, i64* %6
%29 = shl i64 %28, 8
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i64 3
%32 = load i8, i8* %31
%33 = zext i8 %32 to i64
%34 = or i64 %29, %33
store i64 %34, i64* %6
%35 = load i64, i64* %6
ret i64 %35
}

LLVM IR (-O2):
define i64 @buf_get_uint32_be(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl nuw nsw i64 %5, 16
%10 = shl nuw nsw i64 %8, 8
%11 = or i64 %10, %9
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
%15 = or i64 %11, %14
%16 = shl nuw nsw i64 %15, 8
%17 = getelementptr inbounds i8, i8* %3, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = or i64 %16, %19
ret i64 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t gap_event_advertising_report_get_address_type(const uint8_t *event) {
  return event[3];
}


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

x86 assembly (clang, -O2):
<gap_event_advertising_report_get_address_type>:
mov    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @gap_event_advertising_report_get_address_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @gap_event_advertising_report_get_address_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
unsigned long PSEgetLibVersion(void) { return 1 << 16; }


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

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

LLVM IR (-O0):
define i64 @PSEgetLibVersion() {
ret i64 65536
}

LLVM IR (-O2):
define i64 @PSEgetLibVersion() {
ret i64 65536
}
/* Type definitions */
struct sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_handler;
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int sigaction(int, struct sigaction *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigignore(int sig) {
  struct sigaction sa;
  sigemptyset(&sa.sa_mask);
  sa.sa_handler = SIG_IGN;
  sa.sa_flags = 0;
  return sigaction(sig, &sa, 0);
}


x86 assembly (clang, -O0):
<sigignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
add    $0xc,%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigignore>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
define i32 @sigignore(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sigaction
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 2
%5 = call i32 @sigemptyset(i32* %4)
%6 = load i32, i32* @SIG_IGN
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 0
store i64 0, i64* %8
%9 = load i32, i32* %2
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %3, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
define i32 @sigignore(i32 %0) {
%2 = alloca %struct.sigaction
%3 = bitcast %struct.sigaction* %2 to i8*
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 2
%5 = call i32 @sigemptyset(i32* %4)
%6 = load i32, i32* @SIG_IGN
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 0
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %2, i32 0)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gdp_files_close(int /*<<< orphan*/ *);
double gdp_files_getfloat(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *gdp_files_open(char *);
double gdp_files_quick_getfloat(char *FileName, char *cParameter) {
  FILE *fAux = gdp_files_open(FileName);
  double ret = gdp_files_getfloat(fAux, cParameter);
  gdp_files_close(fAux);
  return ret;
}


x86 assembly (clang, -O0):
<gdp_files_quick_getfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gdp_files_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <gdp_files_getfloat@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <gdp_files_close@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_quick_getfloat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <gdp_files_open@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <gdp_files_getfloat@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <gdp_files_close@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @gdp_files_quick_getfloat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @gdp_files_open(i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i8*, i8** %4
%11 = call double @gdp_files_getfloat(i32* %9, i8* %10)
store double %11, double* %6
%12 = load i32*, i32** %5
%13 = call i32 @gdp_files_close(i32* %12)
%14 = load double, double* %6
ret double %14
}

LLVM IR (-O2):
define double @gdp_files_quick_getfloat(i8* %0, i8* %1) {
%3 = tail call i32* @gdp_files_open(i8* %0)
%4 = tail call double @gdp_files_getfloat(i32* %3, i8* %1)
%5 = tail call i32 @gdp_files_close(i32* %3)
ret double %4
}
unsigned int hash(char *str) {
  register unsigned int h;
  register unsigned char *p;
  for (h = 0, p = (unsigned char *)str; *p; p++)
    h = 31 * h + *p;
  return h;
}


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

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = mul i32 %7, 31
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int function_B(int m, int n) {
  int result = (1 << n) - 1;
  result = result << m;
  return result;
}


x86 assembly (clang, -O0):
<function_B>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_B>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %edi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @function_B(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = shl i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @function_B(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = shl i32 %4, %0
ret i32 %5
}
void fn000060AC() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn000060AC() {
ret void
}
/* Variables and functions */
int f241(int *);
int f242(int *p) { return f241(p); }


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

x86 assembly (clang, -O2):
<f242>:
jmp    1030 <f241@plt>

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

LLVM IR (-O2):
define i32 @f242(i32* %0) {
%2 = tail call i32 @f241(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int is_keypad(int /*<<< orphan*/ const *);
bool ncurses_is_keypad(const WINDOW *win) { return is_keypad(win); }


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

x86 assembly (clang, -O2):
<ncurses_is_keypad>:
jmp    1030 <is_keypad@plt>

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

LLVM IR (-O2):
define i32 @ncurses_is_keypad(i32* %0) {
%2 = tail call i32 @is_keypad(i32* %0)
ret i32 %2
}
int GetSystemSettingString(const char *path, char *value, char *defaultv) {
  return -1;
}


x86 assembly (clang, -O0):
<GetSystemSettingString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GetSystemSettingString(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Type definitions */
typedef int int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t fix_utils_numdigits(int64_t val) {
  int32_t cnt = 0;
  do {
    ++cnt;
    val /= 10;
  } while (val);
  return cnt;
}


x86 assembly (clang, -O0):
<fix_utils_numdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110f <fix_utils_numdigits+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_utils_numdigits>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <fix_utils_numdigits+0x10>
ret

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

LLVM IR (-O2):
define i64 @fix_utils_numdigits(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i64 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i64 %4, 1
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i64 %5
}
int *rcycle(int *block, int n) {
  int i;
  for (i = 0; i < 64; i++) {
    if ((i - 1) % n == 0) {
      block[i] = block[i] << 3;
    }
  }
  return block;
}


x86 assembly (clang, -O0):
<rcycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    115b <rcycle+0x5b>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <rcycle+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
shl    $0x3,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    114d <rcycle+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <rcycle+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcycle>:
xor    %ecx,%ecx
jmp    111a <rcycle+0x1a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x2,%rcx
cmp    $0x40,%rcx
je     1138 <rcycle+0x38>
lea    -0x1(%rcx),%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1128 <rcycle+0x28>
shll   $0x3,(%rdi,%rcx,4)
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <rcycle+0x10>
shll   $0x3,0x4(%rdi,%rcx,4)
jmp    1110 <rcycle+0x10>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @rcycle(i32* returned %0, i32 %1) {
br label %3
3: ; preds = %23, %2
%4 = phi i64 [ 0, %2 ], [ %24, %23 ]
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1
%7 = srem i32 %6, %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i32, i32* %0, i64 %4
%11 = load i32, i32* %10
%12 = shl i32 %11, 3
store i32 %12, i32* %10
br label %13
13: ; preds = %3, %9
%14 = or i64 %4, 1
%15 = trunc i64 %14 to i32
%16 = add nsw i32 %15, -1
%17 = srem i32 %16, %1
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = getelementptr inbounds i32, i32* %0, i64 %14
%21 = load i32, i32* %20
%22 = shl i32 %21, 3
store i32 %22, i32* %20
br label %23
23: ; preds = %19, %13
%24 = add nuw nsw i64 %4, 2
%25 = icmp eq i64 %24, 64
br i1 %25, label %26, label %3
26: ; preds = %23
ret i32* %0
}
const int dwordload(const unsigned char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


x86 assembly (clang, -O0):
<dwordload>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwordload>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @dwordload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @dwordload(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
int compare_float(const void *a, const void *b) {
  if (*(float *)a > *(float *)b)
    return -1;
  else if (*(float *)a < *(float *)b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <compare_float+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <compare_float+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <compare_float+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <compare_float+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
ucomiss %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("This is a test progam that pulls in all of the Sandford libraries to "
       "ensure they all compile successfully, it does not do anything.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [132 x i8] c"This is a test progam that pulls in all of the Sandford libraries to ensure they all compile successfully, it does not do anything.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [132 x i8] c"This is a test progam that pulls in all of the Sandford libraries to ensure they all compile successfully, it does not do anything.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int delimit(int val, int min, int max) {
  if (val > max)
    return max;
  if (val < min)
    return min;
  return val;
}


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

x86 assembly (clang, -O2):
<delimit>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmp    %edx,%edi
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @delimit(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_api_once() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_api_once"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_mainloop_api_once\00"
define i32 @pa_mainloop_api_once() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_cancel() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_cancel>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_cancel>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_cancel() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_cancel() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int ft_substract(int a, int b) { return (a - b); }


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

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

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

LLVM IR (-O2):
define i32 @ft_substract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int main(void) {
  int i = 0;
  int *p;
  while (i < 10) {
    int x = 2;
    i++;
    p = &x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1139 <main+0x39>
movl   $0x2,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int japi_getinwidth(int);
int j_getinwidth(int arg0) { return (japi_getinwidth(arg0)); }


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

x86 assembly (clang, -O2):
<j_getinwidth>:
jmp    1030 <japi_getinwidth@plt>

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

LLVM IR (-O2):
define i32 @j_getinwidth(i32 %0) {
%2 = tail call i32 @japi_getinwidth(i32 %0)
ret i32 %2
}
int priv_set_remove_linkdir(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @priv_set_remove_linkdir() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @priv_set_remove_linkdir() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p() { printf("a"); }


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

x86 assembly (clang, -O2):
<p>:
mov    $0x61,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @p() {
%1 = tail call i32 @putchar(i32 97)
ret void
}