xunge/DecIR huggingface dataset:
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
scalar_t__ getrlimit(int, struct rlimit *);
int /*<<< orphan*/ shutdown(int, char *, int);
void getr(int type, struct rlimit *rlim) {
  if (getrlimit(type, rlim))
    shutdown(6, "getrlimit()", 141 - 1);
}


x86 assembly (clang, -O0):
<getr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <getrlimit@plt>
cmp    $0x0,%rax
je     115b <getr+0x3b>
mov    $0x6,%edi
lea    0xeaf(%rip),%rsi
mov    $0x8c,%edx
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getr>:
push   %rax
call   1040 <getrlimit@plt>
test   %rax,%rax
je     1142 <getr+0x22>
lea    0xece(%rip),%rsi
mov    $0x6,%edi
mov    $0x8c,%edx
pop    %rax
jmp    1030 <shutdown@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = call i64 @getrlimit(i32 %5, %struct.rlimit* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 140)
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = tail call i64 @getrlimit(i32 %0, %struct.rlimit* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 140)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inc_x(void *x_void_ptr) {
  int *x_ptr = (int *)x_void_ptr;
  printf("\n----executing thread------\n");
  while (++(*x_ptr) < 100)
    ;
  printf("x increment finished\n");
  printf("\n----finishing thread------\n");
}


x86 assembly (clang, -O0):
<inc_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    $0x64,%eax
jge    1149 <inc_x+0x39>
jmp    1130 <inc_x+0x20>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_x>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%eax
cmp    $0x64,%eax
mov    $0x63,%ecx
cmovge %eax,%ecx
add    $0x1,%ecx
mov    %ecx,(%rbx)
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A----executing thread------\0A\00"
@.str.1 = [22 x i8] c"x increment finished\0A\00"
@.str.2 = [29 x i8] c"\0A----finishing thread------\0A\00"
define void @inc_x(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %12, %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"\0A----executing thread------\00"
@str.3 = [21 x i8] c"x increment finished\00"
@str.4 = [28 x i8] c"\0A----finishing thread------\00"
define void @inc_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @llvm.smax.i32(i32 %4, i32 99)
%6 = add nuw i32 %5, 1
store i32 %6, i32* %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *G_CurrentNodeIndexArray();
int G_CurrentNodeIndex(int rotation) {
  int *p = G_CurrentNodeIndexArray();
  return p[rotation];
}


x86 assembly (clang, -O0):
<G_CurrentNodeIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <G_CurrentNodeIndexArray@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_CurrentNodeIndex>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <G_CurrentNodeIndexArray@plt>
movslq %ebx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @G_CurrentNodeIndex(i32 %0) {
%2 = tail call i32* (...) @G_CurrentNodeIndexArray()
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %2, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int binomial(int n, int k) {
  return k > 0 ? binomial(n - 1, k - 1) * n / k : 1;
}


x86 assembly (clang, -O0):
<binomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1149 <binomial+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <binomial@plt>
imul   -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1156 <binomial+0x46>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <binomial+0x46>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binomial>:
test   %esi,%esi
jle    1138 <binomial+0x28>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    -0x1(%r14),%edi
lea    -0x1(%rbx),%esi
call   1030 <binomial@plt>
imul   %r14d,%eax
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @binomial(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @binomial(i32 %9, i32 %11)
%13 = load i32, i32* %3
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %7
%19 = phi i32 [ %16, %7 ], [ 1, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @binomial(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2, %6
%5 = phi i32 [ %11, %6 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = add nsw i32 %1, -1
%9 = tail call i32 @binomial(i32 %7, i32 %8)
%10 = mul nsw i32 %9, %0
%11 = sdiv i32 %10, %1
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ util_str_lstrip(char *);
int /*<<< orphan*/ util_str_rstrip(char *);
void util_str_strip(char *str) {
  util_str_lstrip(str);
  util_str_rstrip(str);
}


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

x86 assembly (clang, -O2):
<util_str_strip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <util_str_lstrip@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <util_str_rstrip@plt>

LLVM IR (-O0):
define void @util_str_strip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @util_str_lstrip(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @util_str_rstrip(i8* %5)
ret void
}

LLVM IR (-O2):
define void @util_str_strip(i8* %0) {
%2 = tail call i32 @util_str_lstrip(i8* %0)
%3 = tail call i32 @util_str_rstrip(i8* %0)
ret void
}
/* Variables and functions */
int close(int);
int close_socket(int sd) {
  int ret;
  ret = close(sd);
  return (ret);
}


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

x86 assembly (clang, -O2):
<close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void gtk_cell_view_set_displayed_row() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_set_displayed_row() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void core_exit_with_error() {
  int error_status;
  error_status = 1;
  exit(error_status);
}


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

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

LLVM IR (-O0):
define void @core_exit_with_error() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
define void @core_exit_with_error() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(float *);
scalar_t__ realloc(float *, int);
float *resize_fvector(float *vec, int minx, int maxx) {
  float *m;
  m = (float *)realloc(vec + minx, (maxx - minx + 1) * sizeof(float));
  assert(m);
  m -= minx;
  return m;
}


x86 assembly (clang, -O0):
<resize_fvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_fvector>:
push   %r14
push   %rbx
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
lea    0x0(,%rax,4),%r14
sub    %eax,%edx
lea    0x4(,%rdx,4),%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @resize_fvector(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float*
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load float*, float** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 4
%18 = trunc i64 %17 to i32
%19 = call i64 @realloc(float* %11, i32 %18)
%20 = inttoptr i64 %19 to float*
store float* %20, float** %7
%21 = load float*, float** %7
%22 = call i32 @assert(float* %21)
%23 = load i32, i32* %5
%24 = load float*, float** %7
%25 = sext i32 %23 to i64
%26 = sub i64 0, %25
%27 = getelementptr inbounds float, float* %24, i64 %26
store float* %27, float** %7
%28 = load float*, float** %7
ret float* %28
}

LLVM IR (-O2):
define float* @resize_fvector(float* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = sub nsw i32 %2, %1
%7 = shl i32 %6, 2
%8 = add i32 %7, 4
%9 = tail call i64 @realloc(float* %5, i32 %8)
%10 = inttoptr i64 %9 to float*
%11 = tail call i32 @assert(float* %10)
%12 = sub nsw i64 0, %4
%13 = getelementptr inbounds float, float* %10, i64 %12
ret float* %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FSE_freeDTable(void *DTable) { free(DTable); }


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

x86 assembly (clang, -O2):
<FSE_freeDTable>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FSE_freeDTable(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void w20(void *x, double y) { *(double *)(x + 32748) = y; }


x86 assembly (clang, -O0):
<w20>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x7fec(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w20>:
movsd  %xmm0,0x7fec(%rdi)
ret

LLVM IR (-O0):
define void @w20(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32748
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w20(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32748
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
__attribute__((no)) unsigned short int foo5(int x) { return x; }


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

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

LLVM IR (-O0):
define zeroext i16 @foo5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @foo5(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
/* Variables and functions */
int arg_rest(char **);
char *optional_str(char **av, int n, char *dft) {
  char *ret = dft;
  if (arg_rest(av) > n)
    ret = av[n];
  return ret;
}


x86 assembly (clang, -O0):
<optional_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <arg_rest@plt>
cmp    -0xc(%rbp),%eax
jle    114d <optional_str+0x3d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optional_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <arg_rest@plt>
cmp    %ebp,%eax
jle    112c <optional_str+0x1c>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @optional_str(i8** %0, i32 %1, i8* readnone %2) {
%4 = tail call i32 @arg_rest(i8** %0)
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %6, %3
%11 = phi i8* [ %9, %6 ], [ %2, %3 ]
ret i8* %11
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_cfend(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0004 | 0x00E0);
}


x86 assembly (clang, -O0):
<ieee80211_is_cfend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xe4,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_cfend>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xe4,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_cfend(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 228)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_cfend(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 228)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tms_close_log();
int /*<<< orphan*/ tms_shutdown();
void sig_handler(int32_t sig) {
  fprintf(stdout, "\nStop grabbing with signal %d\n", sig);
  tms_shutdown();
  tms_close_log();
  exit(sig);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <tms_shutdown@plt>
mov    $0x0,%al
call   1040 <tms_close_log@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <tms_shutdown@plt>
xor    %eax,%eax
call   1040 <tms_close_log@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [31 x i8] c"\0AStop grabbing with signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @tms_shutdown()
%7 = call i32 (...) @tms_close_log()
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [31 x i8] c"\0AStop grabbing with signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @tms_shutdown()
%5 = tail call i32 (...) @tms_close_log()
%6 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_DivideMat4f_init(void) {
  _hmt_register_covercase("HMM_DivideMat4f", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_DivideMat4f_init>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"HMM_DivideMat4f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DivideMat4f_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"HMM_DivideMat4f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DivideMat4f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ date(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%i", &x);
  date(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <date@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <date@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @date(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @date(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
void g() { f(42, 42); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%esi
mov    %esi,%edi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    $0x2a,%edi
mov    $0x2a,%esi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i32 @f(i32 42, i32 42)
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @f(i32 42, i32 42)
ret void
}
/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void outgoing() {
  char buf;
  for (;;)
    while (read(0, &buf, 1)) {
      if ('#' == buf)
        return;
      write(4, &buf, 1);
    }
}


x86 assembly (clang, -O0):
<outgoing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <outgoing+0xd>
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     1176 <outgoing+0x56>
movsbl -0x1(%rbp),%ecx
mov    $0x23,%eax
cmp    %ecx,%eax
jne    115e <outgoing+0x3e>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x4,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    112d <outgoing+0xd>
jmp    1128 <outgoing+0x8>

x86 assembly (clang, -O2):
<outgoing>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1130 <outgoing+0x10>
cmpb   $0x23,0xf(%rsp)
je     115f <outgoing+0x3f>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1130 <outgoing+0x10>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @outgoing() {
%1 = alloca i8
br label %2
2: ; preds = %13, %0
br label %3
3: ; preds = %11, %2
%4 = call i64 @read(i32 0, i8* %1, i32 1)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp eq i32 35, %8
br i1 %9, label %10, label %11
10: ; preds = %6
ret void
11: ; preds = %6
%12 = call i32 @write(i32 4, i8* %1, i32 1)
br label %3
13: ; preds = %3
br label %2
}

LLVM IR (-O2):
define void @outgoing() {
%1 = alloca i8
br label %2
2: ; preds = %5, %0
%3 = call i64 @read(i32 0, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %10, %2
br label %2
6: ; preds = %2, %10
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 35
br i1 %8, label %9, label %10
9: ; preds = %6
ret void
10: ; preds = %6
%11 = call i32 @write(i32 4, i8* %1, i32 1)
%12 = call i64 @read(i32 0, i8* %1, i32 1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %5, label %6
}
unsigned normal2x_height_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @normal2x_height_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ foo(double);
int main() {
  double x1 = 5;
  foo(x1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 5.000000e+00, double* %2
%3 = load double, double* %2
%4 = call i32 @foo(double %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(double 5.000000e+00)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int /*<<< orphan*/, char *, size_t,
                              unsigned int *, struct timespec const *);
ssize_t mq_timedreceive(mqd_t mqd, char *restrict msg, size_t len,
                        unsigned *restrict prio,
                        const struct timespec *restrict at) {
  return syscall_cp(277, mqd, msg, len, prio, at);
}


x86 assembly (clang, -O0):
<mq_timedreceive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x115,%edi
call   1030 <syscall_cp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_timedreceive>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x115,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @mq_timedreceive(i32 %0, i8* noalias %1, i64 %2, i32* noalias %3, %struct.timespec* noalias %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = load %struct.timespec*, %struct.timespec** %10
%16 = call i32 @syscall_cp(i32 277, i32 %11, i8* %12, i64 %13, i32* %14, %struct.timespec* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @mq_timedreceive(i32 %0, i8* noalias %1, i64 %2, i32* noalias %3, %struct.timespec* noalias %4) {
%6 = tail call i32 @syscall_cp(i32 277, i32 %0, i8* %1, i64 %2, i32* %3, %struct.timespec* %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int stream_output(char *buf, int sze, void *data) {
  FILE *outp;
  outp = (FILE *)data;
  fwrite(buf, sze, 1, outp);
  return 0;
}


x86 assembly (clang, -O0):
<stream_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_output>:
push   %rax
mov    %rdx,%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stream_output(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 %11, i32 1, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @stream_output(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fwrite(i8* %0, i32 %1, i32 1, i32* %4)
ret i32 0
}
int res_init() { return 0; }


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

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

LLVM IR (-O0):
define i32 @res_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @res_init() {
ret i32 0
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char str1[] = "abcdefg";
  char str2[] = "hijeklm";
  int idx = any(str1, str2);
  printf("%d\n", idx);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x14(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x67666564636261,%rax
mov    %rax,0x10(%rsp)
movabs $0x6d6c6b656a6968,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <any@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 29104508263162465, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 30799980980234600, i64* %2
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 1
}
void foo(int k) {
  volatile int *b = &k;
  *b = 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x5,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = alloca i32
store volatile i32 5, i32* %2
ret void
}
double form_volume(double length, double kuhn_length, double radius) {
  return 1.0;
}


x86 assembly (clang, -O0):
<form_volume>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_volume>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @form_volume(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @form_volume(double %0, double %1, double %2) {
ret double 1.000000e+00
}
/* Variables and functions */
double fabs(double);
bool fequal(double a, double b) {
  if (fabs(a - b) < 0.00001) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<fequal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1141 <fequal+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <fequal+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fequal>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @fequal(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = fcmp olt double %9, 1.000000e-05
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @fequal(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 1.000000e-05
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned short __min_unsigned_short(unsigned short x, unsigned short y) {
  return ((x) > (y) ? (y) : (x));
}


x86 assembly (clang, -O0):
<__min_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <__min_unsigned_short+0x2e>
movzwl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <__min_unsigned_short+0x35>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__min_unsigned_short>:
mov    %edi,%eax
cmp    %si,%ax
cmova  %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @__min_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @__min_unsigned_short(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ugt i16 %0, %1
%4 = select i1 %3, i16 %1, i16 %0
ret i16 %4
}
void kfree(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kfree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
char *xstrdup(char const *);
char *xstrmerge(char const *, char *);
char *local_getProperPath(const char *path) {
  char *properPath;
  size_t len = strlen(path);
  if (path[len - 1] != '/')
    properPath = xstrmerge(path, "/");
  else
    properPath = xstrdup(path);
  return properPath;
}


x86 assembly (clang, -O0):
<local_getProperPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     117b <local_getProperPath+0x4b>
mov    -0x8(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1040 <xstrmerge@plt>
mov    %rax,-0x10(%rbp)
jmp    1188 <local_getProperPath+0x58>
mov    -0x8(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_getProperPath>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    1149 <local_getProperPath+0x19>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <xstrdup@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xstrmerge@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @local_getProperPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %4
%9 = sub i64 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 47
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = call i8* @xstrmerge(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %16, i8** %3
br label %20
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = call i8* @xstrdup(i8* %18)
store i8* %19, i8** %3
br label %20
20: ; preds = %17, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @local_getProperPath(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 47
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i8* @xstrmerge(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i8* @xstrdup(i8* %0)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}
/* Variables and functions */
int descnonblock(int);
int univnonblock(int fd) { return descnonblock(fd); }


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

x86 assembly (clang, -O2):
<univnonblock>:
jmp    1030 <descnonblock@plt>

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

LLVM IR (-O2):
define i32 @univnonblock(i32 %0) {
%2 = tail call i32 @descnonblock(i32 %0)
ret i32 %2
}
double deg2arcsec(double x) { return (x * 3600.0); }


x86 assembly (clang, -O0):
<deg2arcsec>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2arcsec>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @deg2arcsec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.600000e+03
ret double %4
}

LLVM IR (-O2):
define double @deg2arcsec(double %0) {
%2 = fmul double %0, 3.600000e+03
ret double %2
}
int cmpres(const void *x, const void *y) {
  int *a, *b;
  a = *((int(*)[5])x);
  b = *((int(*)[5])y);
  return a[4] - b[4];
}


x86 assembly (clang, -O0):
<cmpres>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%eax
mov    -0x20(%rbp),%rcx
sub    0x10(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpres>:
mov    0x10(%rdi),%eax
sub    0x10(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @cmpres(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to [5 x i32]*
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
store i32* %9, i32** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to [5 x i32]*
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
store i32* %12, i32** %6
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 4
%15 = load i32, i32* %14
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 4
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @cmpres(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 16
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %1, i64 16
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
int HelpItem61(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem61() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem61() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void doExit(int code) { exit(code); }


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

x86 assembly (clang, -O2):
<doExit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @doExit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int getLineNumber();
int /*<<< orphan*/ stderr;
int yyerror(char *msg) {
  fprintf(stderr, "[ERRO] Linha %d: %s\n", getLineNumber(), msg);
  exit(3);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getLineNumber@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getLineNumber@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"[ERRO] Linha %d: %s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (...) @getLineNumber()
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"[ERRO] Linha %d: %s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (...) @getLineNumber()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0)
%5 = tail call i32 @exit(i32 3)
unreachable
}
int __test() {
  int x = 3, y = 4;
  return x && y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     112b <__test+0x2b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 1
}
/* Variables and functions */
int gAnd(int, int);
int gNot(int);
int gOr(int a, int b) { return gNot(gAnd(gNot(a), gNot(b))); }


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

x86 assembly (clang, -O2):
<gOr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <gNot@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <gNot@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <gAnd@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gNot@plt>

LLVM IR (-O0):
define i32 @gOr(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 = call i32 @gNot(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @gNot(i32 %7)
%9 = call i32 @gAnd(i32 %6, i32 %8)
%10 = call i32 @gNot(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @gOr(i32 %0, i32 %1) {
%3 = tail call i32 @gNot(i32 %0)
%4 = tail call i32 @gNot(i32 %1)
%5 = tail call i32 @gAnd(i32 %3, i32 %4)
%6 = tail call i32 @gNot(i32 %5)
ret i32 %6
}