xunge/DecIR huggingface dataset:
void rop3_38_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O2):
define void @rop3_38_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
cunlink(f) char *f;
{
  if (f == 0)
    return (0);
  return (unlink(f));
}


x86 assembly (clang, -O0):
<cunlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <cunlink+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1141 <cunlink+0x31>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cunlink>:
test   %rdi,%rdi
je     111c <cunlink+0xc>
xor    %eax,%eax
jmp    1030 <unlink@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cunlink(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void memory_barrier(void) { __asm__ __volatile__("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @memory_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int sqrt(int);
int getDistance__linear(int x1, int x2, int y1, int y2) {
  return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}


x86 assembly (clang, -O0):
<getDistance__linear>:
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
sub    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   %eax,%edi
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDistance__linear>:
sub    %esi,%edi
imul   %edi,%edi
sub    %ecx,%edx
imul   %edx,%edx
add    %edx,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @getDistance__linear(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* %6
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = call i32 @sqrt(i32 %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @getDistance__linear(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %1
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %2, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = tail call i32 @sqrt(i32 %9)
ret i32 %10
}
/* Variables and functions */
int extension_match_core(char const *, char const *, int);
int ast_extension_close(const char *pattern, const char *data, int needmore) {
  return extension_match_core(pattern, data, needmore);
}


x86 assembly (clang, -O0):
<ast_extension_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <extension_match_core@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_extension_close>:
jmp    1030 <extension_match_core@plt>

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

LLVM IR (-O2):
define i32 @ast_extension_close(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @extension_match_core(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t size = 0;
  while (str[size] != '\0') {
    ++size;
  }
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int countDigits(unsigned long n) {
  if (n == 0) {
    return (1);
  }
  int count = 0;
  while (n != 0) {
    count++;
    n /= 10;
  }
  return (count);
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <countDigits+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1157 <countDigits+0x57>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <countDigits+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
jmp    1126 <countDigits+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
test   %rdi,%rdi
je     1139 <countDigits+0x39>
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <countDigits+0x20>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @countDigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
char *strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int read_httpget_data(char *buf, char *data, size_t datalen) {
  char *datastr;
  *data = 0;
  if ((datastr = strchr(buf, '?')) != NULL) {
    strncpy(data, datastr + 1, datalen);
  }
  return strlen(data);
}


x86 assembly (clang, -O0):
<read_httpget_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
call   1050 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     117c <read_httpget_data+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_httpget_data>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movb   $0x0,(%rsi)
mov    $0x3f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     115e <read_httpget_data+0x2e>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strlen@plt>

LLVM IR (-O0):
define i32 @read_httpget_data(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
store i8 0, i8* %8
%9 = load i8*, i8** %4
%10 = call i8* @strchr(i8* %9, i8 signext 63)
store i8* %10, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i64, i64* %6
%17 = call i32 @strncpy(i8* %13, i8* %15, i64 %16)
br label %18
18: ; preds = %12, %3
%19 = load i8*, i8** %5
%20 = call i32 @strlen(i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @read_httpget_data(i8* %0, i8* %1, i64 %2) {
store i8 0, i8* %1
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 63)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call i32 @strncpy(i8* %1, i8* %7, i64 %2)
br label %9
9: ; preds = %6, %3
%10 = tail call i32 @strlen(i8* %1)
ret i32 %10
}
void hang() {
  for (;;)
    __asm__ volatile("cli\n"
                     "hlt\n");
}


x86 assembly (clang, -O0):
<hang>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hang+0x9>
cli
hlt
jmp    1109 <hang+0x9>

x86 assembly (clang, -O2):
<hang>:
cli
hlt
jmp    1100 <hang>

LLVM IR (-O0):
define void @hang() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @hang() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "cli\0Ahlt\0A", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
void setWaitMsgType(int type, u_int *ptype) { *ptype |= (1 << (type - 1)); }


x86 assembly (clang, -O0):
<setWaitMsgType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setWaitMsgType>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rsi)
ret

LLVM IR (-O0):
define void @setWaitMsgType(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 = sub nsw i32 %5, 1
%7 = shl i32 1, %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = or i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @setWaitMsgType(i32 %0, i32* nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
ret void
}
void wsh_debug_printf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @wsh_debug_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, unsigned int);
void mem_move(void *dest, const void *source, unsigned size) {
  memmove(dest, source, size);
}


x86 assembly (clang, -O0):
<mem_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_move>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @mem_move(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
char *ctime_nonl(time_t *date) {
  char *d = ctime(date);
  d[strlen(d) - 1] = '\0';
  return d;
}


x86 assembly (clang, -O0):
<ctime_nonl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctime_nonl>:
push   %rbx
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ctime_nonl(i32* %0) {
%2 = tail call i8* @ctime(i32* %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
store i8 0, i8* %6
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void pair_print(void *key, void *val) {
  printf("%s = %s", (char *)key, (char *)val);
}


x86 assembly (clang, -O0):
<pair_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_print>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s = %s\00"
define void @pair_print(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void *render_byte(int byte, void *dest) {
  *(unsigned char *)dest = (unsigned char)byte;
  return dest + 1;
}


x86 assembly (clang, -O0):
<render_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_byte>:
mov    %dil,(%rsi)
lea    0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i8* @render_byte(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %4
store i8 %6, i8* %7
%8 = load i8*, i8** %4
%9 = getelementptr i8, i8* %8, i64 1
ret i8* %9
}

LLVM IR (-O2):
define i8* @render_byte(i32 %0, i8* writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = getelementptr i8, i8* %1, i64 1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 30000; i = i + 7) {
    if (i % 3 == 0 && i % 2 != 0) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7530,-0x8(%rbp)
jge    117d <main+0x6d>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116a <main+0x5a>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x5f>
mov    -0x8(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    112d <main+0x1d>
nop
lea    0x7(%rbx),%eax
cmp    $0x7529,%ebx
mov    %eax,%ebx
jae    1156 <main+0x46>
test   $0x1,%bl
je     1120 <main+0x10>
movzwl %bx,%eax
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
lea    (%rax,%rax,2),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
test   %cx,%cx
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 30000
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10, %6
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 7
store i32 %20, i32* %2
br label %3
21: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %11
%2 = phi i32 [ 0, %0 ], [ %12, %11 ]
%3 = trunc i32 %2 to i16
%4 = urem i16 %3, 3
%5 = icmp ne i16 %4, 0
%6 = and i32 %2, 1
%7 = icmp eq i32 %6, 0
%8 = or i1 %7, %5
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %11
11: ; preds = %1, %9
%12 = add nuw nsw i32 %2, 7
%13 = icmp ult i32 %2, 29993
br i1 %13, label %1, label %14
14: ; preds = %11
ret i32 0
}
double cephes_pdtrc(k, m)
int k;
double m;
{
  double v;
  if ((k < 0) || (m <= 0.0)) {
    mtherr("pdtrc", 1);
    return (0.0);
  }
  v = k + 1;
  return (cephes_igam(v, m));
}


x86 assembly (clang, -O0):
<cephes_pdtrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1148 <cephes_pdtrc+0x28>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1168 <cephes_pdtrc+0x48>
lea    0xeb1(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1191 <cephes_pdtrc+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%al
call   1030 <cephes_igam@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_pdtrc>:
push   %rax
test   %edi,%edi
js     114d <cephes_pdtrc+0x2d>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    114d <cephes_pdtrc+0x2d>
add    $0x1,%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mov    $0x2,%al
call   1030 <cephes_igam@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
lea    0xeac(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pdtrc\00"
define double @cephes_pdtrc(i32 %0, double %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = fcmp ole double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %2
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %3
br label %22
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
store double %17, double* %6
%18 = load double, double* %6
%19 = load double, double* %5
%20 = call i32 (double, double, ...) bitcast (i32 (...)* @cephes_igam to i32 (double, double, ...)*)(double %18, double %19)
%21 = sitofp i32 %20 to double
store double %21, double* %3
br label %22
22: ; preds = %14, %12
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"pdtrc\00"
define double @cephes_pdtrc(i32 %0, double %1) {
%3 = icmp slt i32 %0, 0
%4 = fcmp ole double %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
br label %13
8: ; preds = %2
%9 = add nuw nsw i32 %0, 1
%10 = sitofp i32 %9 to double
%11 = tail call i32 (double, double, ...) bitcast (i32 (...)* @cephes_igam to i32 (double, double, ...)*)(double %10, double %1)
%12 = sitofp i32 %11 to double
br label %13
13: ; preds = %8, %6
%14 = phi double [ 0.000000e+00, %6 ], [ %12, %8 ]
ret double %14
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ drand(double *);
uint32_t irand(double *seed, uint32_t size) {
  uint32_t x = (uint32_t)(drand(seed) * size);
  assert(0 <= x && x < size);
  return x;
}


x86 assembly (clang, -O0):
<irand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <drand@plt>
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x18(%rbp),%rcx
mov    %al,-0x19(%rbp)
jg     1161 <irand+0x41>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <drand@plt>
mov    %rax,%rbx
imul   %r14,%rbx
test   %rbx,%rbx
setns  %al
cmp    %r14,%rbx
setl   %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @irand(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%6 = load double*, double** %3
%7 = call i64 @drand(double* %6)
%8 = load i64, i64* %4
%9 = mul nsw i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = icmp sle i64 0, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = icmp slt i64 %13, %14
br label %16
16: ; preds = %12, %2
%17 = phi i1 [ false, %2 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @irand(double* %0, i64 %1) {
%3 = tail call i64 @drand(double* %0)
%4 = mul nsw i64 %3, %1
%5 = icmp sgt i64 %4, -1
%6 = icmp slt i64 %4, %1
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i64 %4
}
long power(long x, long y) {
  long result;
  int index;
  result = 1;
  for (index = 0; index < y; index++) {
    result = result * x;
  }
  return result;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1144 <power+0x44>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <power+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %rsi,%rsi
jle    111b <power+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1156 <power+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <power+0x30>
test   %rcx,%rcx
je     116a <power+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
void _Jv_InitClass() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_InitClass() {
ret void
}
int imax(int i, int j) { return (i > j) ? i : j; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @imax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned int ascii_toint(char c) {
  if (c >= 'a')
    return c - 'a' + 10;
  if (c >= 'A')
    return c - 'A' + 10;
  if (c >= '0')
    return c - '0';
  return 0;
}


x86 assembly (clang, -O0):
<ascii_toint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <ascii_toint+0x29>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <ascii_toint+0x6b>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <ascii_toint+0x48>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <ascii_toint+0x6b>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1164 <ascii_toint+0x64>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <ascii_toint+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_toint>:
mov    %edi,%eax
cmp    $0x61,%al
jl     110a <ascii_toint+0xa>
add    $0xffffffa9,%eax
ret
cmp    $0x41,%al
jl     1112 <ascii_toint+0x12>
add    $0xffffffc9,%eax
ret
mov    %eax,%ecx
add    $0xffffffd0,%ecx
xor    %edx,%edx
cmp    $0x30,%al
cmovge %ecx,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ascii_toint(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 10
store i32 %11, i32* %2
br label %30
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = add nsw i32 %19, 10
store i32 %20, i32* %2
br label %30
21: ; preds = %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 48
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 48
store i32 %28, i32* %2
br label %30
29: ; preds = %21
store i32 0, i32* %2
br label %30
30: ; preds = %29, %25, %16, %7
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @ascii_toint(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp sgt i8 %0, 96
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %2, -87
br label %14
6: ; preds = %1
%7 = icmp sgt i8 %0, 64
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = add nsw i32 %2, -55
br label %14
10: ; preds = %6
%11 = icmp sgt i8 %0, 47
%12 = add nsw i32 %2, -48
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %10, %8, %4
%15 = phi i32 [ %5, %4 ], [ %9, %8 ], [ %13, %10 ]
ret i32 %15
}
int test_imm_E1uint16_mem(unsigned short *val) {
  return ((*val) & (0xE1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E1uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xe1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E1uint16_mem>:
testb  $0xe1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E1uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 225
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int TK_GetTimeMs();
int clock(void) { return (TK_GetTimeMs()); }


x86 assembly (clang, -O0):
<clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TK_GetTimeMs@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clock() {
%1 = call i32 (...) @TK_GetTimeMs()
ret i32 %1
}

LLVM IR (-O2):
define i32 @clock() {
%1 = tail call i32 (...) @TK_GetTimeMs()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
int /*<<< orphan*/ RegWriteA(int, int);
void AutoGainControlSw(unsigned char UcModeSw) {
  if (UcModeSw == 0x00) {
    RegWriteA(0x0129, 0xA0);
    RegWriteA(0x012A, 0xA0);
    RamWrite32A(0x100B, 0x3F800000);
    RamWrite32A(0x100B | 0x0100, 0x3F800000);
  } else {
    RegWriteA(0x0129, 0xA3);
    RegWriteA(0x012A, 0xA3);
  }
}


x86 assembly (clang, -O0):
<AutoGainControlSw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    117c <AutoGainControlSw+0x5c>
mov    $0x129,%edi
mov    $0xa0,%esi
call   1040 <RegWriteA@plt>
mov    $0x12a,%edi
mov    $0xa0,%esi
call   1040 <RegWriteA@plt>
mov    $0x100b,%edi
mov    $0x3f800000,%esi
call   1030 <RamWrite32A@plt>
mov    $0x110b,%edi
mov    $0x3f800000,%esi
call   1030 <RamWrite32A@plt>
jmp    119a <AutoGainControlSw+0x7a>
mov    $0x129,%edi
mov    $0xa3,%esi
call   1040 <RegWriteA@plt>
mov    $0x12a,%edi
mov    $0xa3,%esi
call   1040 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AutoGainControlSw>:
push   %rax
test   %edi,%edi
je     1144 <AutoGainControlSw+0x24>
mov    $0x129,%edi
mov    $0xa3,%esi
call   1040 <RegWriteA@plt>
mov    $0x12a,%edi
mov    $0xa3,%esi
pop    %rax
jmp    1040 <RegWriteA@plt>
mov    $0x129,%edi
mov    $0xa0,%esi
call   1040 <RegWriteA@plt>
mov    $0x12a,%edi
mov    $0xa0,%esi
call   1040 <RegWriteA@plt>
mov    $0x100b,%edi
mov    $0x3f800000,%esi
call   1030 <RamWrite32A@plt>
mov    $0x110b,%edi
mov    $0x3f800000,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @AutoGainControlSw(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 @RegWriteA(i32 297, i32 160)
%8 = call i32 @RegWriteA(i32 298, i32 160)
%9 = call i32 @RamWrite32A(i32 4107, i32 1065353216)
%10 = call i32 @RamWrite32A(i32 4363, i32 1065353216)
br label %14
11: ; preds = %1
%12 = call i32 @RegWriteA(i32 297, i32 163)
%13 = call i32 @RegWriteA(i32 298, i32 163)
br label %14
14: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
define void @AutoGainControlSw(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i32 @RegWriteA(i32 297, i32 160)
%5 = tail call i32 @RegWriteA(i32 298, i32 160)
%6 = tail call i32 @RamWrite32A(i32 4107, i32 1065353216)
%7 = tail call i32 @RamWrite32A(i32 4363, i32 1065353216)
br label %11
8: ; preds = %1
%9 = tail call i32 @RegWriteA(i32 297, i32 163)
%10 = tail call i32 @RegWriteA(i32 298, i32 163)
br label %11
11: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ STZ8(int /*<<< orphan*/);
void Op9EM1X0(void) { STZ8(AbsoluteIndexedXX0(2)); }


x86 assembly (clang, -O0):
<Op9EM1X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
call   1040 <STZ8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9EM1X0>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STZ8@plt>

LLVM IR (-O0):
define void @Op9EM1X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 2)
%2 = call i32 @STZ8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op9EM1X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 2)
%2 = tail call i32 @STZ8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ localfunc(int *, int *);
int main() {
  int i;
  int array[16384];
  for (i = 0; i < 100000; i++) {
    localfunc(array, array + 16384);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    115e <main+0x4e>
lea    -0x10010(%rbp),%rdi
lea    -0x10010(%rbp),%rsi
add    $0x10000,%rsi
call   1030 <localfunc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10000,%rsp
mov    $0x186a0,%ebp
lea    0x10000(%rsp),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <localfunc@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x10000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16384 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = getelementptr inbounds [16384 x i32], [16384 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [16384 x i32], [16384 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds i32, i32* %9, i64 16384
%11 = call i32 @localfunc(i32* %8, i32* %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16384 x i32]
%2 = bitcast [16384 x i32]* %1 to i8*
%3 = getelementptr inbounds [16384 x i32], [16384 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [16384 x i32], [16384 x i32]* %1, i64 0, i64 16384
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %8, %5 ]
%7 = call i32 @localfunc(i32* %3, i32* %4)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 100000
br i1 %9, label %10, label %5
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
int mockup_1(void *user_data) {
  if (user_data != NULL) {
    *((int *)user_data) = 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<mockup_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <mockup_1+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mockup_1>:
test   %rdi,%rdi
je     110b <mockup_1+0xb>
movl   $0x1,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mockup_1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32 1, i32* %7
br label %8
8: ; preds = %5, %1
ret i32 1
}

LLVM IR (-O2):
define i32 @mockup_1(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
store i32 1, i32* %4
br label %5
5: ; preds = %3, %1
ret i32 1
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct epoll_event *, int, int);
int my_epoll_wait(int epfd, struct epoll_event *events, int maxevents,
                  int timeout) {
  return syscall(256, epfd, events, maxevents, timeout);
}


x86 assembly (clang, -O0):
<my_epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x100,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_epoll_wait>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x100,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @my_epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.epoll_event*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.epoll_event* %1, %struct.epoll_event** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.epoll_event*, %struct.epoll_event** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 256, i32 %9, %struct.epoll_event* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @my_epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 256, i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3)
ret i32 %5
}
int wsm_offcore_num(void) { return (2); }


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

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

LLVM IR (-O0):
define i32 @wsm_offcore_num() {
ret i32 2
}

LLVM IR (-O2):
define i32 @wsm_offcore_num() {
ret i32 2
}
void avpriv_set_systematic_pal2() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_set_systematic_pal2() {
ret void
}
int arch_is_kernel_text(unsigned long addr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_is_kernel_text(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ my_putstr_to(int /*<<< orphan*/, char const *);
void my_puterr(char const *str) { my_putstr_to(STDERR_FILENO, str); }


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

x86 assembly (clang, -O2):
<my_puterr>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <my_putstr_to@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define void @my_puterr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDERR_FILENO
%4 = load i8*, i8** %2
%5 = call i32 @my_putstr_to(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @my_puterr(i8* %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 @my_putstr_to(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("***************\n"
         "* mchess v0.1 *\n"
         "***************\n"
         "\n"
         "~ enter coordinates to move a chess piece (e.g. 'b1 c3')\n"
         "~ enter 'q' to exit the game\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [137 x i8] c"***************\0A* mchess v0.1 *\0A***************\0A\0A~ enter coordinates to move a chess piece (e.g. 'b1 c3')\0A~ enter 'q' to exit the game\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [136 x i8] c"***************\0A* mchess v0.1 *\0A***************\0A\0A~ enter coordinates to move a chess piece (e.g. 'b1 c3')\0A~ enter 'q' to exit the game\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([136 x i8], [136 x i8]* @str, i64 0, i64 0))
ret void
}