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

/* Variables and functions */
long atol(char *);
scalar_t__ cg_read(char const *, char const *, char *, int);
long cg_read_long(const char *cgroup, const char *control) {
  char buf[128];
  if (cg_read(cgroup, control, buf, sizeof(buf)))
    return -1;
  return atol(buf);
}


x86 assembly (clang, -O0):
<cg_read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    $0x80,%ecx
call   1030 <cg_read@plt>
cmp    $0x0,%rax
je     1163 <cg_read_long+0x43>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1173 <cg_read_long+0x53>
lea    -0xa0(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cg_read_long>:
sub    $0x88,%rsp
mov    %rsp,%rdx
mov    $0x80,%ecx
call   1030 <cg_read@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
je     114b <cg_read_long+0x2b>
add    $0x88,%rsp
ret
mov    %rsp,%rdi
call   1040 <atol@plt>
add    $0x88,%rsp
ret

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

LLVM IR (-O2):
define i64 @cg_read_long(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i64 @cg_read(i8* %0, i8* %1, i8* %4, i32 128)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i64 @atol(i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i64 [ %8, %7 ], [ -1, %2 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *opendir(char const *);
DIR *zfs_opendir(const char *dirname) { return opendir(dirname); }


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

x86 assembly (clang, -O2):
<zfs_opendir>:
jmp    1030 <opendir@plt>

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

LLVM IR (-O2):
define noalias i32* @zfs_opendir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
ret i32* %2
}
int addr_space(int __attribute__((address_space(256))) * a) { return *a; }


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

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

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

LLVM IR (-O2):
define i32 @addr_space(i32 addrspace(256)* nocapture %0) {
%2 = load i32, i32 addrspace(256)* %0
ret i32 %2
}
void rt_clear(struct rt *rt) {}


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

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

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

LLVM IR (-O2):
%struct.rt = type opaque
define void @rt_clear(%struct.rt* nocapture %0) {
ret void
}
int __attribute__((nomips16)) f2(unsigned long long y) {
  return (short)((short)(y >> 32) + 1);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
cwtl
add    $0x1,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
shr    $0x10,%rdi
lea    0x10000(%rdi),%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @f2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i16
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i16
%9 = sext i16 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f2(i64 %0) {
%2 = lshr i64 %0, 16
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 65536
%5 = ashr i32 %4, 16
ret i32 %5
}
double bsvm2_fabs(double x) { return ((x > 0) ? x : (-x)); }


x86 assembly (clang, -O0):
<bsvm2_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <bsvm2_fabs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <bsvm2_fabs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsvm2_fabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @bsvm2_fabs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x5b() {
  Assert_real((isalnum(91) == 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_isalnum.c",
              460, ("isalnum should be 0 for ["));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1cc,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for [\00"
define void @t_isalnum_0x5b() {
%1 = call i64 @isalnum(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for [\00"
define void @t_isalnum_0x5b() {
%1 = tail call i64 @isalnum(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void sleep_us(unsigned int nusecs) {
  struct timeval tval;
  tval.tv_sec = nusecs / 1000000;
  tval.tv_usec = nusecs % 1000000;
  select(0, NULL, NULL, NULL, &tval);
}


x86 assembly (clang, -O0):
<sleep_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_us>:
push   %rax
mov    %edi,%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
mov    %eax,(%rsp)
imul   $0xf4240,%eax,%eax
sub    %eax,%edi
mov    %edi,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @sleep_us(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @sleep_us(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = udiv i32 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
int octave_o_sync_wrapper(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @octave_o_sync_wrapper() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ strcmp(char const *, char const *);
bool strEq(const char *a, const char *b) {
  assert(a != NULL && b != NULL);
  return (strcmp(a, b) == 0);
}


x86 assembly (clang, -O0):
<strEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <strEq+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strEq>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strEq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strEq(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i64 @strcmp(i8* %0, i8* %1)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t clamp32(int32_t x, int32_t minval, int32_t maxval) {
  if (x < minval)
    return minval;
  if (x > maxval)
    return maxval;
  return x;
}


x86 assembly (clang, -O0):
<clamp32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <clamp32+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp32+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <clamp32+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp32+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp32>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamp32(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
char last_major(const char *str, int cur_o) {
  for (; cur_o; cur_o--) {
    if (str[cur_o - 1] >= 'A' && str[cur_o - 1] <= 'Z')
      return str[cur_o - 1];
  }
  return 0;
}


x86 assembly (clang, -O0):
<last_major>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1174 <last_major+0x74>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     1161 <last_major+0x61>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jg     1161 <last_major+0x61>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    1178 <last_major+0x78>
jmp    1166 <last_major+0x66>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110b <last_major+0xb>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_major>:
movslq %esi,%rdx
mov    %rdx,%rcx
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%rcx
jb     1128 <last_major+0x28>
movzbl -0x1(%rdi,%rdx,1),%eax
lea    -0x41(%rax),%esi
mov    %rcx,%rdx
cmp    $0x19,%sil
ja     1110 <last_major+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @last_major(i8* %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %35, %2
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %38
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %34
18: ; preds = %9
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 90
br i1 %26, label %27, label %34
27: ; preds = %18
%28 = load i8*, i8** %4
%29 = load i32, i32* %5
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
%33 = load i8, i8* %32
store i8 %33, i8* %3
br label %39
34: ; preds = %18, %9
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, -1
store i32 %37, i32* %5
br label %6
38: ; preds = %6
store i8 0, i8* %3
br label %39
39: ; preds = %38, %27
%40 = load i8, i8* %3
ret i8 %40
}

LLVM IR (-O2):
define signext i8 @last_major(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ %8, %7 ], [ %3, %2 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = add nsw i64 %5, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = add i8 %10, -65
%12 = icmp ult i8 %11, 26
br i1 %12, label %13, label %4
13: ; preds = %4, %7
%14 = phi i8 [ %10, %7 ], [ 0, %4 ]
ret i8 %14
}
/* Variables and functions */
int indw(int);
int /*<<< orphan*/ outdw(int, int);
void reboot_keyboard_ctl() {
  int temp;
  do {
    temp = indw(0x64);
    if (temp & 1)
      indw(0x60);
  } while (temp & 2);
  outdw(0x64, 0xFE);
}


x86 assembly (clang, -O0):
<reboot_keyboard_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <indw@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114e <reboot_keyboard_ctl+0x2e>
mov    $0x60,%edi
call   1040 <indw@plt>
jmp    1153 <reboot_keyboard_ctl+0x33>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1128 <reboot_keyboard_ctl+0x8>
mov    $0x64,%edi
mov    $0xfe,%esi
call   1030 <outdw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot_keyboard_ctl>:
push   %rbx
jmp    1135 <reboot_keyboard_ctl+0x15>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x2,%bl
je     1152 <reboot_keyboard_ctl+0x32>
mov    $0x64,%edi
call   1040 <indw@plt>
mov    %eax,%ebx
test   $0x1,%bl
je     1130 <reboot_keyboard_ctl+0x10>
mov    $0x60,%edi
call   1040 <indw@plt>
jmp    1130 <reboot_keyboard_ctl+0x10>
mov    $0x64,%edi
mov    $0xfe,%esi
pop    %rbx
jmp    1030 <outdw@plt>

LLVM IR (-O0):
define void @reboot_keyboard_ctl() {
%1 = alloca i32
br label %2
2: ; preds = %10, %0
%3 = call i32 @indw(i32 100)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @indw(i32 96)
br label %9
9: ; preds = %7, %2
br label %10
10: ; preds = %9
%11 = load i32, i32* %1
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %2, label %14
14: ; preds = %10
%15 = call i32 @outdw(i32 100, i32 254)
ret void
}

LLVM IR (-O2):
define void @reboot_keyboard_ctl() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 @indw(i32 100)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @indw(i32 96)
br label %7
7: ; preds = %1, %5
%8 = and i32 %2, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @outdw(i32 100, i32 254)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_print(char *);
void log_abort(void) {
  log_print("Aborting");
  abort();
}


x86 assembly (clang, -O0):
<log_abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <log_print@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<log_abort>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <log_print@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Aborting\00"
define void @log_abort() {
%1 = call i32 @log_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"Aborting\00"
define void @log_abort() {
%1 = tail call i32 @log_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ InitialiseLCD();
int /*<<< orphan*/ YRDKRX62N_RSPI_Init(int /*<<< orphan*/);
int /*<<< orphan*/ initFlashMenu();
void main(void) {
  YRDKRX62N_RSPI_Init(0);
  InitialiseLCD();
  initFlashMenu();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <YRDKRX62N_RSPI_Init@plt>
mov    $0x0,%al
call   1030 <InitialiseLCD@plt>
mov    $0x0,%al
call   1050 <initFlashMenu@plt>
jmp    1149 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <YRDKRX62N_RSPI_Init@plt>
xor    %eax,%eax
call   1030 <InitialiseLCD@plt>
xor    %eax,%eax
call   1050 <initFlashMenu@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <main+0x20>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @YRDKRX62N_RSPI_Init(i32 0)
%2 = call i32 (...) @InitialiseLCD()
%3 = call i32 (...) @initFlashMenu()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @YRDKRX62N_RSPI_Init(i32 0)
%2 = tail call i32 (...) @InitialiseLCD()
%3 = tail call i32 (...) @initFlashMenu()
br label %4
4: ; preds = %0, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_i2c_read_register_rs(char *, char *, int);
int /*<<< orphan*/ bcm2835_i2c_setSlaveAddress(int);
char *malloc(int);
char MAG3110_READ_REGISTER(char reg) {
  char *ch = malloc(1);
  bcm2835_i2c_setSlaveAddress(14);
  bcm2835_i2c_read_register_rs(&reg, ch, 1);
  return ch[0];
}


x86 assembly (clang, -O0):
<MAG3110_READ_REGISTER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xe,%edi
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
mov    -0x10(%rbp),%rsi
lea    -0x1(%rbp),%rdi
mov    $0x1,%edx
call   1050 <bcm2835_i2c_read_register_rs@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAG3110_READ_REGISTER>:
push   %rbx
sub    $0x10,%rsp
mov    %dil,0xf(%rsp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xe,%edi
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
lea    0xf(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <bcm2835_i2c_read_register_rs@plt>
mov    (%rbx),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @MAG3110_READ_REGISTER(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %3
%5 = call i32 @bcm2835_i2c_setSlaveAddress(i32 14)
%6 = load i8*, i8** %3
%7 = call i32 @bcm2835_i2c_read_register_rs(i8* %2, i8* %6, i32 1)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @MAG3110_READ_REGISTER(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%4 = tail call i32 @bcm2835_i2c_setSlaveAddress(i32 14)
%5 = call i32 @bcm2835_i2c_read_register_rs(i8* %2, i8* %3, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}
double fun_3D_Rosenbrock(double x, double y, double unused) {
  return (1 - x) * (1 - x) + 100.0 * (y - x * x) * (y - x * x);
}


x86 assembly (clang, -O0):
<fun_3D_Rosenbrock>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xeed(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
movsd  0xe9d(%rip),%xmm1
mulsd  %xmm3,%xmm1
movsd  -0x10(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm5
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_3D_Rosenbrock>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fun_3D_Rosenbrock(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %4
%10 = fsub double 1.000000e+00, %9
%11 = load double, double* %5
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fneg double %12
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double %11)
%16 = fmul double 1.000000e+02, %15
%17 = load double, double* %5
%18 = load double, double* %4
%19 = load double, double* %4
%20 = fneg double %18
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double %17)
%22 = fmul double %16, %21
%23 = call double @llvm.fmuladd.f64(double %8, double %10, double %22)
ret double %23
}

LLVM IR (-O2):
define double @fun_3D_Rosenbrock(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %0
%5 = fneg double %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %1)
%7 = fmul double %6, 1.000000e+02
%8 = fmul double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %8)
ret double %9
}
void g_signal_name() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_name() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ L;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  bool L;
  if (sizeof(L) != 1) {
    fprintf(stderr, "expected boolean to be 8 bits per element");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"expected boolean to be 8 bits per element\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"expected boolean to be 8 bits per element\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int test_imm_33uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x33 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_33uint64_highword_reg>:
movabs $0x3300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 51
%6 = icmp ne i64 %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_33uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 219043332096
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void moveBackOld(long *old, long size) {
  long i;
  for (i = size; i > 0; i--)
    old[i] = old[i - 1];
}


x86 assembly (clang, -O0):
<moveBackOld>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    114c <moveBackOld+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <moveBackOld+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveBackOld>:
mov    %rsi,%rdx
test   %rsi,%rsi
jle    112d <moveBackOld+0x1d>
push   %rax
mov    %rdi,%rsi
add    $0x8,%rdi
shl    $0x3,%rdx
call   1030 <memmove@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @moveBackOld(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = getelementptr i64, i64* %0, i64 1
%7 = bitcast i64* %6 to i8*
%8 = shl nuw i64 %1, 3
br label %9
9: ; preds = %4, %2
ret void
}
int convert(int num) {
  int conv_num;
  int count;
  count = 4;
  conv_num = 0;
  while (count-- > 0) {
    conv_num = (conv_num << 8) | (num & 0xff);
    num >>= 8;
  }
  return conv_num;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    114b <convert+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1115 <convert+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @convert(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int getyear(int date) { return date / 10000; }


x86 assembly (clang, -O0):
<getyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getyear>:
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getyear(i32 %0) {
%2 = sdiv i32 %0, 10000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("say Hello World Younseo");
  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 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"say Hello World Younseo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"say Hello World Younseo\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1(char *);
int main(int argc, char *argv[]) {
  char string[] = "123qweasd";
  char *c_p = string;
  f1(c_p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <f1@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x7361657771333231,%rax
65 61 73
mov    %rax,0x8(%rsp)
movw   $0x64,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <f1@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.string = [10 x i8] c"123qweasd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @f1(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [10 x i8] c"123qweasd\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @f1(i8* %4)
ret i32 0
}
float celsius2fahrenheit(float celsius) { return celsius * (9.0f / 5.0f) + 32; }


x86 assembly (clang, -O0):
<celsius2fahrenheit>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius2fahrenheit>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @celsius2fahrenheit(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %4
}

LLVM IR (-O2):
define float @celsius2fahrenheit(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %2
}
float floor2(int x) { return ((int)x) - (x < 0); }


x86 assembly (clang, -O0):
<floor2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor2>:
mov    %edi,%eax
sar    $0x1f,%eax
add    %edi,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @floor2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = sub nsw i32 %3, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @floor2(i32 %0) {
%2 = ashr i32 %0, 31
%3 = add i32 %2, %0
%4 = sitofp i32 %3 to float
ret float %4
}
int length_length(int len) {
  if (len <= 127)
    return 1;
  else {
    int size = 1;
    while (len > 255) {
      len >>= 8;
      size += 1;
    }
    return size + 1;
  }
}


x86 assembly (clang, -O0):
<length_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     111d <length_length+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1151 <length_length+0x51>
movl   $0x1,-0xc(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1148 <length_length+0x48>
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <length_length+0x24>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_length>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1140 <length_length+0x40>
mov    $0x2,%eax
cmp    $0x100,%edi
jb     1140 <length_length+0x40>
mov    $0x2,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    $0x8,%ecx
add    $0x1,%eax
cmp    $0xffff,%edi
mov    %ecx,%edi
ja     1130 <length_length+0x30>
ret

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

LLVM IR (-O2):
define i32 @length_length(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 255
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 2, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = lshr i32 %7, 8
%9 = add nuw nsw i32 %6, 1
%10 = icmp ugt i32 %7, 65535
br i1 %10, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %9, %5 ]
ret i32 %12
}
__attribute__((no, noclone)) unsigned __int128 t163_4sub(unsigned __int128 x) {
  unsigned __int128 y = (-1);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t163_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
sub    %rsi,%rdx
sbb    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t163_4sub+0x5e>
jmp    1175 <t163_4sub+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t163_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
sub    $0xffffffffffffffff,%rbx
sbb    $0xffffffffffffffff,%r14
jae    112b <t163_4sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t163_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t163_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
extern long long unsigned unsigned_long_divide(long long unsigned a,
                                               long long unsigned b) {
  if (!b)
    return a;
  return a / b;
}


x86 assembly (clang, -O0):
<unsigned_long_divide>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <unsigned_long_divide+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <unsigned_long_divide+0x34>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_long_divide>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1119 <unsigned_long_divide+0x19>
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <unsigned_long_divide+0x1a>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i64 @unsigned_long_divide(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = udiv i64 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %0, %2 ]
ret i64 %7
}
/* Variables and functions */
unsigned int sleep(unsigned int);
unsigned int std_sleep(unsigned int seconds) { return sleep(seconds); }


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

x86 assembly (clang, -O2):
<std_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define i32 @std_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GPSExtendedStatusHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GPSExtendedStatusLogging() { UAVObjLogging(GPSExtendedStatusHandle()); }


x86 assembly (clang, -O0):
<GPSExtendedStatusLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GPSExtendedStatusHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSExtendedStatusLogging>:
push   %rax
xor    %eax,%eax
call   1040 <GPSExtendedStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @GPSExtendedStatusLogging() {
%1 = call i32 (...) @GPSExtendedStatusHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSExtendedStatusLogging() {
%1 = tail call i32 (...) @GPSExtendedStatusHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ fork();
void stub1();
int /*<<< orphan*/ wait(int *);
int dotest(void (*func)(void)) {
  int test_result;
  if (fork() == 0)
    (*func)();
  else
    wait(&test_result);
  return (test_result);
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    1145 <dotest+0x25>
call   *-0x8(%rbp)
jmp    114e <dotest+0x2e>
lea    -0xc(%rbp),%rdi
call   1030 <wait@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1144 <dotest+0x24>
lea    0xc(%rsp),%rdi
call   1030 <wait@plt>
mov    0xc(%rsp),%eax
jmp    1146 <dotest+0x26>
call   *%rbx
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dotest(void ()* %0) {
%2 = alloca void ()*
%3 = alloca i32
store void ()* %0, void ()** %2
%4 = call i64 (...) @fork()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load void ()*, void ()** %2
br label %10
8: ; preds = %1
%9 = call i32 @wait(i32* %3)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @dotest(void ()* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i64 (...) @fork()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
tail call void %0()
br label %10
7: ; preds = %1
%8 = call i32 @wait(i32* %2)
%9 = load i32, i32* %2
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ %9, %7 ], [ undef, %6 ]
ret i32 %11
}
void EVP_MD_CTX_test_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_MD_CTX_test_flags() {
ret void
}
void test_no_clause() {
  int i;
#pragma omp taskloop
  for (i = 0; i < 16; ++i)
    ;
#pragma omp taskloop
  ++i;
}


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

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

LLVM IR (-O0):
define void @test_no_clause() {
%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, 16
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
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
ret void
}

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


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

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

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

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