xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void table_end(char **table, int table_size) {
  int i = 0;
  while (i < table_size)
    free(table[i++]);
}


x86 assembly (clang, -O0):
<table_end>:
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    1152 <table_end+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1126 <table_end+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_end>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <table_end+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
add    $0x1,%rbx
call   1030 <free@plt>
cmp    %rbx,%r15
jne    1130 <table_end+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @table_end(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *strchr(char const *, int);
char *rindex(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<rindex>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @rindex(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_angle(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void right(unsigned int speed, unsigned int angle) {
  motion_direction(0b00001010);
  speed_control(speed, speed);
  cal_angle(angle);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xa,%edi
call   1040 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1060 <speed_control@plt>
mov    %ebx,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 10)
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @cal_angle(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @right(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 10)
%4 = tail call i32 @speed_control(i32 %0, i32 %0)
%5 = tail call i32 @cal_angle(i32 %1)
%6 = tail call i32 @_delay_us(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Help:\n? - help\nq - quit\narrows - move and rotate\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"Help:\0A? - help\0Aq - quit\0Aarrows - move and rotate\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"Help:\0A? - help\0Aq - quit\0Aarrows - move and rotate\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int aio_write(struct aiocb *aiocbp) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<aio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_write>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
define i32 @aio_write(%struct.aiocb* %0) {
%2 = alloca %struct.aiocb*
store %struct.aiocb* %0, %struct.aiocb** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
define i32 @aio_write(%struct.aiocb* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
__attribute__((weak)) int _close(int fd) {
  (void)fd;
  return (0);
}


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

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

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

LLVM IR (-O2):
define weak i32 @_close(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void foo(void) {
  volatile int i;
  malloc(1);
  i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    0x4(%rsp),%eax
pop    %rax
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = call i32 @malloc(i32 1)
%3 = load volatile i32, i32* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @malloc(i32 1)
%4 = load volatile i32, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int i, *p, **q;
  i = 5;
  p = &i;
  q = &p;
  printf("%d\n%d\n%d\n", i, *p, **q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d\0A%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: randline [file [file2 ..]|-]\n", stderr);
  exit(EX_USAGE);
}


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

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

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

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: randline [file [file2 ..]|-]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int main() {
  int x = 0, y = 0;
  int m;
  int n = 2 * m;
  while (x < n) {
    if (x < m) {
      x++;
      y++;
    } else {
      x++;
      y--;
    }
  }
  if (y != 0) {
  ERROR:
    goto ERROR;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1168 <main+0x68>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1151 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <main+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <main+0x22>
cmpl   $0x0,-0xc(%rbp)
je     117c <main+0x7c>
jmp    1177 <main+0x77>
jmp    1177 <main+0x77>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CompileWord(int, long);
void DoSource(void) {
  CompileWord(50, 8);
  CompileWord(7, 0L);
  CompileWord(50, 9);
  CompileWord(7, 0L);
}


x86 assembly (clang, -O0):
<DoSource>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
mov    $0x8,%esi
call   1030 <CompileWord@plt>
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <CompileWord@plt>
mov    $0x32,%edi
mov    $0x9,%esi
call   1030 <CompileWord@plt>
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <CompileWord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoSource>:
push   %rax
mov    $0x8,%esi
mov    $0x32,%edi
call   1030 <CompileWord@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <CompileWord@plt>
mov    $0x9,%esi
mov    $0x32,%edi
call   1030 <CompileWord@plt>
mov    $0x7,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <CompileWord@plt>

LLVM IR (-O0):
define void @DoSource() {
%1 = call i32 @CompileWord(i32 50, i64 8)
%2 = call i32 @CompileWord(i32 7, i64 0)
%3 = call i32 @CompileWord(i32 50, i64 9)
%4 = call i32 @CompileWord(i32 7, i64 0)
ret void
}

LLVM IR (-O2):
define void @DoSource() {
%1 = tail call i32 @CompileWord(i32 50, i64 8)
%2 = tail call i32 @CompileWord(i32 7, i64 0)
%3 = tail call i32 @CompileWord(i32 50, i64 9)
%4 = tail call i32 @CompileWord(i32 7, i64 0)
ret void
}
/* Variables and functions */
char const *sk_file_content_type_ext(char const *);
char *sk_file_extname(char const *);
const char *sk_file_content_type(const char *path) {
  const char *ext = sk_file_extname(path);
  return sk_file_content_type_ext(ext);
}


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

x86 assembly (clang, -O2):
<sk_file_content_type>:
push   %rax
call   1040 <sk_file_extname@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <sk_file_content_type_ext@plt>

LLVM IR (-O0):
define i8* @sk_file_content_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @sk_file_extname(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @sk_file_content_type_ext(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @sk_file_content_type(i8* %0) {
%2 = tail call i8* @sk_file_extname(i8* %0)
%3 = tail call i8* @sk_file_content_type_ext(i8* %2)
ret i8* %3
}
/* Variables and functions */
int a(int);
int b(int);
int c(int x) { return a(x) * b(x) * c(x); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <a@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <c@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <a@plt>
mov    %ebx,%edi
call   1030 <b@plt>
jmp    1130 <c+0x10>

LLVM IR (-O0):
define i32 @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @a(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @b(i32 %5)
%7 = mul nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @c(i32 %8)
%10 = mul nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @c(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @a(i32 %0)
%4 = tail call i32 @b(i32 %0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ UserAdjudicationEvent(int);
void AdjuBlackProc() { UserAdjudicationEvent(-1); }


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

x86 assembly (clang, -O2):
<AdjuBlackProc>:
mov    $0xffffffff,%edi
jmp    1030 <UserAdjudicationEvent@plt>

LLVM IR (-O0):
define void @AdjuBlackProc() {
%1 = call i32 @UserAdjudicationEvent(i32 -1)
ret void
}

LLVM IR (-O2):
define void @AdjuBlackProc() {
%1 = tail call i32 @UserAdjudicationEvent(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reportError2(int /*<<< orphan*/ *);
int target(int foo) {
  if (foo == 90) {
    reportError2(NULL);
    return -22;
  }
  return foo + 12;
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jne    113a <target+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <reportError2@plt>
movl   $0xffffffea,-0x4(%rbp)
jmp    1143 <target+0x33>
mov    -0x8(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
cmp    $0x5a,%edi
jne    1127 <target+0x17>
push   %rax
xor    %edi,%edi
call   1030 <reportError2@plt>
mov    $0xffffffea,%eax
add    $0x8,%rsp
ret
mov    %edi,%eax
add    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @target(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 90
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @reportError2(i32* null)
store i32 -22, i32* %2
br label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 12
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @target(i32 %0) {
%2 = icmp eq i32 %0, 90
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @reportError2(i32* null)
br label %7
5: ; preds = %1
%6 = add nsw i32 %0, 12
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -22, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void e(void) { exit(1); }


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<e>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @e() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @e() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int reverse(int, int /*<<< orphan*/);
bool isPalindrome(int x) {
  if (x < 0)
    return false;
  return reverse(x, 0) == x;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <isPalindrome+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <isPalindrome+0x39>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <reverse@plt>
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
test   %edi,%edi
js     1129 <isPalindrome+0x19>
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPalindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @reverse(i32 %8, i32 0)
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @reverse(i32 %0, i32 0)
%5 = icmp eq i32 %4, %0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void check_uninit_sized_VLA() {
  int x;
  int vla[x];
}


x86 assembly (clang, -O0):
<check_uninit_sized_VLA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_uninit_sized_VLA() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @check_uninit_sized_VLA() {
ret void
}
/* Variables and functions */
int myfgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar(void) { return myfgetc(stdin); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <myfgetc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <myfgetc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @myfgetc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @myfgetc(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void reset_dma(unsigned int dmanr) {
  if (dmanr == 1)
    outb(255, 0x0D);
  else
    outb(255, 0xDA);
}


x86 assembly (clang, -O0):
<reset_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1139 <reset_dma+0x29>
mov    $0xff,%edi
mov    $0xd,%esi
call   1030 <outb@plt>
jmp    1148 <reset_dma+0x38>
mov    $0xff,%edi
mov    $0xda,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_dma>:
cmp    $0x1,%edi
mov    $0xd,%eax
mov    $0xda,%esi
cmove  %eax,%esi
mov    $0xff,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @reset_dma(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @outb(i32 255, i32 13)
br label %9
7: ; preds = %1
%8 = call i32 @outb(i32 255, i32 218)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @reset_dma(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 13, i32 218
%4 = tail call i32 @outb(i32 255, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ call_panic_handlers();
void __attribute__((noreturn)) __die_harder(void) {
  call_panic_handlers();
  _exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<__die_harder>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <call_panic_handlers@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<__die_harder>:
push   %rax
xor    %eax,%eax
call   1040 <call_panic_handlers@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @__die_harder() {
%1 = call i32 (...) @call_panic_handlers()
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @_exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @__die_harder() {
%1 = tail call i32 (...) @call_panic_handlers()
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @_exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void time8(int value) {
  printf("PASS: test9\n");
  exit(0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"PASS: test9\00"
define void @time8(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int setBitRate(const float *const bitRate,
               int (*spiTransfer)(unsigned char *const, unsigned int,
                                  void *const customData),
               void *const customData) {
  unsigned char data[3];
  long br = (long)(32000000 / *bitRate);
  data[0] = 0x03 | 1 << 7;
  data[1] = (br & 0xFF00) >> 8;
  data[2] = br & 0xFF;
  return (*spiTransfer)(data, 3, customData);
}


x86 assembly (clang, -O0):
<setBitRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  0xee0(%rip),%xmm0
divss  (%rax),%xmm0
cvttss2si %xmm0,%rax
mov    %rax,-0x28(%rbp)
movb   $0x83,-0x1b(%rbp)
mov    -0x28(%rbp),%rax
and    $0xff00,%rax
sar    $0x8,%rax
mov    %al,-0x1a(%rbp)
mov    -0x28(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x1b(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3,%esi
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBitRate>:
push   %rax
movss  0xef7(%rip),%xmm0
divss  (%rdi),%xmm0
cvttss2si %xmm0,%rcx
mov    %rsi,%rax
movb   $0x83,0x5(%rsp)
mov    %ch,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   *%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @setBitRate(float* %0, i32 (i8*, i32, i8*)* %1, i8* %2) {
%4 = alloca float*
%5 = alloca i32 (i8*, i32, i8*)*
%6 = alloca i8*
%7 = alloca [3 x i8]
%8 = alloca i64
store float* %0, float** %4
store i32 (i8*, i32, i8*)* %1, i32 (i8*, i32, i8*)** %5
store i8* %2, i8** %6
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = fdiv float 3.200000e+07, %10
%12 = fptosi float %11 to i64
store i64 %12, i64* %8
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8 -125, i8* %13
%14 = load i64, i64* %8
%15 = and i64 %14, 65280
%16 = ashr i64 %15, 8
%17 = trunc i64 %16 to i8
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 1
store i8 %17, i8* %18
%19 = load i64, i64* %8
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 2
store i8 %21, i8* %22
%23 = load i32 (i8*, i32, i8*)*, i32 (i8*, i32, i8*)** %5
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%25 = load i8*, i8** %6
%26 = call i32 %23(i8* %24, i32 3, i8* %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @setBitRate(float* nocapture %0, i32 (i8*, i32, i8*)* nocapture %1, i8* %2) {
%4 = alloca [3 x i8]
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%6 = load float, float* %0
%7 = fdiv float 3.200000e+07, %6
%8 = fptosi float %7 to i64
store i8 -125, i8* %5
%9 = lshr i64 %8, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 1
store i8 %10, i8* %11
%12 = trunc i64 %8 to i8
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 2
store i8 %12, i8* %13
%14 = call i32 %1(i8* %5, i32 3, i8* %2)
ret i32 %14
}
/* Variables and functions */
double rad_deg(double);
double merc_lon(double x) { return rad_deg(x) / 6378137.0; }


x86 assembly (clang, -O0):
<merc_lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rad_deg@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merc_lon>:
push   %rax
call   1030 <rad_deg@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @merc_lon(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @rad_deg(double %3)
%5 = fdiv double %4, 0x415854A640000000
ret double %5
}

LLVM IR (-O2):
define double @merc_lon(double %0) {
%2 = tail call double @rad_deg(double %0)
%3 = fdiv double %2, 0x415854A640000000
ret double %3
}
int triangle(int n) { return (n * (n + 1)) / 2; }


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @triangle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @triangle(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lcd_send_command(int);
int /*<<< orphan*/ usleep(int);
void lcd_init(void) {
  uint8_t cmd = 0;
  cmd = 0x20 | (0x20 & ~((1 << 4))) | (1 << 3) | (0x20 & ~((1 << 2)));
  lcd_send_command(cmd);
  usleep((8 * 1000));
  cmd = 0X04 | (1 << 1);
  lcd_send_command(cmd);
  usleep((8 * 1000));
  cmd = 0x08 | (1 << 2) | (1 << 1);
  lcd_send_command(cmd);
  usleep((8 * 1000));
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
call   1040 <usleep@plt>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
call   1040 <usleep@plt>
movl   $0xe,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
mov    $0x28,%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
call   1040 <usleep@plt>
mov    $0x6,%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
call   1040 <usleep@plt>
mov    $0xe,%edi
call   1030 <lcd_send_command@plt>
mov    $0x1f40,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @lcd_init() {
%1 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @lcd_send_command(i32 %2)
%4 = call i32 @usleep(i32 8000)
store i32 6, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @lcd_send_command(i32 %5)
%7 = call i32 @usleep(i32 8000)
store i32 14, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @lcd_send_command(i32 %8)
%10 = call i32 @usleep(i32 8000)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 @lcd_send_command(i32 40)
%2 = tail call i32 @usleep(i32 8000)
%3 = tail call i32 @lcd_send_command(i32 6)
%4 = tail call i32 @usleep(i32 8000)
%5 = tail call i32 @lcd_send_command(i32 14)
%6 = tail call i32 @usleep(i32 8000)
ret void
}
int in_condition(int a, int b) {
  int c;
  int d;
  if (a) {
    return a;
  } else {
    return b;
  }
  if (a)
    return c;
  else
    return d;
}


x86 assembly (clang, -O0):
<in_condition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111f <in_condition+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <in_condition+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_condition>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @in_condition(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int sca3000_register_ring_access_and_init(struct iio_dev *indio_dev) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @sca3000_register_ring_access_and_init(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float remainingAngle(float, float);
int main(int argc, const char *argv[]) {
  float angleA = 30.0;
  float angleB = 60.0;
  float angleC = remainingAngle(angleA, angleB);
  printf("The third angle is %.2f\n", angleC);
  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)
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
call   1030 <remainingAngle@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
call   1030 <remainingAngle@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The third angle is %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 3.000000e+01, float* %6
store float 6.000000e+01, float* %7
%9 = load float, float* %6
%10 = load float, float* %7
%11 = call float @remainingAngle(float %9, float %10)
store float %11, float* %8
%12 = load float, float* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The third angle is %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @remainingAngle(float 3.000000e+01, float 6.000000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
/* Variables and functions */
int isatty(int);
int os_isatty(int fd) { return isatty(fd); }


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

x86 assembly (clang, -O2):
<os_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @os_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int sum;
  int *int_p = (int *)malloc(10 * sizeof(int));
  void *void_p;
  void_p = int_p;
  int i;
  for (i = 0; i < 10; i++) {
    int *int_p2 = (int *)void_p;
    sum += *int_p + *int_p2;
    int_p++;
    void_p = (void *)((int)void_p + sizeof(int));
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    1188 <main+0x78>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
add    (%rcx),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cltq
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <main+0x2c>
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x28,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
void args_value_error(char arg) {
  if (arg == 't') {
    fprintf(stderr, "Option -%c requires an argument.\n", arg);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<args_value_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x74,%eax
jne    115e <args_value_error+0x3e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_value_error>:
cmp    $0x74,%dil
je     1127 <args_value_error+0x7>
ret
push   %rax
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
mov    $0x74,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Option -%c requires an argument.\0A\00"
define void @args_value_error(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, 116
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i8, i8* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Option -%c requires an argument.\0A\00"
define void @args_value_error(i8 signext %0) {
%2 = icmp eq i8 %0, 116
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext 116)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
int test_imm_3Cint32_reg(int val) { return ((val) & (0x3C << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_3Cint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cint32_reg(i32 %0) {
%2 = and i32 %0, 60
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int unlock_term(char *name) {}


x86 assembly (clang, -O0):
<unlock_term>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unlock_term(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(unsigned int, int);
int main() {
  int ret = 0;
  int n = 3;
  unsigned x = 245;
  printf("The result is %u", rightrot(x, n));
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0xf5,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"The result is %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 3, i32* %3
store i32 245, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @rightrot(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"The result is %u\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 245, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  if (!p)
    fail("thou shalt not free a null pointer!");
  free(p);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <xfree+0x23>
lea    0xec2(%rip),%rdi
call   1040 <fail@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <xfree+0x15>
lea    0xed0(%rip),%rdi
call   1040 <fail@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"thou shalt not free a null pointer!\00"
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @fail(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"thou shalt not free a null pointer!\00"
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fail(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glTexParameterfv_size(int /*<<< orphan*/);
GLint __glTexParameteriv_size(GLenum e) { return __glTexParameterfv_size(e); }


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

x86 assembly (clang, -O2):
<__glTexParameteriv_size>:
jmp    1030 <__glTexParameterfv_size@plt>

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

LLVM IR (-O2):
define i32 @__glTexParameteriv_size(i32 %0) {
%2 = tail call i32 @__glTexParameterfv_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memmove(char *, char const *, size_t);
char *tokendup(const char *t, const char *l) {
  size_t n = l - t + 1;
  char *r = (char *)malloc(n);
  memmove(r, t, n - 1);
  r[n] = '\0';
  return r;
}


x86 assembly (clang, -O0):
<tokendup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <memmove@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokendup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%rdi
call   1030 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memmove@plt>
movb   $0x0,0x1(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @tokendup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = add nsw i64 %11, 1
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = call i64 @malloc(i64 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i64, i64* %5
%19 = sub i64 %18, 1
%20 = call i32 @memmove(i8* %16, i8* %17, i64 %19)
%21 = load i8*, i8** %6
%22 = load i64, i64* %5
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @tokendup(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = add nsw i64 %5, 1
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @memmove(i8* %8, i8* %0, i64 %5)
%10 = getelementptr inbounds i8, i8* %8, i64 %6
store i8 0, i8* %10
ret i8* %8
}