xunge/DecIR huggingface dataset:
void heap_increase_key(int a[], int n, int i, int key) {
  int iparent = (i - 1) / 2;
  while (iparent < n && a[i] > a[iparent]) {
    i = iparent;
    iparent = (i - 1) / 2;
  }
}


x86 assembly (clang, -O0):
<heap_increase_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    114f <heap_increase_key+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115f <heap_increase_key+0x5f>
jmp    117b <heap_increase_key+0x7b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
jmp    1122 <heap_increase_key+0x22>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @heap_increase_key(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = sub nsw i32 %10, 1
%12 = sdiv i32 %11, 2
store i32 %12, i32* %9
br label %13
13: ; preds = %31, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32*, i32** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %5
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = icmp sgt i32 %22, %27
br label %29
29: ; preds = %17, %13
%30 = phi i1 [ false, %13 ], [ %28, %17 ]
br i1 %30, label %31, label %36
31: ; preds = %29
%32 = load i32, i32* %9
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = sub nsw i32 %33, 1
%35 = sdiv i32 %34, 2
store i32 %35, i32* %9
br label %13
36: ; preds = %29
ret void
}

LLVM IR (-O2):
define void @heap_increase_key(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void ff_hevc_put_hevc_pel_pixels16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_is_prime(int);
int ft_find_next_prime(int nb) {
  if (nb <= 1)
    return (2);
  while (!ft_is_prime(nb))
    nb++;
  return (nb);
}


x86 assembly (clang, -O0):
<ft_find_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <ft_find_next_prime+0x21>
movl   $0x2,-0x4(%rbp)
jmp    1167 <ft_find_next_prime+0x57>
jmp    1136 <ft_find_next_prime+0x26>
mov    -0x8(%rbp),%edi
call   1030 <ft_is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1153 <ft_find_next_prime+0x43>
jmp    1161 <ft_find_next_prime+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <ft_find_next_prime+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_find_next_prime>:
mov    $0x2,%eax
cmp    $0x2,%edi
jl     1134 <ft_find_next_prime+0x24>
push   %rbx
mov    %edi,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1030 <ft_is_prime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <ft_find_next_prime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_find_next_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 @ft_is_prime(i32 %4)
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ 2, %1 ], [ %4, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int countDigit(uint64_t number, int wantedDigit) {
  int count = 0;
  while (number) {
    int digit = number % 10;
    number /= 10;
    if (digit == wantedDigit) {
      ++count;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<countDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1151 <countDigit+0x51>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114c <countDigit+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <countDigit+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigit>:
xor    %eax,%eax
test   %edi,%edi
je     1147 <countDigit+0x47>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%r9
imul   $0x66666667,%r9,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%r8d
mov    %r9d,%edx
sub    %r8d,%edx
xor    %ecx,%ecx
cmp    %esi,%edx
sete   %cl
add    %ecx,%eax
add    $0x9,%r9d
cmp    $0x12,%r9d
ja     1110 <countDigit+0x10>
ret

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

LLVM IR (-O2):
define i32 @countDigit(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = srem i32 %5, 10
%8 = sdiv i32 %5, 10
%9 = icmp eq i32 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = add i32 %5, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
comma() { outbyte(','); }


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

x86 assembly (clang, -O2):
<comma>:
mov    $0x2c,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define i32 @comma() {
%1 = alloca i32
%2 = call i32 @outbyte(i8 signext 44)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @comma() {
%1 = tail call i32 @outbyte(i8 signext 44)
ret i32 undef
}
int main(void) {
  printf("__FUNCTION__ = %s\n", __FUNCTION__);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"__FUNCTION__ = %s\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"__FUNCTION__ = %s\0A\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
__u_char cbmarch_pp_read(int f) { return ioctl(f, _IO(0xcb, 10)); }


x86 assembly (clang, -O0):
<cbmarch_pp_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0xa,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_pp_read>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0xa,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_pp_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 10)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbmarch_pp_read(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 10)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char result[1000];
  char str[] = "Hello\t\t C";
  detab(str, result);
  printf(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x3fa(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x3f2(%rbp)
lea    -0x3fa(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1030 <detab@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
movabs $0x2009096f6c6c6548,%rax
09 09 20
mov    %rax,(%rsp)
movw   $0x43,0x8(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <detab@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"Hello\09\09 C\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %3 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @detab(i8* %5, i8* %6)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"Hello\09\09 C\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @detab(i8* %4, i8* %3)
%6 = call i32 @printf(i8* %3)
ret i32 0
}
int isBlocked(void) {
  int retValue_acc;
  {
    retValue_acc = 0;
    return (retValue_acc);
    return (retValue_acc);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @isBlocked() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear(unsigned char);
int /*<<< orphan*/ nxtDisplayString(unsigned char, char *, short);
int /*<<< orphan*/ update(unsigned char);
void printf(short number, unsigned char line) {
  if (line >= 8)
    line = 8 - 1;
  clear(line);
  nxtDisplayString(line, "%d", number);
  update(line);
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x8,%eax
jl     1156 <printf+0x26>
movb   $0x7,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1040 <clear@plt>
mov    -0x3(%rbp),%al
lea    0xe97(%rip),%rsi
movzbl %al,%edi
movswl -0x2(%rbp),%edx
call   1050 <nxtDisplayString@plt>
movzbl -0x3(%rbp),%edi
call   1030 <update@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x7,%sil
mov    $0x7,%ebp
cmovb  %esi,%ebp
mov    %ebp,%edi
call   1040 <clear@plt>
lea    0xeb1(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
call   1050 <nxtDisplayString@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <update@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printf(i16 signext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp sge i32 %6, 8
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 7, i8* %4
br label %9
9: ; preds = %8, %2
%10 = load i8, i8* %4
%11 = call i32 @clear(i8 zeroext %10)
%12 = load i8, i8* %4
%13 = load i16, i16* %3
%14 = call i32 @nxtDisplayString(i8 zeroext %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %13)
%15 = load i8, i8* %4
%16 = call i32 @update(i8 zeroext %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printf(i16 signext %0, i8 zeroext %1) {
%3 = icmp ult i8 %1, 7
%4 = select i1 %3, i8 %1, i8 7
%5 = tail call i32 @clear(i8 zeroext %4)
%6 = tail call i32 @nxtDisplayString(i8 zeroext %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %0)
%7 = tail call i32 @update(i8 zeroext %4)
ret void
}
void foo(char *x) { return; }


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

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

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

LLVM IR (-O2):
define void @foo(i8* nocapture %0) {
ret void
}
int test_imm_D5uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D5uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 213
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RemoteIO_SendMouseMove(int, int);
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove(void *);
void UpnpRemoteIOClient_RemoteInput_InputMouseMove(void *upnptoken, int X,
                                                   int Y) {
  RemoteIO_SendMouseMove(X, Y);
  UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_RemoteInput_InputMouseMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <RemoteIO_SendMouseMove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputMouseMove>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1040 <RemoteIO_SendMouseMove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove@plt>

LLVM IR (-O0):
define void @UpnpRemoteIOClient_RemoteInput_InputMouseMove(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @RemoteIO_SendMouseMove(i32 %7, i32 %8)
%10 = load i8*, i8** %4
%11 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove(i8* %10)
ret void
}

LLVM IR (-O2):
define void @UpnpRemoteIOClient_RemoteInput_InputMouseMove(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @RemoteIO_SendMouseMove(i32 %1, i32 %2)
%5 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseMove(i8* %0)
ret void
}
void f_d(char *a) {}


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

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

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

LLVM IR (-O2):
define void @f_d(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int pid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int getpid();
void log_pid(const char *pidfile) {
  FILE *f;
  pid_t pid;
  pid = getpid();
  if ((f = fopen(pidfile, "w")) == NULL)
    return;
  fprintf(f, "%d\n", pid);
  fclose(f);
}


x86 assembly (clang, -O0):
<log_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1179 <log_pid+0x39>
jmp    1195 <log_pid+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe7b(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_pid>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
test   %rax,%rax
je     1185 <log_pid+0x45>
mov    %rax,%rbx
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @log_pid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 (...) @getpid()
store i32 %5, i32* %4
%6 = load i8*, i8** %2
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %3
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
br label %16
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @log_pid(i8* nocapture %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %1, %5
ret void
}
/* Variables and functions */
int _write_sysfs_string(char const *, char const *, char const *,
                        int /*<<< orphan*/);
int write_sysfs_string(const char *filename, const char *basedir,
                       const char *val) {
  return _write_sysfs_string(filename, basedir, val, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_write_sysfs_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_string>:
xor    %ecx,%ecx
jmp    1030 <_write_sysfs_string@plt>

LLVM IR (-O0):
define i32 @write_sysfs_string(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_write_sysfs_string(i8* %7, i8* %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_sysfs_string(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_write_sysfs_string(i8* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}
__attribute__((used)) void the_used_function() {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @the_used_function to i8*)], section "llvm.metadata"
define void @the_used_function() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @the_used_function to i8*)], section "llvm.metadata"
define void @the_used_function() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ intlen(scalar_t__);
scalar_t__ pow10_g(int /*<<< orphan*/);
uint32_t concat(uint32_t a, uint32_t b) {
  a *= pow10_g(intlen(b));
  return a + b;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <intlen@plt>
mov    %eax,%edi
call   1040 <pow10_g@plt>
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <intlen@plt>
mov    %eax,%edi
call   1040 <pow10_g@plt>
imul   %r14,%rax
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @concat(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @intlen(i64 %5)
%7 = call i64 @pow10_g(i32 %6)
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = add nsw i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @concat(i64 %0, i64 %1) {
%3 = tail call i32 @intlen(i64 %1)
%4 = tail call i64 @pow10_g(i32 %3)
%5 = mul nsw i64 %4, %0
%6 = add nsw i64 %5, %1
ret i64 %6
}
/* Variables and functions */
int inputYesOrNo(char *);
int inputYOrN(int template) {
  char *customMessage;
  switch (template) {
  case 1:
    customMessage = "Do you want to login(Y) or exit(N)?";
    break;
  default:
    customMessage = "Enter 'Y' to continue (Y/N):";
    break;
  }
  return inputYesOrNo(customMessage);
}


x86 assembly (clang, -O0):
<inputYOrN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    113c <inputYOrN+0x2c>
jmp    112c <inputYOrN+0x1c>
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <inputYOrN+0x37>
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inputYesOrNo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputYOrN>:
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
lea    0xf03(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <inputYesOrNo@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Do you want to login(Y) or exit(N)?\00"
@.str.1 = [29 x i8] c"Enter 'Y' to continue (Y/N):\00"
define i32 @inputYOrN(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 1, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8** %3
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %3
%9 = call i32 @inputYesOrNo(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"Do you want to login(Y) or exit(N)?\00"
@.str.1 = [29 x i8] c"Enter 'Y' to continue (Y/N):\00"
define i32 @inputYOrN(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @inputYesOrNo(i8* %3)
ret i32 %4
}
void write_kernels_boundary_kl_adios_(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @timerInit() {
ret void
}
void rop3_158_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D & S;
  stk3 = T | stk4;
  stk2 = S ^ stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_158_0_0>:
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
and    %ecx,%eax
mov    %al,-0xe(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rop3_158_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %4, %1
%8 = xor i8 %7, %6
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *progname, int status) {
  fprintf(stderr, "Usage: %s \n", progname);
  fprintf(stderr, "Not enough arguments given");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s \0A\00"
@.str.1 = [27 x i8] c"Not enough arguments given\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Usage: %s \0A\00"
@.str.1 = [27 x i8] c"Not enough arguments given\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %1)
unreachable
}
void juggle(short loc) {
  loc = loc;
  return;
}


x86 assembly (clang, -O0):
<juggle>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @juggle(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
store i16 %3, i16* %2
ret void
}

LLVM IR (-O2):
define void @juggle(i16 signext %0) {
ret void
}
int is_valid_char(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z') || c == '.';
}


x86 assembly (clang, -O0):
<is_valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_valid_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <is_valid_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_valid_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <is_valid_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1167 <is_valid_char+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1174 <is_valid_char+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_char>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
setb   %cl
cmp    $0x2e,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %30, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %30, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br i1 %25, label %30, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 46
br label %30
30: ; preds = %26, %22, %14, %6
%31 = phi i1 [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_valid_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = icmp eq i8 %0, 46
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float a, b;
  b = 2.0e20 + 1.0;
  a = b - 2.0e20;
  printf("%f \n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4425AF1D80000000, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fsub double %5, 2.000000e+20
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 0x428D29CF00000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void old_fc_dl_sl_load(void *s, FILE *f) {}


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

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

LLVM IR (-O0):
define void @old_fc_dl_sl_load(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
define void @old_fc_dl_sl_load(i8* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *ptr, const char *file, const char *func, int line) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <mem_free+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mem_free(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
int get_bgq_hwthread(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @get_bgq_hwthread() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Content-Type:text/html;\n\n");
  printf("hello CGI~~\n");
  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 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-Type:text/html;\0A\0A\00"
@.str.1 = [13 x i8] c"hello CGI~~\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-Type:text/html;\0A\00"
@str.2 = [12 x i8] c"hello CGI~~\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
double myabs(double x) {
  if (x >= 0) {
    return x;
  } else {
    return -x;
  }
}


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

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

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

LLVM IR (-O2):
define double @myabs(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ f();
int main() {
  if (f())
    return 15;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <f@plt>
test   %rax,%rax
mov    $0xf,%eax
cmove  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 0, i32 15
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f_shrt_1(short const);
int /*<<< orphan*/ sink(int /*<<< orphan*/);
void test_shrt_cst(void) {
  const short min = (-0x7fff - 1);
  const short max = 0x7fff;
  sink(f_shrt_1(min));
  sink(f_shrt_1(-1));
  sink(f_shrt_1(0));
  sink(f_shrt_1(1));
  sink(f_shrt_1(max));
}


x86 assembly (clang, -O0):
<test_shrt_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x8000,-0x2(%rbp)
movw   $0x7fff,-0x4(%rbp)
mov    $0xffff8000,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffff,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
xor    %edi,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x7fff,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shrt_cst>:
push   %rax
mov    $0xffff8000,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffff,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
xor    %edi,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x7fff,%edi
call   1040 <f_shrt_1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @test_shrt_cst() {
%1 = alloca i16
%2 = alloca i16
store i16 -32768, i16* %1
store i16 32767, i16* %2
%3 = call i32 @f_shrt_1(i16 signext -32768)
%4 = call i32 @sink(i32 %3)
%5 = call i32 @f_shrt_1(i16 signext -1)
%6 = call i32 @sink(i32 %5)
%7 = call i32 @f_shrt_1(i16 signext 0)
%8 = call i32 @sink(i32 %7)
%9 = call i32 @f_shrt_1(i16 signext 1)
%10 = call i32 @sink(i32 %9)
%11 = call i32 @f_shrt_1(i16 signext 32767)
%12 = call i32 @sink(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_shrt_cst() {
%1 = tail call i32 @f_shrt_1(i16 signext -32768)
%2 = tail call i32 @sink(i32 %1)
%3 = tail call i32 @f_shrt_1(i16 signext -1)
%4 = tail call i32 @sink(i32 %3)
%5 = tail call i32 @f_shrt_1(i16 signext 0)
%6 = tail call i32 @sink(i32 %5)
%7 = tail call i32 @f_shrt_1(i16 signext 1)
%8 = tail call i32 @sink(i32 %7)
%9 = tail call i32 @f_shrt_1(i16 signext 32767)
%10 = tail call i32 @sink(i32 %9)
ret void
}
void vmem_startup(void) {}


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

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

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

LLVM IR (-O2):
define void @vmem_startup() {
ret void
}
unsigned long pack_one(long nfrequency, long digitized[]) {
  long i;
  unsigned long packed;
  packed = 0;
  for (i = 2; i <= 5; i++) {
    packed += digitized[i];
    if (i < 5)
      packed *= 256;
  }
  return (packed);
}


x86 assembly (clang, -O0):
<pack_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x2,-0x18(%rbp)
cmpq   $0x5,-0x18(%rbp)
jg     1168 <pack_one+0x68>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x5,-0x18(%rbp)
jge    1152 <pack_one+0x52>
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <pack_one+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <pack_one+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_one>:
mov    0x10(%rsi),%rax
shl    $0x8,%rax
add    0x18(%rsi),%rax
shl    $0x8,%rax
add    0x20(%rsi),%rax
shl    $0x8,%rax
add    0x28(%rsi),%rax
ret

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

LLVM IR (-O2):
define i64 @pack_one(i64 %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 2
%4 = load i64, i64* %3
%5 = shl i64 %4, 8
%6 = getelementptr inbounds i64, i64* %1, i64 3
%7 = load i64, i64* %6
%8 = add i64 %7, %5
%9 = shl i64 %8, 8
%10 = getelementptr inbounds i64, i64* %1, i64 4
%11 = load i64, i64* %10
%12 = add i64 %11, %9
%13 = shl i64 %12, 8
%14 = getelementptr inbounds i64, i64* %1, i64 5
%15 = load i64, i64* %14
%16 = add i64 %15, %13
ret i64 %16
}
int test_imm_84uint16_reg(unsigned short val) {
  return ((val) & (-0x84 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_84uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -132
%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_84uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -132
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int get_proc_cpuinfo_data(char *, char *, int /*<<< orphan*/);
int generic_get_cpu_name(char *name) {
  return get_proc_cpuinfo_data("model name", name, 0);
}


x86 assembly (clang, -O0):
<generic_get_cpu_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
xor    %edx,%edx
call   1030 <get_proc_cpuinfo_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_get_cpu_name>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <get_proc_cpuinfo_data@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"model name\00"
define i32 @generic_get_cpu_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_proc_cpuinfo_data(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"model name\00"
define i32 @generic_get_cpu_name(i8* %0) {
%2 = tail call i32 @get_proc_cpuinfo_data(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret i32 %2
}