xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ md_str;

/* Variables and functions */
int /*<<< orphan*/ NAS_Hash_Hex_Ex(char *, char *, int, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int _encrypt(char *data, char *e_data, int e_data_len) {
  char md_str[33] = {'\0'};
  NAS_Hash_Hex_Ex(data, md_str, sizeof(md_str), 1);
  strncpy(e_data, md_str, e_data_len);
  return 0;
}


x86 assembly (clang, -O0):
<_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x21,%edx
mov    $0x1,%ecx
call   1040 <NAS_Hash_Hex_Ex@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_encrypt>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x21,%edx
mov    $0x1,%ecx
call   1040 <NAS_Hash_Hex_Ex@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_encrypt(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [33 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = bitcast [33 x i8]* %7 to i8*
%9 = load i8*, i8** %4
%10 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%11 = call i32 @NAS_Hash_Hex_Ex(i8* %9, i8* %10, i32 33, i32 1)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %6
%15 = call i32 @strncpy(i8* %12, i8* %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @_encrypt(i8* %0, i8* %1, i32 %2) {
%4 = alloca [33 x i8]
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%6 = call i32 @NAS_Hash_Hex_Ex(i8* %0, i8* %5, i32 33, i32 1)
%7 = call i32 @strncpy(i8* %1, i8* %5, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
char *char_alloc(int n) {
  char *v;
  if ((v = (char *)malloc(n * sizeof(char))) == NULL) {
    fprintf(stderr, "FATAL ERROR: Out of memory\n");
    exit(1);
  }
  return v;
}


x86 assembly (clang, -O0):
<char_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1177 <char_alloc+0x47>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_alloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <char_alloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define i8* @char_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"FATAL ERROR: Out of memory\0A\00"
define i8* @char_alloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_runtime_dir() {
  printf("NOT IMPLEMENTED:"
         "pa_get_runtime_dir"
         "\n");
}


x86 assembly (clang, -O0):
<pa_get_runtime_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_get_runtime_dir\00"
define i32 @pa_get_runtime_dir() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Ipilha();
int main() {
  int i;
  Ipilha();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Ipilha@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Ipilha@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @Ipilha()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Ipilha()
ret i32 0
}
OP(dd, b9) { op_b9(); }


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

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_b9@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_b9()
ret i32 undef
}
int main() {
  int x = 0;
  while (1) {
    while (2) {
      x += 1;
      if (x > 5) {
        break;
      }
    }
    if (x == 2) {
      continue;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    112f <main+0x2f>
jmp    1134 <main+0x34>
jmp    1117 <main+0x17>
cmpl   $0x2,-0x8(%rbp)
jne    1143 <main+0x43>
jmp    1112 <main+0x12>
jmp    1112 <main+0x12>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double const);
void float64Print(FILE *fp, const double *data, int indent) {
  fprintf(fp, "%g", *data);
}


x86 assembly (clang, -O0):
<float64Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float64Print>:
movsd  (%rsi),%xmm0
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define void @float64Print(i32* nocapture %0, double* nocapture %1, i32 %2) {
%4 = load double, double* %1
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}
unsigned dns_dnlabels(const unsigned char *dn) {
  unsigned l = 0;
  while (*dn)
    ++l, dn += 1 + *dn;
  return l;
}


x86 assembly (clang, -O0):
<dns_dnlabels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <dns_dnlabels+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <dns_dnlabels+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_dnlabels>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1126 <dns_dnlabels+0x26>
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
movzbl %cl,%edx
movzbl 0x1(%rdx,%rdi,1),%ecx
add    %rdx,%rdi
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <dns_dnlabels+0x10>
ret

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

LLVM IR (-O2):
define i32 @dns_dnlabels(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = add i32 %6, 1
%9 = zext i8 %5 to i64
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  printf("hello world from process ID %ld\n", (long)getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"hello world from process ID %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"hello world from process ID %ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int __gnu_f2h_internal(unsigned int, int /*<<< orphan*/);
unsigned int __gnu_f2h_alternative(unsigned int x) {
  return __gnu_f2h_internal(x, 0);
}


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

x86 assembly (clang, -O2):
<__gnu_f2h_alternative>:
xor    %esi,%esi
jmp    1030 <__gnu_f2h_internal@plt>

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

LLVM IR (-O2):
define i32 @__gnu_f2h_alternative(i32 %0) {
%2 = tail call i32 @__gnu_f2h_internal(i32 %0, i32 0)
ret i32 %2
}
void RTNetIPv4IsHdrValid(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4IsHdrValid() {
ret void
}
/* Variables and functions */
int printf(char *);
int ued_rest_cursor_pos(void) { return printf("\033[u"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[u\00"
define i32 @ued_rest_cursor_pos() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[u\00"
define i32 @ued_rest_cursor_pos() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
__attribute__((noipa)) void *return_array_index_cst(void) {
  int a[32];
  void *p = &a[2];
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_array_index_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
call   1030 <sink@plt>
mov    -0x88(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_array_index_cst>:
push   %rbx
sub    $0x80,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sink@plt>
mov    %rbx,%rax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @return_array_index_cst() {
%1 = alloca [32 x i32]
%2 = alloca i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 2
%4 = bitcast i32* %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sink(i8* %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @return_array_index_cst() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @sink(i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ displayArray(int *, int const);
int /*<<< orphan*/ fillUpArray(int *, int const);
int main() {
  const int s = 10;
  int array[s];
  fillUpArray(array, s);
  displayArray(array, s);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1030 <fillUpArray@plt>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1040 <displayArray@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <fillUpArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <displayArray@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i8* @llvm.stacksave()
store i8* %4, i8** %3
%5 = alloca i32, i64 10
%6 = call i32 @fillUpArray(i32* %5, i32 10)
%7 = call i32 @displayArray(i32* %5, i32 10)
store i32 1, i32* %1
%8 = load i8*, i8** %3
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @fillUpArray(i32* %2, i32 10)
%4 = call i32 @displayArray(i32* %2, i32 10)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ read_line();
void do_empty_line(void) { read_line(); }


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

x86 assembly (clang, -O2):
<do_empty_line>:
xor    %eax,%eax
jmp    1030 <read_line@plt>

LLVM IR (-O0):
define void @do_empty_line() {
%1 = call i32 (...) @read_line()
ret void
}

LLVM IR (-O2):
define void @do_empty_line() {
%1 = tail call i32 (...) @read_line()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *a) {
  if (a)
    free(a);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ctest1(int *a) {
  printf("WRAPPED:\"a\" value is:%d\n", *a);
  *a = 666;
}


x86 assembly (clang, -O0):
<ctest1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0x29a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctest1>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x29a,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"WRAPPED:\22a\22 value is:%d\0A\00"
define void @ctest1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
store i32 666, i32* %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"WRAPPED:\22a\22 value is:%d\0A\00"
define void @ctest1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 666, i32* %0
ret void
}
int f(a, b, c)
char b;
{ return a - c + b; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    %edx,%edi
movsbl %sil,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = trunc i32 %1 to i8
store i32 %0, i32* %4
store i8 %7, i8* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = sub nsw i32 %8, %9
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %2
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
%7 = add nsw i32 %4, %6
ret i32 %7
}
double iterate(double x_n) {
  if (x_n < 0.5)
    return (2 * x_n);
  else
    return (2 * (1.0 - x_n));
}


x86 assembly (clang, -O0):
<iterate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1133 <iterate+0x33>
movsd  0xee4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <iterate+0x51>
movsd  0xed5(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterate>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xeef(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @iterate(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double 2.000000e+00, %7
store double %8, double* %2
br label %13
9: ; preds = %1
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fmul double 2.000000e+00, %11
store double %12, double* %2
br label %13
13: ; preds = %9, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @iterate(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
%3 = fsub double 1.000000e+00, %0
%4 = select i1 %2, double %0, double %3
%5 = fmul double %4, 2.000000e+00
ret double %5
}
double cosh(x)
double x;
{ return (exp(x) + exp(-x)) / 2; }


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xece(%rip),%xmm0
call   1030 <exp@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @exp(double %6)
%8 = fadd double %4, %7
%9 = fdiv double %8, 2.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fneg double %0
%4 = tail call double @exp(double %3)
%5 = fadd double %2, %4
%6 = fmul double %5, 5.000000e-01
ret double %6
}
void free_schar(signed char *val) {}


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

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

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

LLVM IR (-O2):
define void @free_schar(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_59(void) {
  { a_0_55(((((36)))), ", ?"); }
}


x86 assembly (clang, -O0):
<a_0_59>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_59>:
lea    0xee9(%rip),%rsi
mov    $0x24,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c", ?\00"
define void @a_0_59() {
%1 = call i32 @a_0_55(i32 36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c", ?\00"
define void @a_0_59() {
%1 = tail call i32 @a_0_55(i32 36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_halt();
void halt(void) { native_halt(); }


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

x86 assembly (clang, -O2):
<halt>:
xor    %eax,%eax
jmp    1030 <native_halt@plt>

LLVM IR (-O0):
define void @halt() {
%1 = call i32 (...) @native_halt()
ret void
}

LLVM IR (-O2):
define void @halt() {
%1 = tail call i32 (...) @native_halt()
ret void
}
void sigterm_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @sigterm_handler(i32 %0) {
ret void
}
/* Variables and functions */
char *escape_for_squotes(char const *, int);
char *squoted_arg_hook(const char match[]) {
  return escape_for_squotes(match, 1);
}


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

x86 assembly (clang, -O2):
<squoted_arg_hook>:
mov    $0x1,%esi
jmp    1030 <escape_for_squotes@plt>

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

LLVM IR (-O2):
define i8* @squoted_arg_hook(i8* %0) {
%2 = tail call i8* @escape_for_squotes(i8* %0, i32 1)
ret i8* %2
}
__attribute__((preserve_all)) int add_preserve_all(int a, int b) {
  return a + b;
}


x86 assembly (clang, -O0):
<add_preserve_all>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%r11d
add    %r11d,%eax
pop    %rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_preserve_all>:
push   %rdi
push   %rsi
push   %rax
lea    (%rdi,%rsi,1),%eax
pop    %rax
pop    %rsi
pop    %rdi
ret

LLVM IR (-O0):
define preserve_allcc i32 @add_preserve_all(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define preserve_allcc i32 @add_preserve_all(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t complementBit_fun_uint32_t(uint32_t x, uint32_t i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complementBit_fun_uint32_t>:
mov    %edi,%eax
btc    %esi,%eax
ret

LLVM IR (-O0):
define i32 @complementBit_fun_uint32_t(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @complementBit_fun_uint32_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
void haptic_hal_enable() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @lcd_thread_start() {
ret void
}
/* Type definitions */
typedef int uintmax_t;

/* Variables and functions */
char *fmt_o(uintmax_t x, char *s) {
  for (; x; x >>= 3)
    *--s = '0' + (x & 7);
  return s;
}


x86 assembly (clang, -O0):
<fmt_o>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1140 <fmt_o+0x40>
mov    -0x4(%rbp),%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <fmt_o+0xb>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_o>:
mov    %rsi,%rax
test   %edi,%edi
je     1129 <fmt_o+0x29>
mov    %edi,%ecx
nopl   0x0(%rax)
mov    %edi,%edx
and    $0x7,%dl
or     $0x30,%dl
mov    %dl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
sar    $0x3,%ecx
cmp    $0x7,%edi
mov    %ecx,%edi
ja     1110 <fmt_o+0x10>
ret

LLVM IR (-O0):
define i8* @fmt_o(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 = %15, %2
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %3
%10 = and i32 %9, 7
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 -1
store i8* %14, i8** %4
store i8 %12, i8* %14
br label %15
15: ; preds = %8
%16 = load i32, i32* %3
%17 = ashr i32 %16, 3
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @fmt_o(i32 %0, i8* writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = trunc i32 %6 to i8
%8 = and i8 %7, 7
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 %9, i8* %10
%11 = ashr i32 %6, 3
%12 = icmp ult i32 %6, 8
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i8* [ %1, %2 ], [ %10, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ cnd_t;

/* Variables and functions */
int thrd_success;
int cnd_signal(cnd_t *cond) { return thrd_success; }


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

x86 assembly (clang, -O2):
<cnd_signal>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@thrd_success = global i32 0
define i32 @cnd_signal(i32* nocapture readnone %0) {
%2 = load i32, i32* @thrd_success
ret i32 %2
}
int _power2p(int value) {
  if (value == 0)
    return 1;
  if (value == 2)
    return 1;
  if (value & 0x1)
    return 0;
  return (_power2p(value >> 1));
}


x86 assembly (clang, -O0):
<_power2p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <_power2p+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1170 <_power2p+0x60>
cmpl   $0x2,-0x8(%rbp)
jne    1147 <_power2p+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1170 <_power2p+0x60>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1162 <_power2p+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1170 <_power2p+0x60>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <_power2p@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_power2p>:
test   $0xfffffffd,%edi
je     1117 <_power2p+0x17>
mov    %edi,%eax
sar    %eax
test   $0x1,%dil
mov    %eax,%edi
je     1100 <_power2p>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_power2p(i32 %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i32 [ %0, %1 ], [ %7, %4 ]
switch i32 %3, label %4 [
i32 0, label %8
i32 2, label %8
]
4: ; preds = %2
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
%7 = ashr i32 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %4, %2, %2
%9 = phi i32 [ 1, %2 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %9
}
/* Variables and functions */
double __ieee754_lgamma_r(double, int *);
double __ieee754_gamma_r(double x, int *signgamp) {
  return __ieee754_lgamma_r(x, signgamp);
}


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

x86 assembly (clang, -O2):
<__ieee754_gamma_r>:
jmp    1030 <__ieee754_lgamma_r@plt>

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

LLVM IR (-O2):
define double @__ieee754_gamma_r(double %0, i32* %1) {
%3 = tail call double @__ieee754_lgamma_r(double %0, i32* %1)
ret double %3
}
AX0I1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
cmpl   $0x21,(%rax,%rcx,4)
ja     1137 <AX0I1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <AX0I1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpl   $0x22,0x989680(,%rcx,4)
22
setb   %al
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp ult i32 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t atomic_xchg64(void *ptr, uint64_t x) {
  __asm__ __volatile__("xchgq %0,%1"
                       : "=r"(x)
                       : "m"(*(volatile uint64_t *)ptr), "0"(x)
                       : "memory");
  return x;
}


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

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

LLVM IR (-O0):
define i8* @atomic_xchg64(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %4
%8 = call i8* asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %6, i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
ret i8* %9
}

LLVM IR (-O2):
define i8* @atomic_xchg64(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
%4 = tail call i8* asm sideeffect "xchgq $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %3, i8* %1)
ret i8* %4
}
char *version_get_ert_version() { return "Unknown version"; }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Unknown version\00"
define i8* @version_get_ert_version() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"Unknown version\00"
define i8* @version_get_ert_version() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ read_geometry_main_c();
void read_geometry_main() { read_geometry_main_c(); }


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

x86 assembly (clang, -O2):
<read_geometry_main>:
xor    %eax,%eax
jmp    1030 <read_geometry_main_c@plt>

LLVM IR (-O0):
define void @read_geometry_main() {
%1 = call i32 (...) @read_geometry_main_c()
ret void
}

LLVM IR (-O2):
define void @read_geometry_main() {
%1 = tail call i32 (...) @read_geometry_main_c()
ret void
}
/* Type definitions */
struct _Locale_messages {
  int dummy;
};

/* Variables and functions */
void _Locale_messages_destroy(struct _Locale_messages *lmes) {}


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

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

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

LLVM IR (-O2):
%struct._Locale_messages = type { i32 }
define void @_Locale_messages_destroy(%struct._Locale_messages* nocapture %0) {
ret void
}
RCU_DEF_INIT_FUNC(user_m4_destroy, param) { RCU_FAIL("user_m4_destroy"); }


x86 assembly (clang, -O0):
<RCU_DEF_INIT_FUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <RCU_FAIL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCU_DEF_INIT_FUNC>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <RCU_FAIL@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"user_m4_destroy\00"
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [16 x i8] c"user_m4_destroy\00"
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @RCU_FAIL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int somaMultiplos3e7(int, int);
int main() {
  int inicio = 0, fim = 1000, soma = 0;
  soma = somaMultiplos3e7(inicio, fim);
  printf("Soma dos multiplos de 3 e 7, de %d ate %d: %d \n", inicio, fim, soma);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Soma dos multiplos de 3 e 7, de %d ate %d: %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 0, i32* %2
store i32 1000, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @somaMultiplos3e7(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Soma dos multiplos de 3 e 7, de %d ate %d: %d \0A\00"
define i32 @main() {
%1 = tail call i32 @somaMultiplos3e7(i32 0, i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 0, i32 1000, i32 %1)
ret i32 0
}
unsigned xrop3_214_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T & S;
  stk3 = D | stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_214_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_214_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand();
  if (x < 10) {
    return rand();
  } else {
    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)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1149 <main+0x39>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <main+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cmp    $0x9,%eax
jg     1125 <main+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @rand()
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
int isatty(int fd) { return (fd >= 0) && (fd <= 2); }


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isatty+0x20>
cmpl   $0x2,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
int pool_fence(struct _DriBufferPool *pool, void *private,
               struct _DriFenceObject *fence) {
  return 0;
}


x86 assembly (clang, -O0):
<pool_fence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._DriBufferPool = type opaque
%struct._DriFenceObject = type opaque
define i32 @pool_fence(%struct._DriBufferPool* %0, i8* %1, %struct._DriFenceObject* %2) {
%4 = alloca %struct._DriBufferPool*
%5 = alloca i8*
%6 = alloca %struct._DriFenceObject*
store %struct._DriBufferPool* %0, %struct._DriBufferPool** %4
store i8* %1, i8** %5
store %struct._DriFenceObject* %2, %struct._DriFenceObject** %6
ret i32 0
}

LLVM IR (-O2):
%struct._DriBufferPool = type opaque
%struct._DriFenceObject = type opaque
define i32 @pool_fence(%struct._DriBufferPool* nocapture readnone %0, i8* nocapture readnone %1, %struct._DriFenceObject* nocapture readnone %2) {
ret i32 0
}