xunge/DecIR huggingface dataset:
/* Variables and functions */
int INT_MAX;
int LONG_MAX;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
main(int c, char **v) {
  printf("%d\n", INT_MAX);
  printf("%ld\n", LONG_MAX);
  printf("%lld\n", LONG_MAX);
  exit(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    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rbx
mov    (%rbx),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@.str.1 = [5 x i8] c"%ld\0A\00"
@LONG_MAX = global i32 0
@.str.2 = [6 x i8] c"%lld\0A\00"
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* @INT_MAX
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @LONG_MAX
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @LONG_MAX
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@.str.1 = [5 x i8] c"%ld\0A\00"
@LONG_MAX = global i32 0
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @LONG_MAX
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @LONG_MAX
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_help_show(char *);
void roadmap_help_voice(void) { roadmap_help_show("voice"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"voice\00"
define void @roadmap_help_voice() {
%1 = call i32 @roadmap_help_show(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"voice\00"
define void @roadmap_help_voice() {
%1 = tail call i32 @roadmap_help_show(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getchar0();
int /*<<< orphan*/ putchar0(int /*<<< orphan*/);
int _read(int fd, char *ptr, int len) {
  *ptr = getchar0();
  putchar0(*ptr++);
  return 1;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getchar0@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1040 <putchar0@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <getchar0@plt>
mov    %al,(%rbx)
movsbl %al,%edi
call   1040 <putchar0@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call signext i8 (...) @getchar0()
%8 = load i8*, i8** %5
store i8 %7, i8* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %5
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @putchar0(i32 %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call signext i8 (...) @getchar0()
store i8 %4, i8* %1
%5 = sext i8 %4 to i32
%6 = tail call i32 @putchar0(i32 %5)
ret i32 1
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int clock_getres(int, struct timespec *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct timespec res;
  if (clock_getres(99999, &res) == -1) {
    printf("Test PASSED\n");
    return 0;
  }
  printf("Test FAILED\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1869f,%edi
lea    -0x8(%rbp),%rsi
call   1040 <clock_getres@plt>
cmp    $0xffffffff,%eax
jne    115e <main+0x3e>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1171 <main+0x51>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
mov    $0x1869f,%edi
call   1040 <clock_getres@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
setne  %bl
lea    0xec9(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [13 x i8] c"Test PASSED\0A\00"
@.str.1 = [13 x i8] c"Test FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = call i32 @clock_getres(i32 99999, %struct.timespec* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@str = [12 x i8] c"Test FAILED\00"
@str.2 = [12 x i8] c"Test PASSED\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @clock_getres(i32 99999, %struct.timespec* %1)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("First line...");
  sleep(3);
  printf("\nSecond Line...");
  sleep(3);
  printf("Third line\n");
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"First line...\00"
@.str.1 = [16 x i8] c"\0ASecond Line...\00"
@.str.2 = [12 x i8] c"Third line\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sleep(i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"First line...\00"
@.str.1 = [16 x i8] c"\0ASecond Line...\00"
@str = [11 x i8] c"Third line\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 3)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int reverseByte(int);
int main() {
  int a = 141;
  int c = reverseByte(a);
  printf("%d reversed should be %d\n", a, 177);
  printf("reversedByte(%d) -> %d\n", a, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8d,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <reverseByte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0xb1,%edx
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8d,%edi
call   1030 <reverseByte@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
mov    $0x8d,%esi
mov    $0xb1,%edx
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x8d,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%d reversed should be %d\0A\00"
@.str.1 = [24 x i8] c"reversedByte(%d) -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 141, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @reverseByte(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 177)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d reversed should be %d\0A\00"
@.str.1 = [24 x i8] c"reversedByte(%d) -> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @reverseByte(i32 141)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 141, i32 177)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 141, i32 %1)
ret i32 0
}
int argcv_free(int argc, char **argv) {
  while (--argc >= 0)
    if (argv[argc])
      free(argv[argc]);
  free(argv);
  return 0;
}


x86 assembly (clang, -O0):
<argcv_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jl     115a <argcv_free+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <argcv_free+0x45>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <argcv_free+0xf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argcv_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
jle    114d <argcv_free+0x3d>
mov    %edi,%ebx
add    $0x1,%rbx
jmp    113a <argcv_free+0x2a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
jbe    114d <argcv_free+0x3d>
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
test   %rdi,%rdi
je     1130 <argcv_free+0x20>
call   1030 <free@plt>
jmp    1130 <argcv_free+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @argcv_free(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ %5, %4 ], [ %8, %14 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %6
tail call void @free(i8* %11)
br label %14
14: ; preds = %13, %6
%15 = icmp ugt i64 %7, 1
br i1 %15, label %6, label %16
16: ; preds = %14, %2
%17 = bitcast i8** %1 to i8*
tail call void @free(i8* %17)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void nop() { put8(0x90); }


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
mov    $0x90,%edi
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @nop() {
%1 = call i32 @put8(i32 144)
ret void
}

LLVM IR (-O2):
define void @nop() {
%1 = tail call i32 @put8(i32 144)
ret void
}
void nocmnt(str) char *str;
{
  while (*str && (*str != ';')) {
    str++;
  }
  *str = '\0';
}


x86 assembly (clang, -O0):
<nocmnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <nocmnt+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <nocmnt+0x3d>
jmp    114e <nocmnt+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <nocmnt+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocmnt>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <nocmnt+0x11>
cmp    $0x3b,%al
je     1111 <nocmnt+0x11>
add    $0x1,%rdi
jmp    1100 <nocmnt>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @nocmnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 59
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @nocmnt(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 59, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
struct QuerySegment {
  int dummy;
};

/* Variables and functions */
struct QuerySegment *NewQuerySegment(char const *, char const *, size_t);
struct QuerySegment *qu_engine(const char *DICT_PATH, const char *HMM_PATH,
                               size_t q_max) {
  return NewQuerySegment(DICT_PATH, HMM_PATH, q_max);
}


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

x86 assembly (clang, -O2):
<qu_engine>:
jmp    1030 <NewQuerySegment@plt>

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

LLVM IR (-O2):
%struct.QuerySegment = type { i32 }
define %struct.QuerySegment* @qu_engine(i8* %0, i8* %1, i64 %2) {
%4 = tail call %struct.QuerySegment* @NewQuerySegment(i8* %0, i8* %1, i64 %2)
ret %struct.QuerySegment* %4
}
int getchar(void) {
  while (!(*(volatile unsigned int *)0xE000C014 & 0x01))
    ;
  return (*(volatile unsigned int *)0xE000C000);
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getchar+0x9>
mov    $0xe000c014,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <getchar+0x28>
jmp    112d <getchar+0x2d>
jmp    1109 <getchar+0x9>
mov    $0xe000c000,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    $0xe000c000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,0x14(%rax)
je     1110 <getchar+0x10>
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @getchar() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 3758145556 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 3758145536 to i32*)
ret i32 %8
}

LLVM IR (-O2):
define i32 @getchar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 3758145556 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 3758145536 to i32*)
ret i32 %6
}
void rop3_130_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_130_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_130_0_1>:
mov    %esi,%eax
xor    %dl,%al
not    %al
not    %sil
and    %dl,%sil
or     %al,%sil
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_130_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = xor i8 %1, -1
%8 = and i8 %7, %2
%9 = or i8 %8, %5
%10 = and i8 %9, %6
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ isolanis(int);
void isolanis_test(void **state) {
  assert_int_equal(0x0000000000000800ul, isolanis(0x000000000000C800ul));
}


x86 assembly (clang, -O0):
<isolanis_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc800,%edi
call   1040 <isolanis@plt>
mov    %eax,%esi
mov    $0x800,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isolanis_test>:
push   %rax
mov    $0xc800,%edi
call   1040 <isolanis@plt>
mov    $0x800,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @isolanis_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @isolanis(i32 51200)
%4 = call i32 @assert_int_equal(i32 2048, i32 %3)
ret void
}

LLVM IR (-O2):
define void @isolanis_test(i8** nocapture readnone %0) {
%2 = tail call i32 @isolanis(i32 51200)
%3 = tail call i32 @assert_int_equal(i32 2048, i32 %2)
ret void
}
int strdcount(char *s, char d) {
  int n = 1;
  if (*s == '\0')
    return 0;
  while (*s != '\0')
    if (*(s++) == d)
      n++;
  return n;
}


x86 assembly (clang, -O0):
<strdcount>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1131 <strdcount+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strdcount+0x78>
jmp    1136 <strdcount+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <strdcount+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    116d <strdcount+0x6d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <strdcount+0x36>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strdcount+0x26>
add    $0x1,%rdi
mov    $0x1,%eax
nop
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strdcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strdcount(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ 1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8 [ %13, %5 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = icmp eq i8 %8, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  float a[2];
  int temp;
  a[0] = -0.375f;
  temp = (int)(a[0] / 0.03125f);
  assert(temp == -12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xece(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfffffff4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x float]
%2 = alloca i32
%3 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
store float -3.750000e-01, float* %3
%4 = getelementptr inbounds [2 x float], [2 x float]* %1, i64 0, i64 0
%5 = load float, float* %4
%6 = fdiv float %5, 3.125000e-02
%7 = fptosi float %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -12
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ name;
};
typedef TYPE_1__ OBJ_NAME;

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int do_all_sorted_cmp(const void *n1_, const void *n2_) {
  const OBJ_NAME *const *n1 = n1_;
  const OBJ_NAME *const *n2 = n2_;
  return strcmp((*n1)->name, (*n2)->name);
}


x86 assembly (clang, -O0):
<do_all_sorted_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @do_all_sorted_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.TYPE_2__**
%6 = alloca %struct.TYPE_2__**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__**
store %struct.TYPE_2__** %8, %struct.TYPE_2__*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.TYPE_2__**
store %struct.TYPE_2__** %10, %struct.TYPE_2__*** %6
%11 = load %struct.TYPE_2__**, %struct.TYPE_2__*** %5
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %11
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = load %struct.TYPE_2__**, %struct.TYPE_2__*** %6
%16 = load %struct.TYPE_2__*, %struct.TYPE_2__** %15
%17 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = call i32 @strcmp(i32 %14, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define i32 @do_all_sorted_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.TYPE_2__**
%4 = bitcast i8* %1 to %struct.TYPE_2__**
%5 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.TYPE_2__*, %struct.TYPE_2__** %4
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strcmp(i32 %7, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int shutdown(int, int /*<<< orphan*/);
void closeAndShutdownSocket(int socketFd) {
  if (socketFd != -1) {
    int res = shutdown(socketFd, SHUT_RDWR);
    close(socketFd);
  }
}


x86 assembly (clang, -O0):
<closeAndShutdownSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1151 <closeAndShutdownSocket+0x31>
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeAndShutdownSocket>:
cmp    $0xffffffff,%edi
je     113e <closeAndShutdownSocket+0x1e>
push   %rbx
mov    %edi,%ebx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
ret

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @closeAndShutdownSocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SHUT_RDWR
%9 = call i32 @shutdown(i32 %7, i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @closeAndShutdownSocket(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @SHUT_RDWR
%5 = tail call i32 @shutdown(i32 %0, i32 %4)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_sub_ps(__m128 A, __m128 B) { return _mm_sub_ps(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sub_ps>:
jmp    1030 <_mm_sub_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_sub_ps(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 @_mm_sub_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sub_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_ps(i32 %0, i32 %1)
ret i32 %3
}
void blogic_inc_count(unsigned short *count) {
  if (*count < 65535)
    (*count)++;
}


x86 assembly (clang, -O0):
<blogic_inc_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
cmp    $0xffff,%eax
jge    1128 <blogic_inc_count+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%cx
add    $0x1,%cx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<blogic_inc_count>:
movzwl (%rdi),%eax
cmp    $0xffff,%ax
je     110f <blogic_inc_count+0xf>
add    $0x1,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @blogic_inc_count(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 = icmp slt i32 %5, 65535
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i16*, i16** %2
%9 = load i16, i16* %8
%10 = add i16 %9, 1
store i16 %10, i16* %8
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @blogic_inc_count(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nuw i16 %2, 1
store i16 %5, i16* %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_acl(void) {
  printf("This binary was not compiled with ACL support!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<test_acl>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"This binary was not compiled with ACL support!\0A\00"
define i32 @test_acl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [47 x i8] c"This binary was not compiled with ACL support!\00"
define i32 @test_acl() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr, "See man logrotp"
                  "\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"See man logrotp\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"See man logrotp\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char const *);
int xsfprintf(FILE *stream, const char *text) { return fprintf(stream, text); }


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

x86 assembly (clang, -O2):
<xsfprintf>:
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
define i32 @xsfprintf(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 @fprintf(i32* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xsfprintf(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
char *skip_quoted(char **, char const *, char const *);
char *skip(char **buf, const char *delimiters) {
  return skip_quoted(buf, delimiters, delimiters);
}


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

x86 assembly (clang, -O2):
<skip>:
mov    %rsi,%rdx
jmp    1030 <skip_quoted@plt>

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

LLVM IR (-O2):
define i8* @skip(i8** %0, i8* %1) {
%3 = tail call i8* @skip_quoted(i8** %0, i8* %1, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printd(char *);
void printhelp(void) {
  printd("l linemode toggle");
  printd("e echo toggle");
  printd("q quit");
  printd("h IAC TELNET hex debugging");
  printd("n NL / CRNL");
  printd("^A send ^A to remote");
}


x86 assembly (clang, -O0):
<printhelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printd@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printd@plt>
lea    0xeed(%rip),%rdi
call   1030 <printd@plt>
lea    0xee8(%rip),%rdi
call   1030 <printd@plt>
lea    0xef7(%rip),%rdi
call   1030 <printd@plt>
lea    0xef7(%rip),%rdi
call   1030 <printd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printd@plt>
lea    0xeee(%rip),%rdi
call   1030 <printd@plt>
lea    0xef0(%rip),%rdi
call   1030 <printd@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printd@plt>
lea    0xefa(%rip),%rdi
call   1030 <printd@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <printd@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"l linemode toggle\00"
@.str.1 = [14 x i8] c"e echo toggle\00"
@.str.2 = [7 x i8] c"q quit\00"
@.str.3 = [27 x i8] c"h IAC TELNET hex debugging\00"
@.str.4 = [12 x i8] c"n NL / CRNL\00"
@.str.5 = [21 x i8] c"^A send ^A to remote\00"
define void @printhelp() {
%1 = call i32 @printd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printd(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printd(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printd(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"l linemode toggle\00"
@.str.1 = [14 x i8] c"e echo toggle\00"
@.str.2 = [7 x i8] c"q quit\00"
@.str.3 = [27 x i8] c"h IAC TELNET hex debugging\00"
@.str.4 = [12 x i8] c"n NL / CRNL\00"
@.str.5 = [21 x i8] c"^A send ^A to remote\00"
define void @printhelp() {
%1 = tail call i32 @printd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printd(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printd(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printd(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ montarBorda(int **, int, int, int);
void montarMatriz(int matriz[][100], int n) {
  int i;
  for (i = 0; i < n; i++) {
    montarBorda(matriz, n, i, i + 1);
  }
}


x86 assembly (clang, -O0):
<montarMatriz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <montarMatriz+0x45>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
call   1030 <montarBorda@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <montarMatriz+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<montarMatriz>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1135 <montarMatriz+0x25>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edx,%edx
nop
lea    0x1(%rdx),%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%ecx
call   1030 <montarBorda@plt>
mov    %ebp,%edx
cmp    %ebp,%ebx
jne    1120 <montarMatriz+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @montarMatriz([100 x i32]* %0, i32 %1) {
%3 = alloca [100 x i32]*
%4 = alloca i32
%5 = alloca i32
store [100 x i32]* %0, [100 x i32]** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load [100 x i32]*, [100 x i32]** %3
%12 = bitcast [100 x i32]* %11 to i32**
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = call i32 @montarBorda(i32** %12, i32 %13, i32 %14, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @montarMatriz([100 x i32]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = bitcast [100 x i32]* %0 to i32**
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i32 %7, 1
%9 = tail call i32 @montarBorda(i32** %5, i32 %1, i32 %7, i32 %8)
%10 = icmp eq i32 %8, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
unsigned char SetBit(unsigned char byte, unsigned char bit, unsigned char val) {
  return (val ? byte | (0x01 << bit) : byte & ~(0x01 << bit));
}


x86 assembly (clang, -O0):
<SetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
je     113d <SetBit+0x3d>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <SetBit+0x56>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @SetBit(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = shl i32 1, %14
%16 = or i32 %12, %15
br label %25
17: ; preds = %3
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = shl i32 1, %21
%23 = xor i32 %22, -1
%24 = and i32 %19, %23
br label %25
25: ; preds = %17, %10
%26 = phi i32 [ %16, %10 ], [ %24, %17 ]
%27 = trunc i32 %26 to i8
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @SetBit(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
%5 = zext i8 %0 to i32
%6 = zext i8 %1 to i32
%7 = shl nuw i32 1, %6
%8 = or i32 %7, %5
%9 = xor i32 %7, -1
%10 = and i32 %9, %5
%11 = select i1 %4, i32 %10, i32 %8
%12 = trunc i32 %11 to i8
ret i8 %12
}
int main() {
  double a = 10;
  int b = 15;
  long c = 9;
  int max = 0;
  if (a > max) {
    a = max;
  }
  if (b > max) {
    b = max;
  }
  if (c > max) {
    c = max;
    c = max;
  }
  a = 6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movq   $0x9,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <main+0x4c>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    115e <main+0x5e>
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmp    %rcx,%rax
jle    117f <main+0x7f>
movslq -0x24(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x24(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
store double 1.000000e+01, double* %2
store i32 15, i32* %3
store i64 9, i64* %4
store i32 0, i32* %5
%6 = load double, double* %2
%7 = load i32, i32* %5
%8 = sitofp i32 %7 to double
%9 = fcmp ogt double %6, %8
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
store double %12, double* %2
br label %13
13: ; preds = %10, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %5
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %13
%20 = load i64, i64* %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = icmp sgt i64 %20, %22
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
store i64 %26, i64* %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
store i64 %28, i64* %4
br label %29
29: ; preds = %24, %19
store double 6.000000e+00, double* %2
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int iterate48(unsigned short *);
long nrand48(unsigned short subi[3]) { return iterate48(subi) >> 17; }


x86 assembly (clang, -O0):
<nrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <iterate48@plt>
sar    $0x11,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand48>:
push   %rax
call   1030 <iterate48@plt>
sar    $0x11,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @nrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @iterate48(i16* %3)
%5 = ashr i32 %4, 17
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @nrand48(i16* %0) {
%2 = tail call i32 @iterate48(i16* %0)
%3 = ashr i32 %2, 17
%4 = sext i32 %3 to i64
ret i64 %4
}
unsigned char f48(unsigned char x, unsigned long int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned char) - 1)));
}


x86 assembly (clang, -O0):
<f48>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f48>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0x7,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f48(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 0, %12
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = shl i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f48(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = shl nuw nsw i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}