xunge/DecIR huggingface dataset:
int issymbol(char ch) {
  return ch == 'A' || ch == 'C' || ch == 'G' || ch == 'T' || ch == 'N' ||
         ch == '.' || ch == '-';
}


x86 assembly (clang, -O0):
<issymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x43,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x47,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x54,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4e,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     1183 <issymbol+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issymbol>:
lea    -0x2e(%rdi),%ecx
cmp    $0x26,%cl
ja     1121 <issymbol+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x4102280001,%rdx
bt     %rcx,%rdx
jae    1121 <issymbol+0x21>
ret
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @issymbol(i8 signext %0) {
switch i8 %0, label %2 [
i8 84, label %5
i8 78, label %5
i8 71, label %5
i8 67, label %5
i8 65, label %5
i8 46, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 45
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
int loc_batch__() { return !isatty(0); }


x86 assembly (clang, -O0):
<loc_batch__>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loc_batch__>:
push   %rax
xor    %edi,%edi
call   1030 <isatty@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @loc_batch__() {
%1 = call i32 @isatty(i32 0)
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @loc_batch__() {
%1 = tail call i32 @isatty(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int *a, *b, *c;
  b = (int *)malloc(sizeof(int));
  c = (int *)malloc(sizeof(int));
  a = c;
  free(a);
  free(b);
  free(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %7
%11 = call i64 @malloc(i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %8
store i32* %13, i32** %6
%14 = load i32*, i32** %6
%15 = call i32 @free(i32* %14)
%16 = load i32*, i32** %7
%17 = call i32 @free(i32* %16)
%18 = load i32*, i32** %8
%19 = call i32 @free(i32* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @free(i32* %6)
%8 = tail call i32 @free(i32* %4)
%9 = tail call i32 @free(i32* %6)
ret i32 0
}
int length(char s[100]) {
  int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
char *strcpy(char *dest, const char *src) {
  char *i = dest;
  char *j = (char *)src;
  while (*j) {
    *i = *j;
    i++;
    j++;
  }
  *(++i) = 0x0;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strcpy+0x52>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <strcpy+0x1c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,0x1(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 0, i8* %15
ret i8* %0
}
/* Variables and functions */
const bool is_space(char c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_space+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void one() {
  int a = 5;
  int *p = &a;
  int b = *p;
  *p = 9;
  printf("p = %p, &a = %p, &p = %p\n", p, &a, &p);
  printf("a = %d, b = %d\n", a, b);
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xebb(%rip),%rdi
lea    -0x4(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdx
mov    %rdx,0x10(%rsp)
movl   $0x9,0xc(%rsp)
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rcx
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xed3(%rip),%rdi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"p = %p, &a = %p, &p = %p\0A\00"
@.str.1 = [16 x i8] c"a = %d, b = %d\0A\00"
define void @one() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 5, i32* %1
store i32* %1, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32*, i32** %2
store i32 9, i32* %6
%7 = load i32*, i32** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %1, i32** %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"p = %p, &a = %p, &p = %p\0A\00"
@.str.1 = [16 x i8] c"a = %d, b = %d\0A\00"
define void @one() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
store i32 9, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %1, i32** %2)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atomic_add(unsigned char volatile *, char);
void atomic_add_char(volatile unsigned char *target, signed char delta) {
  atomic_add(target, delta);
}


x86 assembly (clang, -O0):
<atomic_add_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <atomic_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add_char>:
jmp    1030 <atomic_add@plt>

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

LLVM IR (-O2):
define void @atomic_add_char(i8* %0, i8 signext %1) {
%3 = tail call i32 @atomic_add(i8* %0, i8 signext %1)
ret void
}
void foo(int n, int i) {
  int A[n];
#pragma omp parallel sections lastprivate(A)
  { A[i] = 1; }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x8(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 1, i32* %13
%14 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int _alphasort(const struct dirent **a, const struct dirent **b) {
  return strcoll((*a)->d_name, (*b)->d_name);
}


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

x86 assembly (clang, -O2):
<_alphasort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @_alphasort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcoll(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @_alphasort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcoll(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
long double expm1(double);
__attribute__((weak)) long double expm1l(long double x) {
  return expm1((double)x);
}


x86 assembly (clang, -O0):
<expm1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <expm1@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1l>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <expm1@plt>

LLVM IR (-O0):
define weak x86_fp80 @expm1l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @expm1(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @expm1l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @expm1(double %2)
ret x86_fp80 %3
}
void Draco9210ToggleClock() {}


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

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

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

LLVM IR (-O2):
define void @Draco9210ToggleClock() {
ret void
}
/* Variables and functions */
unsigned int cnfFptr(void *);
void *cnfMalloc(size_t);
void getmem_(unsigned int *const ptr, int *const n) {

  void *temp;
  temp = cnfMalloc((size_t)(*n));
  *ptr = cnfFptr(temp);
}


x86 assembly (clang, -O0):
<getmem_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rdi
call   1040 <cnfMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <cnfFptr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmem_>:
push   %rbx
mov    %rdi,%rbx
movslq (%rsi),%rdi
call   1040 <cnfMalloc@plt>
mov    %rax,%rdi
call   1030 <cnfFptr@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @getmem_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = call i8* @cnfMalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @cnfFptr(i8* %10)
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @getmem_(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = tail call i8* @cnfMalloc(i64 %4)
%6 = tail call i32 @cnfFptr(i8* %5)
store i32 %6, i32* %0
ret void
}
int clip_range(int a, int low, int high) {
  if (a < low)
    return low;
  if (a > high)
    return high;
  return a;
}


x86 assembly (clang, -O0):
<clip_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clip_range+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip_range+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clip_range+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clip_range+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip_range>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void xrep_failure(struct xfs_mount *mp) {}


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

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

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

LLVM IR (-O2):
%struct.xfs_mount = type opaque
define void @xrep_failure(%struct.xfs_mount* nocapture %0) {
ret void
}
void main(int n) {
  int k = 1;
  int i = 1;
  int j = 0;
  while (i <= n - 1) {
    if (k <= i - 1)
    ERROR:;
      j = 0;
    while (j <= i - 1) {
      k += (i - j);
      j++;
    }
    if (j < i)
      return;
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1199 <main+0x99>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1148 <main+0x48>
jmp    1143 <main+0x43>
jmp    1148 <main+0x48>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     117a <main+0x7a>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <main+0x4f>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118b <main+0x8b>
jmp    1199 <main+0x99>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <main+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %37, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = icmp sle i32 %7, %9
br i1 %10, label %11, label %40
11: ; preds = %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = icmp sle i32 %12, %14
br i1 %15, label %16, label %18
16: ; preds = %11
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17, %11
store i32 0, i32* %5
br label %19
19: ; preds = %24, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %32
24: ; preds = %19
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, %27
store i32 %29, i32* %3
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %19
32: ; preds = %19
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %37
36: ; preds = %32
br label %40
37: ; preds = %32
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %6
40: ; preds = %36, %6
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long next_square_num();
void next_square_num_test(void) {
  long num = 0;
  for (size_t i = 0; i < 10; i++)
    num = next_square_num();
  assert(num == 100);
}


x86 assembly (clang, -O0):
<next_square_num_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jae    115f <next_square_num_test+0x3f>
mov    $0x0,%al
call   1040 <next_square_num@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <next_square_num_test+0x18>
cmpq   $0x64,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_square_num_test>:
push   %rax
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %eax,%eax
call   1040 <next_square_num@plt>
xor    %edi,%edi
cmp    $0x64,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @next_square_num_test() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i64 (...) @next_square_num()
store i64 %7, i64* %1
br label %8
8: ; preds = %6
%9 = load i64, i64* %2
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
%12 = load i64, i64* %1
%13 = icmp eq i64 %12, 100
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @next_square_num_test() {
%1 = tail call i64 (...) @next_square_num()
%2 = tail call i64 (...) @next_square_num()
%3 = tail call i64 (...) @next_square_num()
%4 = tail call i64 (...) @next_square_num()
%5 = tail call i64 (...) @next_square_num()
%6 = tail call i64 (...) @next_square_num()
%7 = tail call i64 (...) @next_square_num()
%8 = tail call i64 (...) @next_square_num()
%9 = tail call i64 (...) @next_square_num()
%10 = tail call i64 (...) @next_square_num()
%11 = icmp eq i64 %10, 100
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Type definitions */
struct cyclist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cyclist_swap(struct cyclist **, struct cyclist **);
void cyclist_cswap(struct cyclist *x, struct cyclist *y) {
  cyclist_swap(&x, &y);
}


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

x86 assembly (clang, -O2):
<cyclist_cswap>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <cyclist_swap@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.cyclist = type { i32 }
define void @cyclist_cswap(%struct.cyclist* %0, %struct.cyclist* %1) {
%3 = alloca %struct.cyclist*
%4 = alloca %struct.cyclist*
store %struct.cyclist* %0, %struct.cyclist** %3
store %struct.cyclist* %1, %struct.cyclist** %4
%5 = call i32 @cyclist_swap(%struct.cyclist** %3, %struct.cyclist** %4)
ret void
}

LLVM IR (-O2):
%struct.cyclist = type { i32 }
define void @cyclist_cswap(%struct.cyclist* %0, %struct.cyclist* %1) {
%3 = alloca %struct.cyclist*
%4 = alloca %struct.cyclist*
store %struct.cyclist* %0, %struct.cyclist** %3
store %struct.cyclist* %1, %struct.cyclist** %4
%5 = call i32 @cyclist_swap(%struct.cyclist** %3, %struct.cyclist** %4)
ret void
}
void DefHashInit(void) {}


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

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

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

LLVM IR (-O2):
define void @DefHashInit() {
ret void
}
int clzll(const unsigned long long mask) { return __builtin_clzll(mask); }


x86 assembly (clang, -O0):
<clzll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clzll>:
bsr    %rdi,%rax
xor    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @clzll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @clzll(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int quotient(int dividend, int divisor) {
  if (dividend >= divisor)
    return 1 + quotient(dividend - dividend, divisor);
  return 0;
}


x86 assembly (clang, -O0):
<quotient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1143 <quotient+0x33>
mov    -0x8(%rbp),%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <quotient@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <quotient+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotient>:
xor    %eax,%eax
cmp    %esi,%edi
jl     1117 <quotient+0x17>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
test   %esi,%esi
jle    1110 <quotient+0x10>
ret

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

LLVM IR (-O2):
define i32 @quotient(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br label %6
6: ; preds = %6, %4
%7 = phi i32 [ 1, %4 ], [ %8, %6 ]
%8 = add nuw nsw i32 %7, 1
br i1 %5, label %9, label %6
9: ; preds = %6, %2
%10 = phi i32 [ 0, %2 ], [ %7, %6 ]
ret i32 %10
}
int is_prime(int p[], int n) {
  int i;
  if (n == 1)
    return 0;
  for (i = 0; p[i] != 0; i++) {
    if (p[i] == n)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1121 <is_prime+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1174 <is_prime+0x74>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     116d <is_prime+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    115a <is_prime+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <is_prime+0x74>
jmp    115f <is_prime+0x5f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <is_prime+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x1,%esi
je     112e <is_prime+0x2e>
mov    (%rdi),%ecx
test   %ecx,%ecx
je     112e <is_prime+0x2e>
add    $0x4,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %esi,%ecx
je     112f <is_prime+0x2f>
mov    (%rdi),%ecx
add    $0x4,%rdi
test   %ecx,%ecx
jne    1120 <is_prime+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %11
7: ; preds = %11
%8 = getelementptr inbounds i32, i32* %0, i64 %15
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %4, %7
%12 = phi i64 [ %15, %7 ], [ 0, %4 ]
%13 = phi i32 [ %9, %7 ], [ %5, %4 ]
%14 = icmp eq i32 %13, %1
%15 = add nuw i64 %12, 1
br i1 %14, label %16, label %7
16: ; preds = %11, %7, %4, %2
%17 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %11 ], [ 0, %7 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ GP_break40();
int /*<<< orphan*/ MP_motor(int, int);
void MP_prozess4(void) {
  while (1) {
    GP_break40();
    MP_motor(3, 1);
  };
}


x86 assembly (clang, -O0):
<MP_prozess4>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <MP_prozess4+0x9>
mov    $0x0,%al
call   1030 <GP_break40@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <MP_motor@plt>
jmp    1129 <MP_prozess4+0x9>

x86 assembly (clang, -O2):
<MP_prozess4>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <GP_break40@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <MP_motor@plt>
jmp    1130 <MP_prozess4+0x10>

LLVM IR (-O0):
define void @MP_prozess4() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @GP_break40()
%3 = call i32 @MP_motor(i32 3, i32 1)
br label %1
}

LLVM IR (-O2):
define void @MP_prozess4() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @GP_break40()
%3 = tail call i32 @MP_motor(i32 3, i32 1)
br label %1
}
int find(int a[], int n, int val) {
  int i, true = 0;
  for (i = 0; i < n; i++)
    if (a[i] == val) {
      true = 1;
      return i;
    }
  if (true == 0)
    return -1;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1161 <find+0x61>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    114e <find+0x4e>
movl   $0x1,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <find+0x72>
jmp    1153 <find+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <find+0x1c>
cmpl   $0x0,-0x20(%rbp)
jne    1172 <find+0x72>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <find+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <find+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %9
store i32 0, i32* %8
br label %10
10: ; preds = %25, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
store i32 1, i32* %9
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %32
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %10
28: ; preds = %10
%29 = load i32, i32* %9
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 -1, i32* %4
br label %32
32: ; preds = %22, %31, %28
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @find(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int test_imm_0Cint8_reg(signed char val) {
  return ((val) & (-0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cint8_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, -12
%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_0Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -12
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ module_locate(char *);
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  pthread_mutex_t m;
  pthread_mutex_init(&m, NULL);
  module_locate("./");
  pthread_mutex_destroy(&m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
lea    0xea6(%rip),%rdi
call   1050 <module_locate@plt>
lea    -0x14(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pthread_mutex_init@plt>
lea    0xeb5(%rip),%rdi
call   1050 <module_locate@plt>
mov    %rbx,%rdi
call   1030 <pthread_mutex_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @pthread_mutex_init(i32* %6, i32* null)
%8 = call i32 @module_locate(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @pthread_mutex_destroy(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @pthread_mutex_init(i32* %3, i32* null)
%6 = call i32 @module_locate(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @pthread_mutex_destroy(i32* %3)
ret i32 0
}
int XmodeFbTiming(struct xtiming *t) { return (0); }


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

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

LLVM IR (-O0):
%struct.xtiming = type opaque
define i32 @XmodeFbTiming(%struct.xtiming* %0) {
%2 = alloca %struct.xtiming*
store %struct.xtiming* %0, %struct.xtiming** %2
ret i32 0
}

LLVM IR (-O2):
%struct.xtiming = type opaque
define i32 @XmodeFbTiming(%struct.xtiming* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (x > y) {
    x = x - y;
    y = __VERIFIER_nondet_int();
    if (y < 1 || y > 2) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1170 <main+0x60>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1166 <main+0x56>
cmpl   $0x2,-0xc(%rbp)
jle    116b <main+0x5b>
jmp    1170 <main+0x60>
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sub    %eax,%ebx
jle    1145 <main+0x35>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
add    $0xfffffffd,%ecx
cmp    $0xfffffffd,%ecx
ja     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %3
3: ; preds = %7, %0
%4 = phi i32 [ %1, %0 ], [ %8, %7 ]
%5 = phi i32 [ %2, %0 ], [ %9, %7 ]
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = sub nsw i32 %4, %5
%9 = tail call i32 (...) @__VERIFIER_nondet_int()
%10 = add i32 %9, -3
%11 = icmp ult i32 %10, -2
br i1 %11, label %12, label %3
12: ; preds = %7, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_material_name(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_material_name_(char matname[]) {
  char name[10];
  strncpy(name, matname, 8);
  *(name + 8) = '\0';
  gmvwrite_material_name(name);
}


x86 assembly (clang, -O0):
<fgmvwrite_material_name_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1040 <gmvwrite_material_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_material_name_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    %rbx,%rdi
call   1040 <gmvwrite_material_name@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fgmvwrite_material_name_(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @gmvwrite_material_name(i8* %9)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_material_name_(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @gmvwrite_material_name(i8* %3)
ret void
}
signed char UART_get(void) {
  if ((*((volatile unsigned char *)0xE000C014)) & 0x01)
    return (*((volatile unsigned char *)0xE000C000));
  return -1;
}


x86 assembly (clang, -O0):
<UART_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1129 <UART_get+0x29>
mov    $0xe000c000,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    112d <UART_get+0x2d>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_get>:
mov    $0xe000c000,%ecx
mov    $0xff,%al
testb  $0x1,0x14(%rcx)
je     110f <UART_get+0xf>
mov    (%rcx),%al
ret

LLVM IR (-O0):
define signext i8 @UART_get() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
store i8 %7, i8* %1
br label %9
8: ; preds = %0
store i8 -1, i8* %1
br label %9
9: ; preds = %8, %6
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @UART_get() {
%1 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%2 = and i8 %1, 1
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
br label %6
6: ; preds = %0, %4
%7 = phi i8 [ %5, %4 ], [ -1, %0 ]
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(short *, int, int, int /*<<< orphan*/ *);
short fget_short(FILE *file) {
  short ret;
  fread(&ret, sizeof(short), 1, file);
  return ret;
}


x86 assembly (clang, -O0):
<fget_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_short>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @fget_short(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i16* %3, i32 2, i32 1, i32* %4)
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @fget_short(i32* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @fread(i16* %2, i32 2, i32 1, i32* %0)
%5 = load i16, i16* %2
ret i16 %5
}