xunge/DecIR huggingface dataset:
int foo(void) {
  int a, b, c;
  asm("# Magic instruction" : "=r"(a) : "r"(0));
  asm("# Magic instruction" : "=r"(b) : "r"(0));
  asm("# Magic instruction" : "=r"(c) : "r"(0));
  return a + b + c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 asm "# Magic instruction", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %4, i32* %1
%5 = call i32 asm "# Magic instruction", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %5, i32* %2
%6 = call i32 asm "# Magic instruction", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 asm "# Magic instruction", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = mul nsw i32 %1, 3
ret i32 %2
}
signed short convert(signed int i) {
  i -= 0x43c00000;
  return (i > 32767) ? 32767 : ((i < -32768) ? -32768 : i);
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x43c00000,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x7fff,-0x4(%rbp)
jle    112c <convert+0x2c>
mov    $0x7fff,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <convert+0x52>
cmpl   $0xffff8000,-0x4(%rbp)
jge    1146 <convert+0x46>
mov    $0xffff8000,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <convert+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
cmp    $0x43bf8001,%edi
mov    $0x43bf8000,%ecx
cmovge %edi,%ecx
cmp    $0x43c07fff,%ecx
mov    $0x7fff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @convert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1136656384
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 32767
br i1 %6, label %7, label %8
7: ; preds = %1
br label %16
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, -32768
br i1 %10, label %11, label %12
11: ; preds = %8
br label %14
12: ; preds = %8
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ -32768, %11 ], [ %13, %12 ]
br label %16
16: ; preds = %14, %7
%17 = phi i32 [ 32767, %7 ], [ %15, %14 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @convert(i32 %0) {
%2 = icmp sgt i32 %0, 1136623616
%3 = select i1 %2, i32 %0, i32 1136623616
%4 = icmp ult i32 %3, 1136689151
%5 = select i1 %4, i32 %3, i32 1136689151
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
void *generateData(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @generateData() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @generateData() {
ret i8* null
}
int track_bbox_right(int ch, int i) {}


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

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

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

LLVM IR (-O2):
define i32 @track_bbox_right(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int dup3(int, int, int);
int errno;
int __sulong_posix_dup3(int oldfd, int newfd, int flags) {
  {
    int native_errno = errno;
    int result = dup3(oldfd, newfd, flags);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  }
}


x86 assembly (clang, -O0):
<__sulong_posix_dup3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <dup3@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1158 <__sulong_posix_dup3+0x48>
xor    %eax,%eax
mov    0x2e8f(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    0x2e7e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
define i32 @__sulong_posix_dup3(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* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* @errno
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @dup3(i32 %10, i32 %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
%19 = sext i32 %18 to i64
%20 = trunc i64 %19 to i32
store i32 %20, i32* %8
br label %21
21: ; preds = %16, %3
%22 = load i32, i32* %7
store i32 %22, i32* @errno
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_dup3(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @dup3(i32 %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ downRows();
char getch();
int /*<<< orphan*/ upRows();
char suEzo(void) {
  char d = getch();
  if (d == 'd') {
    downRows();
  } else if (d == 'u') {
    upRows();
  }
  return d;
}


x86 assembly (clang, -O0):
<suEzo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x64,%eax
jne    115b <suEzo+0x2b>
mov    $0x0,%al
call   1050 <downRows@plt>
jmp    1174 <suEzo+0x44>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
jne    116f <suEzo+0x3f>
mov    $0x0,%al
call   1030 <upRows@plt>
jmp    1174 <suEzo+0x44>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suEzo>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
cmp    $0x75,%al
je     114c <suEzo+0x1c>
cmp    $0x64,%bl
jne    1153 <suEzo+0x23>
xor    %eax,%eax
call   1050 <downRows@plt>
jmp    1153 <suEzo+0x23>
xor    %eax,%eax
call   1030 <upRows@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @suEzo() {
%1 = alloca i8
%2 = call signext i8 (...) @getch()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @downRows()
br label %15
8: ; preds = %0
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 117
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @upRows()
br label %14
14: ; preds = %12, %8
br label %15
15: ; preds = %14, %6
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @suEzo() {
%1 = tail call signext i8 (...) @getch()
switch i8 %1, label %6 [
i8 100, label %2
i8 117, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @downRows()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @upRows()
br label %6
6: ; preds = %0, %4, %2
ret i8 %1
}
void enterMultiProtocolCpeHdPatch(void) {}


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

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

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

LLVM IR (-O2):
define void @enterMultiProtocolCpeHdPatch() {
ret void
}
/* Variables and functions */
int getnpar(int, char *, char *, short *);
int getnparshort(int n, char *name, short *ptr) {
  return getnpar(n, name, "h", ptr);
}


x86 assembly (clang, -O0):
<getnparshort>:
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),%rcx
lea    0xecb(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnparshort>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"h\00"
define i32 @getnparshort(i32 %0, i8* %1, i16* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i16*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i16* %2, i16** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i16*, i16** %6
%10 = call i32 @getnpar(i32 %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i16* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"h\00"
define i32 @getnparshort(i32 %0, i8* %1, i16* %2) {
%4 = tail call i32 @getnpar(i32 %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i16* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: muss-with-environ command [args ..]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: muss-with-environ command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [44 x i8] c"Usage: muss-with-environ command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int sscanf(char const *, char *, char *, char *);
int affecter(const char *affectation) {
  char nom[50];
  char valeur[1000];
  if (sscanf(affectation, "%s = %[^\n]\n", nom, valeur) == 2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<affecter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    -0x440(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x2,%eax
jne    114f <affecter+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <affecter+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affecter>:
sub    $0x428,%rsp
lea    0xee2(%rip),%rsi
mov    %rsp,%rdx
lea    0x40(%rsp),%rcx
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
add    $0x428,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s = %[^\0A]\0A\00"
define i32 @affecter(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [50 x i8]
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%9 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s = %[^\0A]\0A\00"
define i32 @affecter(i8* nocapture %0) {
%2 = alloca [50 x i8]
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
ret i32 %8
}
int prime(unsigned int n) {
  int i = 2;
  for (i; i < n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    114a <prime+0x4a>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1137 <prime+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1151 <prime+0x51>
jmp    113c <prime+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
cmp    $0x3,%edi
jb     1121 <prime+0x21>
mov    $0x2,%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     1127 <prime+0x27>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <prime+0x10>
mov    $0x1,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = urem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fftwf_kernel_free(void *);
void fftwf_free(void *p) { fftwf_kernel_free(p); }


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

x86 assembly (clang, -O2):
<fftwf_free>:
jmp    1030 <fftwf_kernel_free@plt>

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

LLVM IR (-O2):
define void @fftwf_free(i8* %0) {
%2 = tail call i32 @fftwf_kernel_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_set_position() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_set_position"
         "\n");
}


x86 assembly (clang, -O0):
<pa_cvolume_set_position>:
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_cvolume_set_position>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_cvolume_set_position\00"
define i32 @pa_cvolume_set_position() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned long int test1(unsigned long int var_a, unsigned long int var_b) {
  unsigned long int var_z = var_a * var_b;
  return var_z;
}


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

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

LLVM IR (-O0):
define i64 @test1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @test1(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void server_interruption(int sig) {
  printf("\n\nSaving server torrents\n\n");
  printf("\n\nEnding Frogidel Torrent Server\n\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<server_interruption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [27 x i8] c"\0A\0ASaving server torrents\0A\0A\00"
@.str.1 = [35 x i8] c"\0A\0AEnding Frogidel Torrent Server\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define void @server_interruption(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"\0A\0ASaving server torrents\0A\00"
@str.2 = [34 x i8] c"\0A\0AEnding Frogidel Torrent Server\0A\00"
define void @server_interruption(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PlayAudio296(unsigned long);
void playaudio(unsigned long id) { PlayAudio296(id); }


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

x86 assembly (clang, -O2):
<playaudio>:
jmp    1030 <PlayAudio296@plt>

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

LLVM IR (-O2):
define void @playaudio(i64 %0) {
%2 = tail call i32 @PlayAudio296(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  printf("Unitialized x = %i\n", x);
  x = 1 + 2;
  printf("x with 1+2=%i\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Unitialized x = %i\0A\00"
@.str.1 = [15 x i8] c"x with 1+2=%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Unitialized x = %i\0A\00"
@.str.1 = [15 x i8] c"x with 1+2=%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t md5_H(uint32_t x, uint32_t y, uint32_t z) { return (x ^ y ^ z); }


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

x86 assembly (clang, -O2):
<md5_H>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @md5_H(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 = load i32, i32* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @md5_H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
void write_bytes(int fd, const void *buf, size_t count) {
  write(fd, buf, count);
}


x86 assembly (clang, -O0):
<write_bytes>:
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
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bytes>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @write_bytes(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 @write(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @write_bytes(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asinl(long double);
long double sinl(int /*<<< orphan*/);
long double sinasinl(long double x) { return (sinl(asinl(x))); }


x86 assembly (clang, -O0):
<sinasinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <asinl@plt>
mov    %eax,%edi
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinasinl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1040 <asinl@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1030 <sinl@plt>

LLVM IR (-O0):
define x86_fp80 @sinasinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @asinl(x86_fp80 %3)
%5 = call x86_fp80 @sinl(i32 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sinasinl(x86_fp80 %0) {
%2 = tail call i32 @asinl(x86_fp80 %0)
%3 = tail call x86_fp80 @sinl(i32 %2)
ret x86_fp80 %3
}
__attribute__((__always___)) void sx_compiler_read_barrier() {}


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

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

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

LLVM IR (-O2):
define void @sx_compiler_read_barrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_166() {
  Assert_real((isqrt(166) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              835, ("Integer square root of 166 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_166>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa6,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x343,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_166>:
push   %rax
mov    $0xa6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x343,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 166 should be 12\00"
define void @t_sqrt_166() {
%1 = call i32 @isqrt(i32 166)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 166 should be 12\00"
define void @t_sqrt_166() {
%1 = tail call i32 @isqrt(i32 166)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 835, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void I_ShutdownMusic(void) {}


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

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

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

LLVM IR (-O2):
define void @I_ShutdownMusic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *string_escape_quote(char *, char *);
char *process_generic_datatype_where(char *datatype_attribute_name,
                                     char *datatype_name) {
  char where[256];
  char destination[128];
  sprintf(where, "%s = '%s'", datatype_attribute_name,
          string_escape_quote(destination, datatype_name));
  return strdup(where);
}


x86 assembly (clang, -O0):
<process_generic_datatype_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x1a0(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x198(%rbp)
lea    -0x190(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <string_escape_quote@plt>
mov    -0x1a0(%rbp),%rdi
mov    -0x198(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7c(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_generic_datatype_where>:
push   %r14
push   %rbx
sub    $0x188,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1040 <string_escape_quote@plt>
lea    0xeb4(%rip),%rsi
lea    0x80(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <sprintf@plt>
mov    %r14,%rdi
call   1050 <strdup@plt>
add    $0x188,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s = '%s'\00"
define i8* @process_generic_datatype_where(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i8* @string_escape_quote(i8* %9, i8* %10)
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = call i8* @strdup(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s = '%s'\00"
define noalias i8* @process_generic_datatype_where(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = call i8* @string_escape_quote(i8* %6, i8* %1)
%8 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
%9 = call i8* @strdup(i8* %5)
ret i8* %9
}
/* Variables and functions */
int strlen(const char *s) {
  const char *p = s;
  while (*p++)
    ;
  return p - s - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
void foo092() {}


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

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

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

LLVM IR (-O2):
define void @foo092() {
ret void
}
long int toc_XX_unicode(long int x, long int y) { return x * y << 2; }


x86 assembly (clang, -O0):
<toc_XX_unicode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toc_XX_unicode>:
imul   %rsi,%rdi
lea    0x0(,%rdi,4),%rax
ret

LLVM IR (-O0):
define i64 @toc_XX_unicode(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = shl i64 %7, 2
ret i64 %8
}

LLVM IR (-O2):
define i64 @toc_XX_unicode(i64 %0, i64 %1) {
%3 = shl i64 %0, 2
%4 = mul i64 %3, %1
ret i64 %4
}
int test_imm_95int8_reg(signed char val) {
  return ((val) & (-0x95 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_95int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -149
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cyield();
int rand();
void sleepao() {
  int i = 0;
  i = rand() % 5 + 1;
  for (; i < 0; i--)
    cyield();
  return;
}


x86 assembly (clang, -O0):
<sleepao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1163 <sleepao+0x43>
mov    $0x0,%al
call   1030 <cyield@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <sleepao+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepao>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0xfffffffe,%eax
jg     1159 <sleepao+0x39>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cyield@plt>
jmp    1150 <sleepao+0x30>
pop    %rax
ret

LLVM IR (-O0):
define void @sleepao() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 5
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @cyield()
br label %10
10: ; preds = %8
%11 = load i32, i32* %1
%12 = add nsw i32 %11, -1
store i32 %12, i32* %1
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @sleepao() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = icmp slt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0, %4
%5 = tail call i32 (...) @cyield()
br label %4
6: ; preds = %0
ret void
}
/* Variables and functions */
long millis();
void delay(long ms) {
  long t = millis() + ms;
  while (millis() < t) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <millis@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <millis@plt>
cmp    -0x10(%rbp),%rax
jge    1141 <delay+0x31>
jmp    112b <delay+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <millis@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <millis@plt>
cmp    %rbx,%rax
jl     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @millis()
%5 = load i64, i64* %2
%6 = add nsw i64 %4, %5
store i64 %6, i64* %3
br label %7
7: ; preds = %11, %1
%8 = call i64 (...) @millis()
%9 = load i64, i64* %3
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = tail call i64 (...) @millis()
%3 = add nsw i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @millis()
%6 = icmp slt i64 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core5_swap(char *, int);
void U_EMRENDPATH_swap(char *record, int torev) { core5_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRENDPATH_swap>:
jmp    1030 <core5_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRENDPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_error_msg(char *);
void invalid_address(void) { set_error_msg("Invalid address"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Invalid address\00"
define void @invalid_address() {
%1 = call i32 @set_error_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Invalid address\00"
define void @invalid_address() {
%1 = tail call i32 @set_error_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int isISOControl(unsigned char c) {
  return (c > 0x00 && c <= 0x1F) || (c >= 0x7F && c <= 0x9F);
}


x86 assembly (clang, -O0):
<isISOControl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    1129 <isISOControl+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x1f,%ecx
mov    %al,-0x2(%rbp)
jle    1150 <isISOControl+0x50>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7f,%ecx
mov    %al,-0x3(%rbp)
jl     114a <isISOControl+0x4a>
movzbl -0x1(%rbp),%eax
cmp    $0x9f,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isISOControl>:
lea    -0x1(%rdi),%eax
cmp    $0x1f,%al
setb   %al
add    $0x81,%dil
cmp    $0x21,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isISOControl(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 31
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 127
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 159
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isISOControl(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 31
%4 = add i8 %0, -127
%5 = icmp ult i8 %4, 33
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __puts(char const *);
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  __puts(s);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <__puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__puts(i8* %3)
%5 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @__puts(i8* %0)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void rop3_220_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_220_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_220_0_1>:
mov    %esi,%eax
not    %al
and    %dl,%al
and    (%rdi),%al
or     %sil,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_220_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = and i8 %6, %4
%8 = or i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void unix_error(char *msg) {
  fprintf(stderr, "%s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void fat_test() {}


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

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

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

LLVM IR (-O2):
define void @fat_test() {
ret void
}
/* Variables and functions */
int munmap(void *, size_t const);
int xumem_unmap_phys(void *base, const size_t size) {
  return munmap(base, size);
}


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

x86 assembly (clang, -O2):
<xumem_unmap_phys>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @xumem_unmap_phys(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
__m128i extract_quarter_2_epi16_sse2(const __m128i *const reg) {
  __m128i tmp = _mm_unpacklo_epi32(*reg, *reg);
  return _mm_unpackhi_epi64(tmp, tmp);
}


x86 assembly (clang, -O0):
<extract_quarter_2_epi16_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <_mm_unpackhi_epi64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_quarter_2_epi16_sse2>:
push   %rax
mov    (%rdi),%edi
mov    %edi,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <_mm_unpackhi_epi64@plt>

LLVM IR (-O0):
define i32 @extract_quarter_2_epi16_sse2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @_mm_unpacklo_epi32(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @_mm_unpackhi_epi64(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @extract_quarter_2_epi16_sse2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @_mm_unpacklo_epi32(i32 %2, i32 %2)
%4 = tail call i32 @_mm_unpackhi_epi64(i32 %3, i32 %3)
ret i32 %4
}