xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ add(int *, int *);
int /*<<< orphan*/ inc(int *);
void a(int *x, int *y) {
  add(x, y);
  inc(y);
}


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

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %rsi,%rbx
call   1030 <add@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <inc@plt>

LLVM IR (-O0):
define void @a(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 = call i32 @add(i32* %5, i32* %6)
%8 = load i32*, i32** %4
%9 = call i32 @inc(i32* %8)
ret void
}

LLVM IR (-O2):
define void @a(i32* %0, i32* %1) {
%3 = tail call i32 @add(i32* %0, i32* %1)
%4 = tail call i32 @inc(i32* %1)
ret void
}
void hieth_funsel_config(void) {}


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

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

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

LLVM IR (-O2):
define void @hieth_funsel_config() {
ret void
}
unsigned short fnMaskBit(unsigned short uVal, unsigned short uPos) {
  unsigned short uMask = 1;
  uMask = uMask << (uPos - 1);
  uMask = ~uMask;
  uVal = uVal & uMask;
  return uVal;
}


x86 assembly (clang, -O0):
<fnMaskBit>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
xor    $0xffffffff,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x6(%rbp),%ecx
and    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnMaskBit>:
mov    %edi,%eax
add    $0xff,%sil
btr    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @fnMaskBit(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
store i16 1, i16* %5
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %9, 1
%11 = shl i32 %7, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %5
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = xor i32 %14, -1
%16 = trunc i32 %15 to i16
store i16 %16, i16* %5
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = load i16, i16* %5
%20 = zext i16 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @fnMaskBit(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = add nsw i32 %3, -1
%5 = shl nuw i32 1, %4
%6 = trunc i32 %5 to i16
%7 = xor i16 %6, -1
%8 = and i16 %7, %0
ret i16 %8
}
pr(s1) char *s1;
{
  register char *s;
  register char c;
  for (s = s1; c = *s++;)
    putchar(c);
  return (s - s1 - 1);
}


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1150 <pr+0x40>
movsbl -0x11(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1124 <pr+0x14>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x1(%rdi),%rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <pr+0x35>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <pr+0x20>
not    %r14d
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @pr(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %2, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %8)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i8* [ %2, %1 ], [ %10, %5 ]
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = xor i64 %16, -1
%18 = add i64 %15, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}
void put_msm_hw3d_file(struct file *file) {}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @put_msm_hw3d_file(%struct.file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_settype(char *);
void settenex(void) { do_settype("tenex"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"tenex\00"
define void @settenex() {
%1 = tail call i32 @do_settype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int time_t;
struct timespec {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ perror(char *);
time_t time_mono(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
    perror("clock_gettime");
    return -1;
  }
  return ts.tv_sec;
}


x86 assembly (clang, -O0):
<time_mono>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
jge    115c <time_mono+0x3c>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <time_mono+0x42>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_mono>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
js     113c <time_mono+0x1c>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [14 x i8] c"clock_gettime\00"
define i32 @time_mono() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [14 x i8] c"clock_gettime\00"
define i32 @time_mono() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ -1, %6 ], [ %10, %8 ]
ret i32 %12
}
unsigned int align_power2(unsigned int u) {
  unsigned int left_zeros;
  if (u == 1)
    return 1;
  if ((left_zeros = __builtin_clz(u - 1)) < 1)
    return 0;
  return 1 << ((sizeof(u) * 8) - left_zeros);
}


x86 assembly (clang, -O0):
<align_power2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <align_power2+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    115a <align_power2+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x1,%eax
jae    1141 <align_power2+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115a <align_power2+0x5a>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_power2>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     111e <align_power2+0x1e>
add    $0xffffffff,%edi
bsr    %edi,%ecx
xor    $0x1f,%ecx
je     111f <align_power2+0x1f>
neg    %cl
mov    $0x1,%eax
shl    %cl,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @align_power2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 %9, 1
%11 = call i32 @llvm.ctlz.i32(i32 %10, i1 true)
store i32 %11, i32* %4
%12 = icmp ult i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %2
br label %20
14: ; preds = %8
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = sub i64 32, %16
%18 = trunc i64 %17 to i32
%19 = shl i32 1, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %14, %13, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @align_power2(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = sub nuw nsw i32 32, %5
%9 = shl nuw i32 1, %8
br label %10
10: ; preds = %3, %1, %7
%11 = phi i32 [ %9, %7 ], [ 1, %1 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rol(uint8_t x) { return ((x << 1) & 0xFF) ^ ((x >> 7) & 0xFF); }


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
and    $0xff,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
lea    (%rdi,%rdi,1),%eax
shr    $0x7,%edi
xor    %eax,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = ashr i32 %6, 7
%8 = and i32 %7, 255
%9 = xor i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rol(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 254
%4 = lshr i32 %0, 7
%5 = and i32 %4, 255
%6 = xor i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main() {
  int i;
  f(&i);
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @f(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
int returnbool(int a, int b) {
  if (a < b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<returnbool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <returnbool+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <returnbool+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnbool>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @returnbool(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void null_pruning2_Good_FP(int *p) {
  if (p != 0) {
    if (p == 0) {
      int a[5];
      a[10] = 1;
    }
  }
}


x86 assembly (clang, -O0):
<null_pruning2_Good_FP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112a <null_pruning2_Good_FP+0x2a>
cmpq   $0x0,-0x8(%rbp)
jne    1125 <null_pruning2_Good_FP+0x25>
movl   $0x1,0x8(%rbp)
jmp    112a <null_pruning2_Good_FP+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_pruning2_Good_FP(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 10
store i32 1, i32* %10
br label %11
11: ; preds = %9, %6
br label %12
12: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @null_pruning2_Good_FP(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int errno;
int unlink(char const *);
int __sulong_posix_unlink(const char *path) {
  {
    int native_errno = errno;
    int result = unlink(path);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114e <__sulong_posix_unlink+0x3e>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e88(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_unlink>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <unlink@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_unlink(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @unlink(i8* %0)
%4 = icmp eq i32 %3, -1
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 %6, i32 %3
store i32 %2, i32* @errno
ret i32 %7
}
void __attribute__((
    warning("curl_easy_setopt expects a "
            "string (char* or char[]) argument for this option")))
__attribute__((unused)) __attribute__((no)) _curl_easy_setopt_err_string(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_string() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gui_loop(void *);
void *gui_thread(void *g) {
  gui_loop(g);
  exit(0);
}


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

x86 assembly (clang, -O2):
<gui_thread>:
push   %rax
call   1030 <gui_loop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define noalias i8* @gui_thread(i8* %0) {
%2 = tail call i32 @gui_loop(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint16_t LCDIDDDataRead(uint32_t ui32Base, uint32_t ui32CS) {
  uint32_t ui32Reg;
  ASSERT(ui32Base == 0x44050000);
  ASSERT((ui32CS == 0) || (ui32CS == 1));
  ui32Reg = ui32CS ? 0x00000024 : 0x00000018;
  return ((uint16_t)(*((volatile uint32_t *)(ui32Base + ui32Reg))));
}


x86 assembly (clang, -O0):
<LCDIDDDataRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     114b <LCDIDDDataRead+0x3b>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
mov    $0x18,%eax
mov    $0x24,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDDataRead>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setb   %dil
call   1030 <ASSERT@plt>
test   %ebx,%ebx
mov    $0x18,%eax
mov    $0x24,%ecx
cmove  %eax,%ecx
movslq %ebp,%rax
mov    (%rcx,%rax,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @LCDIDDDataRead(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* %3
%7 = icmp eq i32 %6, 1141178368
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ true, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @ASSERT(i32 %17)
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 36, i32 24
store i32 %22, i32* %5
%23 = load i32, i32* %3
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @LCDIDDDataRead(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141178368
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp ult i32 %1, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = icmp eq i32 %1, 0
%10 = select i1 %9, i32 24, i32 36
%11 = add nsw i32 %10, %0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Variables and functions */
float __infer_nondet_float();
float sqrtf(float x) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vseq_get_constrained(const uint8_t *p_mp2vseq) {
  return !!(p_mp2vseq[11] & 0x4);
}


x86 assembly (clang, -O0):
<mp2vseq_get_constrained>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_get_constrained>:
mov    0x2c(%rdi),%eax
shr    $0x2,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @mp2vseq_get_constrained(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 11
%3 = load i32, i32* %2
%4 = lshr i32 %3, 2
%5 = and i32 %4, 1
ret i32 %5
}
void rop3_105_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_105_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_105_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
xor    %sil,%cl
xor    %al,%cl
or     %sil,%dl
or     %dl,%cl
not    %cl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_105_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %2, %1
%6 = xor i8 %5, %4
%7 = or i8 %2, %1
%8 = or i8 %7, %6
%9 = xor i8 %8, -1
%10 = and i8 %4, %7
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
int test_imm_93int8_reg(signed char val) {
  return ((val) & (-0x93 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_93int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff6d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_93int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -147
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void WatchdogStallEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000418))) |= 0x00000100;
}


x86 assembly (clang, -O0):
<WatchdogStallEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x418(%rax),%rcx
or     $0x100,%rcx
mov    %rcx,0x418(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogStallEnable>:
orq    $0x100,0x418(%rdi)
ret

LLVM IR (-O0):
define void @WatchdogStallEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1048
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 256
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @WatchdogStallEnable(i64 %0) {
%2 = add nsw i64 %0, 1048
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 256
store volatile i64 %5, i64* %3
ret void
}
void dwc3_otg_exit(struct dwc3 *dwc) {}


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

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

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

LLVM IR (-O2):
%struct.dwc3 = type opaque
define void @dwc3_otg_exit(%struct.dwc3* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void show_version(void) {
  fprintf(stdout, "CombinatorX, version %s (%s)\n", "1.2",
          "Wed Aug 25 19:42:17 CEST 2021");
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xef3(%rip),%rdx
lea    0xef0(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xef7(%rip),%rdx
lea    0xef4(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"CombinatorX, version %s (%s)\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [30 x i8] c"Wed Aug 25 19:42:17 CEST 2021\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"CombinatorX, version %s (%s)\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [30 x i8] c"Wed Aug 25 19:42:17 CEST 2021\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long CPU_GetMemclk();
unsigned long int get_hclkfreq(void) {
  unsigned long int curr_rate;
  curr_rate = CPU_GetMemclk();
  return curr_rate;
}


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

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

LLVM IR (-O0):
define i64 @get_hclkfreq() {
%1 = alloca i64
%2 = call i64 (...) @CPU_GetMemclk()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_hclkfreq() {
%1 = tail call i64 (...) @CPU_GetMemclk()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
char *getLine(FILE *file, char *line) {
  char *start = line;
  while ((*line = fgetc(file)) && *line != '\n')
    line++;
  *line = '\0';
  return start;
}


x86 assembly (clang, -O0):
<getLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1158 <getLine+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1168 <getLine+0x58>
jmp    1179 <getLine+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <getLine+0x18>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLine>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rbx
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %al,(%rbx)
test   %al,%al
je     1138 <getLine+0x28>
cmp    $0xa,%al
je     1138 <getLine+0x28>
add    $0x1,%rbx
jmp    1120 <getLine+0x10>
movb   $0x0,(%rbx)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @getLine(i32* nocapture %0, i8* returned writeonly %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %1, %2 ], [ %7, %6 ]
%5 = tail call signext i8 @fgetc(i32* %0)
store i8 %5, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 10, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
store i8 0, i8* %4
ret i8* %1
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = abs(0x80000000);
  if (x < 0)
    printf("abs(0x80000000) is negative! (%d)\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x80000000,%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115c <main+0x3c>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"abs(0x80000000) is negative! (%d)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @abs(i32 -2147483648)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"abs(0x80000000) is negative! (%d)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 -2147483648)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_cuda();
int main() {
  if (test_cuda() == 1) {
    printf("test Cuda successed!\n");
    return 0;
  }
  printf("test Cuda failed..\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_cuda@plt>
cmp    $0x1,%eax
jne    1157 <main+0x37>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116a <main+0x4a>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <test_cuda@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
lea    0xedc(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"test Cuda successed!\0A\00"
@.str.1 = [20 x i8] c"test Cuda failed..\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_cuda()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [19 x i8] c"test Cuda failed..\00"
@str.2 = [21 x i8] c"test Cuda successed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_cuda()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = zext i1 %4 to i32
%6 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %5
}
unsigned short ip_compute_csum(unsigned char *buff, int len) {
  return ~do_csum(buff, len);
}


x86 assembly (clang, -O0):
<ip_compute_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <do_csum@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_compute_csum>:
push   %rax
xor    %eax,%eax
call   1030 <do_csum@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, ...)*)(i8* %5, i32 %6)
%8 = xor i32 %7, -1
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = trunc i32 %3 to i16
%5 = xor i16 %4, -1
ret i16 %5
}
/* Variables and functions */
int fabs(double);
int pioneer_send_command1(int, double);
int carmen_base_direct_set_acceleration(double acceleration) {
  acceleration = fabs(acceleration) * 1000;
  return pioneer_send_command1(5, acceleration);
}


x86 assembly (clang, -O0):
<carmen_base_direct_set_acceleration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
imul   $0x3e8,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pioneer_send_command1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_base_direct_set_acceleration>:
push   %rax
call   1040 <fabs@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x5,%edi
pop    %rax
jmp    1030 <pioneer_send_command1@plt>

LLVM IR (-O0):
define i32 @carmen_base_direct_set_acceleration(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = mul nsw i32 %4, 1000
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @pioneer_send_command1(i32 5, double %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @carmen_base_direct_set_acceleration(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = mul nsw i32 %2, 1000
%4 = sitofp i32 %3 to double
%5 = tail call i32 @pioneer_send_command1(i32 5, double %4)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(scalar_t__ *);
uint32_t jboot_timestamp(void) {
  time_t rawtime;
  time(&rawtime);
  return (((uint32_t)rawtime) - 0x35016f00L) >> 2;
}


x86 assembly (clang, -O0):
<jboot_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <time@plt>
mov    -0x8(%rbp),%rax
cltq
sub    $0x35016f00,%rax
sar    $0x2,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jboot_timestamp>:
push   %rax
mov    %rsp,%rdi
call   1030 <time@plt>
movslq (%rsp),%rcx
movabs $0x3cafe9100,%rax
add    %rcx,%rax
shr    $0x2,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jboot_timestamp() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = sext i32 %4 to i64
%6 = sub nsw i64 %5, 889286400
%7 = ashr i64 %6, 2
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @jboot_timestamp() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
%5 = shl i64 %4, 32
%6 = ashr exact i64 %5, 32
%7 = add nsw i64 %6, 16290582784
%8 = lshr i64 %7, 2
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void f(mpz_t res, mpz_t s, mpz_t x, mpz_t n) {
  mpz_mul(res, x, s);
  mpz_mod(res, res, n);
  mpz_add_ui(res, res, 1);
  mpz_mod(res, res, n);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <mpz_mul@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <mpz_mod@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <mpz_mod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%eax
mov    %edi,%ebp
mov    %edx,%esi
mov    %eax,%edx
call   1040 <mpz_mul@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <mpz_mod@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <mpz_add_ui@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_mod@plt>

LLVM IR (-O0):
define void @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @mpz_mul(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i32 @mpz_mod(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = call i32 @mpz_add_ui(i32 %17, i32 %18, i32 1)
%20 = load i32, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %8
%23 = call i32 @mpz_mod(i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mpz_mul(i32 %0, i32 %2, i32 %1)
%6 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %3)
%7 = tail call i32 @mpz_add_ui(i32 %0, i32 %0, i32 1)
%8 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %3)
ret void
}
void se_warningf(fmt, a, b, c) char *fmt, *a, *b, *c;
{
  char buf[256];
  sprintf(buf, fmt, a, b, c);
  se_warning(buf);
}


x86 assembly (clang, -O0):
<se_warningf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1040 <se_warning@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_warningf>:
push   %rbx
sub    $0x100,%rsp
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <se_warning@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @se_warningf(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* %11, i8* %12, i8* %13, i8* %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @se_warning to i32 (i8*, ...)*)(i8* %16)
ret void
}

LLVM IR (-O2):
define void @se_warningf(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @se_warning to i32 (i8*, ...)*)(i8* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int touch(char *filename, char *content) {
  FILE *fp;
  fp = fopen(filename, "w");
  fprintf(fp, "%s", content);
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @touch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @touch(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fputs(i8* %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 0
}
int PivotChoose(int dizi[], int l, int r) { return l; }


x86 assembly (clang, -O0):
<PivotChoose>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PivotChoose(i32* nocapture readnone %0, i32 returned %1, i32 %2) {
ret i32 %1
}