xunge/DecIR huggingface dataset:
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  int i = 0;
  while ((c = getchar()) != '\n')
    i++;
  printf("%d\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1157 <main+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 10
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *, int);
int /*<<< orphan*/ Recurse(int);
int atoi(char *);
int main(int argc, char **argv) {
  int depth = 512;
  if (argc > 1) {
    depth = atoi(argv[1]);
    Print("Depth is %d\n", depth);
  }
  Recurse(depth);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x200,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1176 <main+0x46>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1050 <Print@plt>
mov    -0x14(%rbp),%edi
call   1030 <Recurse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x200,%ebx
cmp    $0x2,%edi
jl     1154 <main+0x24>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1050 <Print@plt>
mov    %ebx,%edi
call   1030 <Recurse@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Depth is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 512, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @Print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %9, %2
%17 = load i32, i32* %6
%18 = call i32 @Recurse(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Depth is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @Print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ %7, %4 ], [ 512, %2 ]
%11 = tail call i32 @Recurse(i32 %10)
ret i32 0
}
/* Variables and functions */
int getStartFreq(int, int);
int getSbrStartFreqRAW(int startFreq, int QMFbands, int fs) {
  int result;
  ;
  ;
  ;
  ;
  if (startFreq < 0 || startFreq > 15) {
    ;
    return -1;
  };
  result = getStartFreq(fs, startFreq);
  ;
  ;
  ;
  ;
  result = (result * fs / QMFbands + 1) >> 1;
  ;
  return (result);
}


x86 assembly (clang, -O0):
<getSbrStartFreqRAW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1135 <getSbrStartFreqRAW+0x25>
cmpl   $0xf,-0x8(%rbp)
jle    1141 <getSbrStartFreqRAW+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <getSbrStartFreqRAW+0x59>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <getStartFreq@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSbrStartFreqRAW>:
mov    $0xffffffff,%eax
cmp    $0xf,%edi
ja     113b <getSbrStartFreqRAW+0x2b>
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%esi
mov    %edx,%edi
call   1030 <getStartFreq@plt>
imul   %ebp,%eax
cltd
idiv   %ebx
add    $0x1,%eax
sar    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getSbrStartFreqRAW(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 15
br i1 %13, label %14, label %15
14: ; preds = %11, %3
store i32 -1, i32* %4
br label %27
15: ; preds = %11
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = call i32 @getStartFreq(i32 %16, i32 %17)
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = sdiv i32 %21, %22
%24 = add nsw i32 %23, 1
%25 = ashr i32 %24, 1
store i32 %25, i32* %8
%26 = load i32, i32* %8
store i32 %26, i32* %4
br label %27
27: ; preds = %15, %14
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @getSbrStartFreqRAW(i32 %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %0, 15
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i32 @getStartFreq(i32 %2, i32 %0)
%7 = mul nsw i32 %6, %2
%8 = sdiv i32 %7, %1
%9 = add nsw i32 %8, 1
%10 = ashr i32 %9, 1
br label %11
11: ; preds = %3, %5
%12 = phi i32 [ %10, %5 ], [ -1, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_udcflush_line(void *target) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_udcflush_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_udcflush_line(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int fibonacci(int i) {
  if (i <= 1) {
    return 1;
  }
  return fibonacci(i - 1) + fibonacci(i - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <fibonacci+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fibonacci+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fibonacci+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fibonacci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fibonacci(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 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @fibonacci(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @fibonacci(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
int _wait(int *status) {
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ECHILD
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char);
void putInversCharXY(int _x, int _y, int _iOut) {
  printf("\x01B[7m\x01B[%d;%dH%c\x01B[0m", _y, _x, (char)_iOut);
}


x86 assembly (clang, -O0):
<putInversCharXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%eax
lea    0xecf(%rip),%rdi
movsbl %al,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putInversCharXY>:
mov    %edi,%eax
movsbl %dl,%ecx
lea    0xee4(%rip),%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[7m\1B[%d;%dH%c\1B[0m\00"
define void @putInversCharXY(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[7m\1B[%d;%dH%c\1B[0m\00"
define void @putInversCharXY(i32 %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i8 signext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int pipe(int *fd) {
  printf("pipe() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pipe>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"pipe() not implemented\0A\00"
define i32 @pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"pipe() not implemented\00"
define i32 @pipe(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void *get_XGravityEvent_display(void *_p) {
  return (void *)((XGravityEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XGravityEvent_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XGravityEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XGravityEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int getCurrentDir(char *currentDir) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getCurrentDir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int testLogic(bool b, int x, int y) { return b ? x : y; }


x86 assembly (clang, -O0):
<testLogic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <testLogic+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <testLogic+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLogic>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @testLogic(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
int decrypt_byte(unsigned long *pkeys, const unsigned long *pcrc_32_tab) {
  (void)pcrc_32_tab;
  unsigned temp;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @decrypt_byte(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 2
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 65535
%12 = or i32 %11, 2
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = xor i32 %14, 1
%16 = mul i32 %13, %15
%17 = lshr i32 %16, 8
%18 = and i32 %17, 255
ret i32 %18
}

LLVM IR (-O2):
define i32 @decrypt_byte(i64* nocapture %0, i64* nocapture readnone %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 65533
%7 = or i32 %6, 2
%8 = xor i32 %6, 3
%9 = mul nuw i32 %7, %8
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
ret i32 %11
}
/* Variables and functions */
scalar_t__ u8isbasesigni(int);
scalar_t__ u8islatinsigni(int);
int u8issigni(int n) { return u8isbasesigni(n) || u8islatinsigni(n); }


x86 assembly (clang, -O0):
<u8issigni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <u8isbasesigni@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <u8issigni+0x37>
mov    -0x4(%rbp),%edi
call   1030 <u8islatinsigni@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8issigni>:
push   %rbx
mov    %edi,%ebx
call   1040 <u8isbasesigni@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <u8issigni+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <u8islatinsigni@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @u8issigni(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @u8isbasesigni(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @u8islatinsigni(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @u8issigni(i32 %0) {
%2 = tail call i64 @u8isbasesigni(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @u8islatinsigni(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  fputc('a', stdout);
  fputc('\n', stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x61,%edi
call   1030 <fputc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x61,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputc(i8 signext 97, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(i8 signext 97, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputc(i8 signext 10, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void cmd_checkbit(int workonbit, unsigned char workingbyte) {
  printf("Bit %d ist im Byte: %s\n", workonbit,
         ((workingbyte >> workonbit) & 1) ? "gesetzt" : "nicht gesetzt");
}


x86 assembly (clang, -O0):
<cmd_checkbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
movzbl -0x5(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
and    $0x1,%ecx
lea    0xedf(%rip),%rdx
lea    0xede(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_checkbit>:
mov    %edi,%eax
bt     %edi,%esi
lea    0xefc(%rip),%rcx
lea    0xefb(%rip),%rdx
cmovae %rcx,%rdx
lea    0xed2(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Bit %d ist im Byte: %s\0A\00"
@.str.1 = [8 x i8] c"gesetzt\00"
@.str.2 = [14 x i8] c"nicht gesetzt\00"
define void @cmd_checkbit(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = load i32, i32* %3
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Bit %d ist im Byte: %s\0A\00"
@.str.1 = [8 x i8] c"gesetzt\00"
@.str.2 = [14 x i8] c"nicht gesetzt\00"
define void @cmd_checkbit(i32 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = shl nuw i32 1, %0
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *hex16_encode(const unsigned char *data, size_t input_length,
                      size_t *output_length) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i32* @hex16_encode(i8* nocapture readnone %0, i64 %1, i64* nocapture readnone %2) {
ret i32* null
}
int afs_get_filenames_pos(char *pstrBuffer) {
  return (
      *((int *)(pstrBuffer + 0x08 + (*((int *)(pstrBuffer + 0x04))) * 0x08)));
}


x86 assembly (clang, -O0):
<afs_get_filenames_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x3,%ecx
movslq %ecx,%rcx
mov    0x8(%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<afs_get_filenames_pos>:
movslq 0x4(%rdi),%rax
mov    0x8(%rdi,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @afs_get_filenames_pos(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 8
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %4, i64 %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @afs_get_filenames_pos(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
ret i32 %10
}
void test5_list(void) {}


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

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

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

LLVM IR (-O2):
define void @test5_list() {
ret void
}
char parseNumberToChar(int number) { return (char)(number + (int)'0'); }


x86 assembly (clang, -O0):
<parseNumberToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseNumberToChar>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @parseNumberToChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @parseNumberToChar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
int execute_setuid32() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_setuid32() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_setuid32() {
ret i32 0
}
__attribute__((regparm(3), no)) int fn5(void) {
  asm volatile("" : : : "memory");
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @fn5() {
ret i32 0
}

LLVM IR (-O2):
define i32 @fn5() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void ptrace_sandbox_permit_recv(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_recv(%struct.pt_sandbox* nocapture %0) {
ret void
}
int sem_wait() {
  ;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sem_wait() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sem_wait() {
ret i32 0
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int);
int shim_mlockall(int flags) { return (int)shim_enosys(0, flags); }


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

x86 assembly (clang, -O2):
<shim_mlockall>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_mlockall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @shim_enosys(i32 0, i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @shim_mlockall(i32 %0) {
%2 = tail call i64 @shim_enosys(i32 0, i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int extArpScanby() { return 0; }


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

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

LLVM IR (-O0):
define i32 @extArpScanby() {
ret i32 0
}

LLVM IR (-O2):
define i32 @extArpScanby() {
ret i32 0
}
void *nowarn_malloc_3_5(const char *s, unsigned n) {
  if (n < 3 || 5 < n)
    n = 3;
  char *p = (char *)malloc(n);
  strncpy(p + 1, s, 4);
  return p;
}


x86 assembly (clang, -O0):
<nowarn_malloc_3_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jb     1147 <nowarn_malloc_3_5+0x27>
mov    $0x5,%eax
cmp    -0xc(%rbp),%eax
jae    114e <nowarn_malloc_3_5+0x2e>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowarn_malloc_3_5>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x6(%rsi),%eax
cmp    $0xfffffffd,%eax
mov    $0x3,%edi
cmovae %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
mov    $0x4,%edx
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @nowarn_malloc_3_5(i8* nocapture %0, i32 %1) {
%3 = add i32 %1, -6
%4 = icmp ult i32 %3, -3
%5 = select i1 %4, i32 3, i32 %1
%6 = zext i32 %5 to i64
%7 = tail call i8* @malloc(i64 %6)
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i8* @strncpy(i8* %8, i8* dereferenceable(1) %0, i64 4)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ kill_this_task();
void pickup(void) { kill_this_task(); }


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

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

LLVM IR (-O0):
define void @pickup() {
%1 = call i32 (...) @kill_this_task()
ret void
}

LLVM IR (-O2):
define void @pickup() {
%1 = tail call i32 (...) @kill_this_task()
ret void
}
void zeroIt(int chess[][8]) {
  int i, j;
  for (i = 0; i < 8; i++)
    for (j = 0; j < 8; j++)
      chess[i][j] = 0;
  return;
}


x86 assembly (clang, -O0):
<zeroIt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1165 <zeroIt+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1152 <zeroIt+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <zeroIt+0x20>
jmp    1157 <zeroIt+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zeroIt+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroIt>:
xorps  %xmm0,%xmm0
movups %xmm0,0xf0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zeroIt([8 x i32]* nocapture writeonly %0) {
%2 = bitcast [8 x i32]* %0 to i8*
ret void
}
unsigned long long bitmask_from_cells(char *cell) {
  unsigned long long piece_mask = 0ULL;
  int i;
  for (i = 0; i < 5; i++)
    piece_mask |= 1ULL << cell[i];
  return piece_mask;
}


x86 assembly (clang, -O0):
<bitmask_from_cells>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    114f <bitmask_from_cells+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <bitmask_from_cells+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmask_from_cells>:
mov    0x1(%rdi),%cl
mov    $0x1,%eax
shl    %cl,%rax
mov    (%rdi),%cl
bts    %rcx,%rax
mov    0x2(%rdi),%cl
bts    %rcx,%rax
mov    0x3(%rdi),%cl
bts    %rcx,%rax
mov    0x4(%rdi),%cl
bts    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @bitmask_from_cells(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i64
%4 = and i64 %3, 4294967295
%5 = shl nuw i64 1, %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i64
%9 = and i64 %8, 4294967295
%10 = shl nuw i64 1, %9
%11 = or i64 %10, %5
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i64
%15 = and i64 %14, 4294967295
%16 = shl nuw i64 1, %15
%17 = or i64 %16, %11
%18 = getelementptr inbounds i8, i8* %0, i64 3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i64
%21 = and i64 %20, 4294967295
%22 = shl nuw i64 1, %21
%23 = or i64 %22, %17
%24 = getelementptr inbounds i8, i8* %0, i64 4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i64
%27 = and i64 %26, 4294967295
%28 = shl nuw i64 1, %27
%29 = or i64 %28, %23
ret i64 %29
}
/* Variables and functions */
int open();
int cpuset_create(void) {
  int fd;
  fd = open();
}


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

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

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

LLVM IR (-O2):
define i32 @cpuset_create() {
%1 = tail call i32 (...) @open()
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t width2mask(int w) { return (0xff >> (8 - w)); }


x86 assembly (clang, -O0):
<width2mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x8,%ecx
sub    -0x4(%rbp),%ecx
mov    $0xff,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<width2mask>:
mov    $0x8,%cl
sub    %dil,%cl
mov    $0xff,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @width2mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 8, %3
%5 = ashr i32 255, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @width2mask(i32 %0) {
%2 = sub nsw i32 8, %0
%3 = lshr i32 255, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t myread_swift_code(int fd, void *buf, size_t len) {
  return recv(fd, buf, len, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @myread_swift_code(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_started_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_started_callback"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_stream_set_started_callback\00"
define i32 @pa_stream_set_started_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _io_write(int, int);
void kb_init() { _io_write(0x21, 0xFD); }


x86 assembly (clang, -O0):
<kb_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xfd,%esi
call   1030 <_io_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_init>:
mov    $0x21,%edi
mov    $0xfd,%esi
jmp    1030 <_io_write@plt>

LLVM IR (-O0):
define void @kb_init() {
%1 = call i32 @_io_write(i32 33, i32 253)
ret void
}

LLVM IR (-O2):
define void @kb_init() {
%1 = tail call i32 @_io_write(i32 33, i32 253)
ret void
}
void barrier_write(void) { __asm__ volatile("sfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @barrier_write() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct glplatform_win {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ glplatform_destroy_window(struct glplatform_win *);
void on_destroy(struct glplatform_win *win) { glplatform_destroy_window(win); }


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

x86 assembly (clang, -O2):
<on_destroy>:
jmp    1030 <glplatform_destroy_window@plt>

LLVM IR (-O0):
%struct.glplatform_win = type { i32 }
define void @on_destroy(%struct.glplatform_win* %0) {
%2 = alloca %struct.glplatform_win*
store %struct.glplatform_win* %0, %struct.glplatform_win** %2
%3 = load %struct.glplatform_win*, %struct.glplatform_win** %2
%4 = call i32 @glplatform_destroy_window(%struct.glplatform_win* %3)
ret void
}

LLVM IR (-O2):
%struct.glplatform_win = type { i32 }
define void @on_destroy(%struct.glplatform_win* %0) {
%2 = tail call i32 @glplatform_destroy_window(%struct.glplatform_win* %0)
ret void
}
void exynos_ion_set_platdata(void) {}


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

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

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

LLVM IR (-O2):
define void @exynos_ion_set_platdata() {
ret void
}
int test(int a, int b) { return (int)(a + b); }


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

x86 assembly (clang, -O2):
<test>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @test(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_open_advertising_pipe_error(int);
int /*<<< orphan*/ fd_nrf8001_open_advertising_pipe_success();
void fd_nrf8001_dispatch_open_advertising_pipe_response(
    uint8_t status, uint8_t *response_data __attribute__((unused)),
    uint32_t response_data_length __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_open_advertising_pipe_error(status);
    return;
  }
  fd_nrf8001_open_advertising_pipe_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_open_advertising_pipe_response+0x29>
mov    -0x4(%rbp),%edi
call   1040 <fd_nrf8001_open_advertising_pipe_error@plt>
jmp    1150 <fd_nrf8001_dispatch_open_advertising_pipe_response+0x30>
mov    $0x0,%al
call   1030 <fd_nrf8001_open_advertising_pipe_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_open_advertising_pipe_response+0x9>
jmp    1040 <fd_nrf8001_open_advertising_pipe_error@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_open_advertising_pipe_success@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_open_advertising_pipe_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_open_advertising_pipe_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_open_advertising_pipe_success()
br label %9
9: ; preds = %7, %5
ret void
}
void gdkx_visual_get() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ printf(char *);
int open_file_test(FILE *file) {
  if (file == NULL) {
    clear_screen();
    printf(" Erro ao abrir o arquivo!\n\n");
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<open_file_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <open_file_test+0x36>
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    115d <open_file_test+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file_test>:
push   %rbx
mov    $0x1,%ebx
test   %rdi,%rdi
jne    1140 <open_file_test+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <clear_screen@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c" Erro ao abrir o arquivo!\0A\0A\00"
define i32 @open_file_test(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @clear_screen()
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [27 x i8] c" Erro ao abrir o arquivo!\0A\00"
define i32 @open_file_test(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @clear_screen()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRDA_get(void) { return U_WMRCORENONE_get("U_WMRDA"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRDA\00"
define i32 @U_WMRDA_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDA\00"
define i32 @U_WMRDA_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ set_word(void *, int *);
void set_word_value(void *p, int v) { set_word(p, &v); }


x86 assembly (clang, -O0):
<set_word_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <set_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_word_value>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <set_word@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @set_word_value(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @set_word(i8* %5, i32* %4)
ret void
}

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