xunge/DecIR huggingface dataset:
unsigned char convert(unsigned char c) {
  switch (c) {
  case 'A':
    return 1;
    break;
  case 'B':
    return 2;
    break;
  case 'C':
    return 4;
    break;
  case 'D':
    return 8;
    break;
  case 'E':
    return 16;
    break;
  case 'F':
    return 32;
    break;
  case 'G':
    return 64;
    break;
  case 'H':
    return 128;
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     117c <convert+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x2,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x4,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x8,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x10,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x20,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x40,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x80,-0x1(%rbp)
jmp    1180 <convert+0x80>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
add    $0xbf,%dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%ecx
movabs $0x8040201008040201,%rax
20 40 80
shr    %cl,%rax
xor    %ecx,%ecx
cmp    $0x8,%dl
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @convert(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %14 [
i32 65, label %6
i32 66, label %7
i32 67, label %8
i32 68, label %9
i32 69, label %10
i32 70, label %11
i32 71, label %12
i32 72, label %13
]
6: ; preds = %1
store i8 1, i8* %2
br label %15
7: ; preds = %1
store i8 2, i8* %2
br label %15
8: ; preds = %1
store i8 4, i8* %2
br label %15
9: ; preds = %1
store i8 8, i8* %2
br label %15
10: ; preds = %1
store i8 16, i8* %2
br label %15
11: ; preds = %1
store i8 32, i8* %2
br label %15
12: ; preds = %1
store i8 64, i8* %2
br label %15
13: ; preds = %1
store i8 -128, i8* %2
br label %15
14: ; preds = %1
store i8 0, i8* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @convert(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 8
%4 = zext i8 %2 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = lshr i64 -9205322385119247871, %5
%7 = trunc i64 %6 to i8
%8 = select i1 %3, i8 %7, i8 0
ret i8 %8
}
void cpsw_halcommon_mii_mdio_getver(unsigned int miibase, unsigned int *mod_id,
                                    unsigned int *rev_maj,
                                    unsigned int *rev_min) {
  unsigned int ver;
  ver = (*(((volatile unsigned int *)(miibase + 0x00))));
  *mod_id = (ver & (0xFFFF << 16)) >> 16;
  *rev_maj = (ver & (0xFF << 8)) >> 8;
  *rev_min = (ver & (0xFF));
}


x86 assembly (clang, -O0):
<cpsw_halcommon_mii_mdio_getver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
and    $0xffff0000,%ecx
shr    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
and    $0xff,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpsw_halcommon_mii_mdio_getver>:
push   %rbx
mov    %edi,%eax
mov    (%rax),%eax
movzbl %ah,%ebx
movzbl %al,%edi
shr    $0x10,%eax
mov    %eax,(%rsi)
mov    %ebx,(%rdx)
mov    %edi,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpsw_halcommon_mii_mdio_getver(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = add i32 %10, 0
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = and i32 %15, -65536
%17 = lshr i32 %16, 16
%18 = load i32*, i32** %6
store i32 %17, i32* %18
%19 = load i32, i32* %9
%20 = and i32 %19, 65280
%21 = lshr i32 %20, 8
%22 = load i32*, i32** %7
store i32 %21, i32* %22
%23 = load i32, i32* %9
%24 = and i32 %23, 255
%25 = load i32*, i32** %8
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @cpsw_halcommon_mii_mdio_getver(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = zext i32 %0 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = lshr i32 %7, 16
store i32 %8, i32* %1
%9 = lshr i32 %7, 8
%10 = and i32 %9, 255
store i32 %10, i32* %2
%11 = and i32 %7, 255
store i32 %11, i32* %3
ret void
}
const char *_yes_no(int i) { return i > 0 ? "yes" : i < 0 ? "unknown" : "no"; }


x86 assembly (clang, -O0):
<_yes_no>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1121 <_yes_no+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    113d <_yes_no+0x3d>
mov    -0x4(%rbp),%edx
lea    0xee1(%rip),%rax
lea    0xed2(%rip),%rcx
cmp    $0x0,%edx
cmovl  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_yes_no>:
test   %edi,%edi
lea    0xf03(%rip),%rax
lea    0xef4(%rip),%rcx
cmove  %rax,%rcx
lea    0xee5(%rip),%rax
cmovle %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [8 x i8] c"unknown\00"
@.str.2 = [3 x i8] c"no\00"
define i8* @_yes_no(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %11
11: ; preds = %6, %5
%12 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %5 ], [ %10, %6 ]
ret i8* %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [8 x i8] c"unknown\00"
@.str.2 = [3 x i8] c"no\00"
define i8* @_yes_no(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
/* Variables and functions */
int const _isnan(double);
const int wIsnan(double n) { return _isnan(n); }


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

x86 assembly (clang, -O2):
<wIsnan>:
jmp    1030 <_isnan@plt>

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

LLVM IR (-O2):
define i32 @wIsnan(double %0) {
%2 = tail call i32 @_isnan(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ setTLB(int, unsigned int, int /*<<< orphan*/);
void flushTLB(void) {
  unsigned int invalPage;
  int i;
  invalPage = 0xC0000000;
  for (i = 0; i < 32; i++) {
    setTLB(i, invalPage, 0);
    invalPage += (1 << 12);
  }
}


x86 assembly (clang, -O0):
<flushTLB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc0000000,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1156 <flushTLB+0x46>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
xor    %edx,%edx
call   1030 <setTLB@plt>
mov    -0x4(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <flushTLB+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushTLB>:
push   %rbp
push   %rbx
push   %rax
mov    $0xc0000000,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <setTLB@plt>
add    $0x1000,%ebx
add    $0x1,%ebp
cmp    $0xc0020000,%ebx
jne    1120 <flushTLB+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @flushTLB() {
%1 = alloca i32
%2 = alloca i32
store i32 -1073741824, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @setTLB(i32 %7, i32 %8, i32 0)
%10 = load i32, i32* %1
%11 = add i32 %10, 4096
store i32 %11, i32* %1
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @flushTLB() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ -1073741824, %0 ], [ %5, %1 ]
%4 = tail call i32 @setTLB(i32 %2, i32 %3, i32 0)
%5 = add nuw nsw i32 %3, 4096
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %1
8: ; preds = %1
ret void
}
int bar(int x) { return (x << 2) | 3; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
or     $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0x3(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = or i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = shl i32 %0, 2
%3 = or i32 %2, 3
ret i32 %3
}
void freeArray(char **array) {
  char **iter = array;
  while (*iter != 0) {
    free(*iter);
    iter++;
  }
  free(array);
}


x86 assembly (clang, -O0):
<freeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <freeArray+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <freeArray+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArray>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeArray+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeArray+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeArray(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 = %9, %1
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %3
br label %5
14: ; preds = %5
%15 = load i8**, i8*** %2
%16 = bitcast i8** %15 to i8*
ret void
}

LLVM IR (-O2):
define void @freeArray(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
tail call void @free(i8* %5)
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = bitcast i8** %0 to i8*
tail call void @free(i8* %11)
ret void
}
void proc38() {}


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

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

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

LLVM IR (-O2):
define void @proc38() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gcd(int, int);
bool coprime(int a, int b) {
  assert(a > 0);
  assert(b > 0);
  return (gcd(a, b) == 1);
}


x86 assembly (clang, -O0):
<coprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <gcd@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coprime>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
test   %ebp,%ebp
setg   %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <gcd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @coprime(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 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @gcd(i32 %13, i32 %14)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @coprime(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i32 %1, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @gcd(i32 %0, i32 %1)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
void glutMainLoop(void) {}


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

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

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

LLVM IR (-O2):
define void @glutMainLoop() {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *__asctime(struct tm const *, char *);
char *asctime_r(const struct tm *restrict tm, char *restrict buf) {
  return __asctime(tm, buf);
}


x86 assembly (clang, -O0):
<asctime_r>:
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 <__asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctime_r>:
jmp    1030 <__asctime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @asctime_r(%struct.tm* noalias %0, i8* noalias %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%5 = load %struct.tm*, %struct.tm** %3
%6 = load i8*, i8** %4
%7 = call i8* @__asctime(%struct.tm* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @asctime_r(%struct.tm* noalias %0, i8* noalias %1) {
%3 = tail call i8* @__asctime(%struct.tm* %0, i8* %1)
ret i8* %3
}
justleft(p, q, limit) char *p;
char *q;
int limit;
{
  q = &q[limit];
  while (*p != '\0')
    *q++ = *p++;
}


x86 assembly (clang, -O0):
<justleft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <justleft+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    111e <justleft+0x1e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<justleft>:
mov    (%rdi),%al
test   %al,%al
je     1120 <justleft+0x20>
movslq %edx,%rcx
add    %rcx,%rsi
xor    %ecx,%ecx
xchg   %ax,%ax
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <justleft+0x10>
ret

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

LLVM IR (-O2):
define i32 @justleft(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
br label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %4, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
%12 = phi i8* [ %14, %9 ], [ %8, %6 ]
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %10, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %3
ret i32 undef
}
__attribute((always_)) void c(int vm[2][2]) {}


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

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

LLVM IR (-O0):
define void @c([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @c([2 x i32]* nocapture %0) {
ret void
}
/* Variables and functions */
int mainMenu();
int main(int argc, char *argv[]) {
  while (mainMenu() != 4)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <mainMenu@plt>
cmp    $0x4,%eax
je     113b <main+0x2b>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mainMenu@plt>
cmp    $0x4,%eax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %9, %2
%7 = call i32 (...) @mainMenu()
%8 = icmp ne i32 %7, 4
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @mainMenu()
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 0
}
/* Variables and functions */
char *csv_get_field_string(char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ sscanf(char const *, char *, double *);
char *strdup(char const *);
double csv_get_field_double(const char *line, int num) {
  double result;
  char *tmp_str = strdup(line);
  const char *field = csv_get_field_string(tmp_str, num);
  sscanf(field, "%lf", &result);
  free(tmp_str);
  return result;
}


x86 assembly (clang, -O0):
<csv_get_field_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <csv_get_field_string@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_get_field_double>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <csv_get_field_string@plt>
lea    0xea2(%rip),%rsi
mov    %rsp,%rdx
mov    %rax,%rdi
call   1040 <sscanf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define double @csv_get_field_double(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i32, i32* %4
%12 = call i8* @csv_get_field_string(i8* %10, i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
%17 = load double, double* %5
ret double %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define double @csv_get_field_double(i8* nocapture %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = tail call i8* @strdup(i8* %0)
%6 = tail call i8* @csv_get_field_string(i8* %5, i32 %1)
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%8 = call i32 @free(i8* %5)
%9 = load double, double* %3
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void looptrouble() {
  void *head = 0;
loop : {
  void *x = head;
  if (head != 0) {
    assert(head != &x);
  }
  head = &x;
  goto loop;
}
}


x86 assembly (clang, -O0):
<looptrouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <looptrouble+0x3b>
mov    -0x8(%rbp),%rax
lea    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <looptrouble+0x10>

x86 assembly (clang, -O2):
<looptrouble>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
lea    0x8(%rsp),%rbx
jmp    1123 <looptrouble+0x13>
xchg   %ax,%ax
mov    %rbx,%rax
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1120 <looptrouble+0x10>
xor    %edi,%edi
cmp    %rbx,%rax
setne  %dil
call   1030 <assert@plt>
jmp    1120 <looptrouble+0x10>

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

LLVM IR (-O2):
define void @looptrouble() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
br label %3
3: ; preds = %10, %0
%4 = phi i8* [ null, %0 ], [ %2, %10 ]
store i8* %4, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = icmp ne i8* %4, %2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
br label %10
10: ; preds = %6, %3
br label %3
}
const char *scamper_do_neighbourdisc_usage(void) {
  return "neighbourdisc [-FQ] [-i if] [-o replyc] [-q attempts] [-S srcaddr] "
         "[-w wait]\n";
}


x86 assembly (clang, -O0):
<scamper_do_neighbourdisc_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scamper_do_neighbourdisc_usage>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [78 x i8] c"neighbourdisc [-FQ] [-i if] [-o replyc] [-q attempts] [-S srcaddr] [-w wait]\0A\00"
define i8* @scamper_do_neighbourdisc_usage() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [78 x i8] c"neighbourdisc [-FQ] [-i if] [-o replyc] [-q attempts] [-S srcaddr] [-w wait]\0A\00"
define i8* @scamper_do_neighbourdisc_usage() {
ret i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0)
}
int *hop(int *elem) { return *elem + elem; }


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hop>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @hop(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
ret i32* %7
}

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
int nest2() { return 25; }


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

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

LLVM IR (-O0):
define i32 @nest2() {
ret i32 25
}

LLVM IR (-O2):
define i32 @nest2() {
ret i32 25
}
/* Variables and functions */
int /*<<< orphan*/ ds_set_int(int /*<<< orphan*/, int, int);
void snmp_set_suffix_only(int x) { ds_set_int(0, 4, x); }


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

x86 assembly (clang, -O2):
<snmp_set_suffix_only>:
mov    %edi,%edx
xor    %edi,%edi
mov    $0x4,%esi
jmp    1030 <ds_set_int@plt>

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

LLVM IR (-O2):
define void @snmp_set_suffix_only(i32 %0) {
%2 = tail call i32 @ds_set_int(i32 0, i32 4, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *mempcpy(char *, char *, int);
void test2(char *ptr) {
  if (mempcpy(ptr, ptr, 8) != ptr + 8)
    abort();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <mempcpy@plt>
mov    -0x8(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
je     1156 <test2+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    $0x8,%edx
call   1040 <mempcpy@plt>
add    $0x8,%rbx
cmp    %rbx,%rax
jne    113c <test2+0x1c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @mempcpy(i8* %3, i8* %4, i32 8)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = icmp ne i8* %5, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @test2(i8* %0) {
%2 = tail call i8* @mempcpy(i8* %0, i8* %0, i32 8)
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = icmp eq i8* %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ epur_str(char *);
int /*<<< orphan*/ ft_putchar(char);
int main(int ac, char **av) {
  if (ac == 2) {
    epur_str(av[1]);
  }
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    114d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <epur_str@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1040 <epur_str@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @epur_str(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @epur_str(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
void *buffered_random_open(void *data) { return data; }


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

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

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

LLVM IR (-O2):
define i8* @buffered_random_open(i8* readnone returned %0) {
ret i8* %0
}
void psync_fs_refresh() {}


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

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

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

LLVM IR (-O2):
define void @psync_fs_refresh() {
ret void
}
int fromHex(char x) {
  if (x >= '0' && x <= '9')
    return x - '0';
  else
    return x - 'a' + 10;
}


x86 assembly (clang, -O0):
<fromHex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <fromHex+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <fromHex+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <fromHex+0x40>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromHex>:
lea    -0x30(%rdi),%ecx
lea    -0x57(%rdi),%edx
lea    -0x30(%rdi),%eax
cmp    $0xa,%cl
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @fromHex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %20
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 97
%19 = add nsw i32 %18, 10
store i32 %19, i32* %2
br label %20
20: ; preds = %15, %11
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @fromHex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = select i1 %4, i32 -48, i32 -87
%6 = add nsw i32 %5, %2
ret i32 %6
}
void foo_1_2_1_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_2_2_2_1_1() {
ret void
}
int test_imm_65int16_reg(short val) {
  return ((val) & (-0x65 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_65int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -101
%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_65int16_reg(i16 signext %0) {
%2 = and i16 %0, -101
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
cbuf14(f, n) { return (cbuf(f, n, 14)); }


x86 assembly (clang, -O0):
<cbuf14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xe,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf14>:
mov    $0xe,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf14(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 14)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf14(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 14)
ret i32 %3
}
/* Variables and functions */
void map_par(int (*work)(int), int *arr, int *out, size_t n) {
#pragma omp parallel for
  for (size_t i = 0; i < n; i++) {
    out[i] = work(arr[i]);
  }
}


x86 assembly (clang, -O0):
<map_par>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115d <map_par+0x5d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <map_par+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_par>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rcx,%rcx
je     1134 <map_par+0x34>
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edi
call   *%r13
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <map_par+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @map_par(i32 (i32)* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %4
ret void
7: ; preds = %4, %7
%8 = phi i64 [ %13, %7 ], [ 0, %4 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 %0(i32 %10)
%12 = getelementptr inbounds i32, i32* %2, i64 %8
store i32 %11, i32* %12
%13 = add nuw i64 %8, 1
%14 = icmp eq i64 %13, %3
br i1 %14, label %6, label %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void uDMAControlBaseSet(void *psControlTable) {
  ASSERT(((uint32_t)psControlTable & ~0x3FF) == (uint32_t)psControlTable);
  ASSERT((uint32_t)psControlTable >= 0x20000000);
  (*((volatile uint32_t *)(0x400FF008))) = (uint32_t)psControlTable;
}


x86 assembly (clang, -O0):
<uDMAControlBaseSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffc00,%eax
mov    -0x8(%rbp),%rcx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%rax
cmp    $0x20000000,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x400ff008,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAControlBaseSet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0x3ff,%ebx
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x20000000,%ebx
setge  %dil
call   1030 <ASSERT@plt>
mov    %ebx,0x400ff008
pop    %rbx
ret

LLVM IR (-O0):
define void @uDMAControlBaseSet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = and i32 %4, -1024
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %11 to i32
%13 = icmp sge i32 %12, 536870912
%14 = zext i1 %13 to i32
%15 = call i32 @ASSERT(i32 %14)
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %16 to i32
store volatile i32 %17, i32* inttoptr (i64 1074786312 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAControlBaseSet(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = and i32 %3, -1024
%5 = icmp eq i32 %4, %3
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = icmp sgt i32 %3, 536870911
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
store volatile i32 %3, i32* inttoptr (i64 1074786312 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replay_play();
int /*<<< orphan*/ replay_route();
void music_isr(void) {
  replay_route();
  replay_play();
}


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

x86 assembly (clang, -O2):
<music_isr>:
push   %rax
xor    %eax,%eax
call   1030 <replay_route@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <replay_play@plt>

LLVM IR (-O0):
define void @music_isr() {
%1 = call i32 (...) @replay_route()
%2 = call i32 (...) @replay_play()
ret void
}

LLVM IR (-O2):
define void @music_isr() {
%1 = tail call i32 (...) @replay_route()
%2 = tail call i32 (...) @replay_play()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c2b_set_close_exec_flag(int);
int pipe(int *);
int c2b_pipe4(int fd[2], int flags) {
  int ret = pipe(fd);
  if (flags & (1U << 0)) {
    c2b_set_close_exec_flag(fd[0]);
  }
  if (flags & (1U << 1)) {
    c2b_set_close_exec_flag(fd[1]);
  }
  return ret;
}


x86 assembly (clang, -O0):
<c2b_pipe4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1155 <c2b_pipe4+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <c2b_set_close_exec_flag@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1170 <c2b_pipe4+0x50>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <c2b_set_close_exec_flag@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2b_pipe4>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <pipe@plt>
mov    %eax,%r14d
test   $0x1,%bpl
je     113e <c2b_pipe4+0x1e>
mov    (%rbx),%edi
call   1040 <c2b_set_close_exec_flag@plt>
test   $0x2,%bpl
je     114c <c2b_pipe4+0x2c>
mov    0x4(%rbx),%edi
call   1040 <c2b_set_close_exec_flag@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @c2b_pipe4(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @pipe(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = call i32 @c2b_set_close_exec_flag(i32 %14)
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %4
%18 = and i32 %17, 2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = call i32 @c2b_set_close_exec_flag(i32 %23)
br label %25
25: ; preds = %20, %16
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @c2b_pipe4(i32* %0, i32 %1) {
%3 = tail call i32 @pipe(i32* %0)
%4 = and i32 %1, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %0
%8 = tail call i32 @c2b_set_close_exec_flag(i32 %7)
br label %9
9: ; preds = %6, %2
%10 = and i32 %1, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = getelementptr inbounds i32, i32* %0, i64 1
%14 = load i32, i32* %13
%15 = tail call i32 @c2b_set_close_exec_flag(i32 %14)
br label %16
16: ; preds = %12, %9
ret i32 %3
}
void foo250(int p) {}


x86 assembly (clang, -O0):
<foo250>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo250(i32 %0) {
ret void
}
/* Variables and functions */
long long binCoef(int, int);
long long checkChoose(long long m, int n) {
  for (int i = 0; i < n; ++i) {
    if (binCoef(n, i) == m)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<checkChoose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1167 <checkChoose+0x57>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <binCoef@plt>
cmp    -0x10(%rbp),%rax
jne    1154 <checkChoose+0x44>
movslq -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <checkChoose+0x5f>
jmp    1159 <checkChoose+0x49>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <checkChoose+0x16>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkChoose>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%r14
test   %esi,%esi
jle    114d <checkChoose+0x3d>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebx,%esi
call   1030 <binCoef@plt>
cmp    %r15,%rax
je     114a <checkChoose+0x3a>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <checkChoose+0x20>
jmp    114d <checkChoose+0x3d>
mov    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @checkChoose(i64 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ 0, %2 ]
%6 = tail call i64 @binCoef(i32 %1, i32 %5)
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = zext i32 %5 to i64
br label %13
10: ; preds = %4
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %10, %2, %8
%14 = phi i64 [ %9, %8 ], [ -1, %2 ], [ -1, %10 ]
ret i64 %14
}
int test_imm_ACuint16_mem(unsigned short *val) {
  return ((*val) & (-0xAC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ACuint16_mem>:
movzwl (%rdi),%eax
test   $0xff54,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -172
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int sys_mutex_lock(pthread_mutex_t *mtx) { return pthread_mutex_lock(mtx); }


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

x86 assembly (clang, -O2):
<sys_mutex_lock>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @sys_mutex_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ setbuf(int /*<<< orphan*/ *, char *);
__attribute__((__weak__, __always___)) void softboundmpx_setbuf(FILE *stream,
                                                                char *buf) {
  setbuf(stream, buf);
}


x86 assembly (clang, -O0):
<softboundmpx_setbuf>:
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 <setbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_setbuf>:
jmp    1030 <setbuf@plt>

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

LLVM IR (-O2):
define weak void @softboundmpx_setbuf(i32* %0, i8* %1) {
%3 = tail call i32 @setbuf(i32* %0, i8* %1)
ret void
}
void RTVfsObjFromFile(void) {}


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

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

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

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