xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void vector_list_config_id_to_rgb(int32_t id, int32_t *red, int32_t *green,
                                  int32_t *blue) {
  *red = (id & 0xff0000) >> 16;
  *green = (id & 0x00ff00) >> 8;
  *blue = (id & 0x0000ff) >> 0;
}


x86 assembly (clang, -O0):
<vector_list_config_id_to_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
sar    $0x0,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_list_config_id_to_rgb>:
push   %rbx
mov    %edi,%eax
movzbl %ah,%ebx
movzbl %al,%edi
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rsi)
mov    %ebx,(%rdx)
mov    %edi,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @vector_list_config_id_to_rgb(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = and i32 %9, 16711680
%11 = ashr i32 %10, 16
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = and i32 %13, 65280
%15 = ashr i32 %14, 8
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = and i32 %17, 255
%19 = ashr i32 %18, 0
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @vector_list_config_id_to_rgb(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
store i32 %6, i32* %1
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
store i32 %8, i32* %2
%9 = and i32 %0, 255
store i32 %9, i32* %3
ret void
}
/* Variables and functions */
void *tm_fcs_init() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @tm_fcs_init() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @tm_fcs_init() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_dict();
int /*<<< orphan*/ test_list();
int /*<<< orphan*/ test_string();
int main(int argc, char **argv) {
  test_string();
  test_list();
  test_dict();
  printf("Passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <test_string@plt>
mov    $0x0,%al
call   1040 <test_list@plt>
mov    $0x0,%al
call   1050 <test_dict@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_string@plt>
xor    %eax,%eax
call   1040 <test_list@plt>
xor    %eax,%eax
call   1050 <test_dict@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"Passed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_string()
%4 = tail call i32 (...) @test_list()
%5 = tail call i32 (...) @test_dict()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vcall(float *, int);
void v3d(double *vec) {
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3d>:
sub    $0x18,%rsp
movsd  (%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movsd  0x8(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
movsd  0x10(%rdi),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v3d(double* %0) {
%2 = alloca double*
%3 = alloca [3 x float]
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fptrunc double %11 to float
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%20 = call i32 @vcall(float* %19, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3d(double* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load double, double* %0
%5 = fptrunc double %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = fptrunc double %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = fptrunc double %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 @vcall(float* %6, i32 3)
ret void
}
char *lib_strcpy(char *dest, const char *src) {
  char *ptr = dest;
  while (*src)
    *ptr++ = *src++;
  *ptr = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<lib_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <lib_strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1114 <lib_strcpy+0x14>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @lib_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from Toobo!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hello from Toobo!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Hello from Toobo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int is_valid_port(char *s) {
  int val = atoi(s);
  if (val >= 1024 && val <= 49151) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jl     114e <is_valid_port+0x3e>
cmpl   $0xbfff,-0x14(%rbp)
jg     114e <is_valid_port+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <is_valid_port+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_port>:
push   %rax
call   1030 <atoi@plt>
add    $0xfffffc00,%eax
xor    %ecx,%ecx
cmp    $0xbc00,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_valid_port(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -1024
%4 = icmp ult i32 %3, 48128
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ new_block_Tree(int /*<<< orphan*/);
void free_Tree_storage(void) { new_block_Tree(0); }


x86 assembly (clang, -O0):
<free_Tree_storage>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <new_block_Tree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_Tree_storage>:
xor    %edi,%edi
jmp    1030 <new_block_Tree@plt>

LLVM IR (-O0):
define void @free_Tree_storage() {
%1 = call i32 @new_block_Tree(i32 0)
ret void
}

LLVM IR (-O2):
define void @free_Tree_storage() {
%1 = tail call i32 @new_block_Tree(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetCurrentTicks();
int /*<<< orphan*/ InitNextTime();
void StartUpTimeAdjust(void) {
  GetCurrentTicks();
  InitNextTime();
}


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

x86 assembly (clang, -O2):
<StartUpTimeAdjust>:
push   %rax
xor    %eax,%eax
call   1040 <GetCurrentTicks@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <InitNextTime@plt>

LLVM IR (-O0):
define void @StartUpTimeAdjust() {
%1 = call i32 (...) @GetCurrentTicks()
%2 = call i32 (...) @InitNextTime()
ret void
}

LLVM IR (-O2):
define void @StartUpTimeAdjust() {
%1 = tail call i32 (...) @GetCurrentTicks()
%2 = tail call i32 (...) @InitNextTime()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h(int);
void main(int foo) {
  f(1);
  g(2);
  if (1) {
    h(3);
  } else {
    h(4);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x3,%edi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @f(i32 1)
%4 = call i32 @g(i32 2)
%5 = call i32 @h(i32 3)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @f(i32 1)
%3 = tail call i32 @g(i32 2)
%4 = tail call i32 @h(i32 3)
ret void
}
__attribute__((no)) int ferda(int x, int y) {
  if (x < y) {
    return x;
  } else
    return y;
}


x86 assembly (clang, -O0):
<ferda>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <ferda+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <ferda+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ferda(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sigaction *);
void delete_handler(struct sigaction *list_action) { free(list_action); }


x86 assembly (clang, -O0):
<delete_handler>:
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):
<delete_handler>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define void @delete_handler(%struct.sigaction* %0) {
%2 = alloca %struct.sigaction*
store %struct.sigaction* %0, %struct.sigaction** %2
%3 = load %struct.sigaction*, %struct.sigaction** %2
%4 = call i32 @free(%struct.sigaction* %3)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define void @delete_handler(%struct.sigaction* nocapture %0) {
%2 = tail call i32 @free(%struct.sigaction* %0)
ret void
}
/* Variables and functions */
double pow(float, float);
float sfGFP_LP(float sfGFP_con) {
  float coeff = (1 / 0.699);
  float y = 100.13 * pow(sfGFP_con, coeff);
  return y;
}


x86 assembly (clang, -O0):
<sfGFP_LP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfGFP_LP>:
push   %rax
movss  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sfGFP_LP(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 0x3FF6E3CCC0000000, float* %3
%5 = load float, float* %2
%6 = load float, float* %3
%7 = call double @pow(float %5, float %6)
%8 = fmul double 1.001300e+02, %7
%9 = fptrunc double %8 to float
store float %9, float* %4
%10 = load float, float* %4
ret float %10
}

LLVM IR (-O2):
define float @sfGFP_LP(float %0) {
%2 = tail call double @pow(float %0, float 0x3FF6E3CCC0000000)
%3 = fmul double %2, 1.001300e+02
%4 = fptrunc double %3 to float
ret float %4
}
int bits_get(const int x, int *bits) { return bits[x >> 5] >> (x & 31) & 1; }


x86 assembly (clang, -O0):
<bits_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_get>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bits_get(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 = load i32, i32* %3
%7 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %3
%12 = and i32 %11, 31
%13 = ashr i32 %10, %12
%14 = and i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @bits_get(i32 %0, i32* nocapture %1) {
%3 = ashr i32 %0, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %0, 31
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
scalar_t__ nrf_drv_usbd_errata_type_52840_eng_b();
scalar_t__ nrf_drv_usbd_errata_type_52840_eng_c();
scalar_t__ nrf_drv_usbd_errata_type_52840_eng_d();
bool nrf_drv_usbd_errata_187(void) {
  return (1 && (nrf_drv_usbd_errata_type_52840_eng_b() ||
                nrf_drv_usbd_errata_type_52840_eng_c() ||
                nrf_drv_usbd_errata_type_52840_eng_d()));
}


x86 assembly (clang, -O0):
<nrf_drv_usbd_errata_187>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nrf_drv_usbd_errata_type_52840_eng_b@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <nrf_drv_usbd_errata_187+0x4b>
mov    $0x0,%al
call   1050 <nrf_drv_usbd_errata_type_52840_eng_c@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    117b <nrf_drv_usbd_errata_187+0x4b>
mov    $0x0,%al
call   1040 <nrf_drv_usbd_errata_type_52840_eng_d@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_usbd_errata_187>:
push   %rbx
xor    %eax,%eax
call   1030 <nrf_drv_usbd_errata_type_52840_eng_b@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <nrf_drv_usbd_errata_187+0x2d>
xor    %eax,%eax
call   1050 <nrf_drv_usbd_errata_type_52840_eng_c@plt>
test   %rax,%rax
jne    115d <nrf_drv_usbd_errata_187+0x2d>
xor    %eax,%eax
call   1040 <nrf_drv_usbd_errata_type_52840_eng_d@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_187() {
%1 = call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_b()
%2 = icmp ne i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_c()
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_d()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_187() {
%1 = tail call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_b()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_c()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @nrf_drv_usbd_errata_type_52840_eng_d()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m512i;

/* Variables and functions */
int /*<<< orphan*/ _mm512_mullo_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m512i __attribute__((__target__("avx512dq")))
mm512_mullo_epi64_wrap(__m512i a, __m512i b) {
  return _mm512_mullo_epi64(a, b);
}


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

x86 assembly (clang, -O2):
<mm512_mullo_epi64_wrap>:
jmp    1030 <_mm512_mullo_epi64@plt>

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

LLVM IR (-O2):
define i32 @mm512_mullo_epi64_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm512_mullo_epi64(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct sonic_priv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __sonic_reset(struct sonic_priv *);
int __sonic_acquire(struct sonic_priv *sonic) {
  int ret = 0;
  if (ret)
    return ret;
  __sonic_reset(sonic);
  return ret;
}


x86 assembly (clang, -O0):
<__sonic_acquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1138 <__sonic_acquire+0x28>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <__sonic_acquire+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <__sonic_reset@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.sonic_priv = type { i32 }
define i32 @__sonic_acquire(%struct.sonic_priv* %0) {
%2 = tail call i32 @__sonic_reset(%struct.sonic_priv* %0)
ret i32 0
}
int main(int argc, char *argv[], char *envp[]) { return (1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
size_t right_child(int node) { return (2 * node) + 2; }


x86 assembly (clang, -O0):
<right_child>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
cltq
ret

LLVM IR (-O0):
define i64 @right_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 2
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @right_child(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *calloc(size_t, size_t);
void *xCalloc(size_t nmemb, size_t size) {
  void *data = calloc(nmemb, size);
  if (!data) {
    assert(0);
  }
  return data;
}


x86 assembly (clang, -O0):
<xCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xCalloc+0x33>
xor    %edi,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xCalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xCalloc+0x15>
xor    %edi,%edi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memory_pressure_clr();
int /*<<< orphan*/ memory_pressure_set();
void cfs_memory_pressure_restore(int old) {
  if (old) {
    memory_pressure_set();
  } else {
    memory_pressure_clr();
  }
}


x86 assembly (clang, -O0):
<cfs_memory_pressure_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <cfs_memory_pressure_restore+0x21>
mov    $0x0,%al
call   1030 <memory_pressure_set@plt>
jmp    1148 <cfs_memory_pressure_restore+0x28>
mov    $0x0,%al
call   1040 <memory_pressure_clr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_memory_pressure_restore>:
xor    %eax,%eax
test   %edi,%edi
je     112b <cfs_memory_pressure_restore+0xb>
jmp    1030 <memory_pressure_set@plt>
jmp    1040 <memory_pressure_clr@plt>

LLVM IR (-O0):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @memory_pressure_set()
br label %9
7: ; preds = %1
%8 = call i32 (...) @memory_pressure_clr()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @cfs_memory_pressure_restore(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @memory_pressure_set()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_pressure_clr()
br label %7
7: ; preds = %5, %3
ret void
}
void foo4(int j, int a[j]) {}


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

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

LLVM IR (-O0):
define void @foo4(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 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @foo4(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_d4();
int /*<<< orphan*/ take_struct_d4(int /*<<< orphan*/);
void test_struct_d4() { take_struct_d4(return_struct_d4()); }


x86 assembly (clang, -O0):
<test_struct_d4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_d4@plt>
mov    %eax,%edi
call   1030 <take_struct_d4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_d4>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_d4@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_d4@plt>

LLVM IR (-O0):
define void @test_struct_d4() {
%1 = call i32 (...) @return_struct_d4()
%2 = call i32 @take_struct_d4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_d4() {
%1 = tail call i32 (...) @return_struct_d4()
%2 = tail call i32 @take_struct_d4(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *calloc(int, size_t);
void *libopm_calloc(size_t bytes) {
  void *ret = calloc(1, bytes);
  assert(ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<libopm_calloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @libopm_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @libopm_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
long utilities_lmin(long l0, long l1) {
  if (l0 < l1)
    return l0;
  else
    return l1;
}


x86 assembly (clang, -O0):
<utilities_lmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <utilities_lmin+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <utilities_lmin+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilities_lmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @utilities_lmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
scalar_t__ roundf(float);
long long llroundf(float x) { return (long long)roundf(x); }


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

x86 assembly (clang, -O2):
<llroundf>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define i64 @llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @roundf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llroundf(float %0) {
%2 = tail call i64 @roundf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ADCIntClear(unsigned long ulBase, unsigned long ulSequenceNum) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  DEBUG_ASSERT(ulSequenceNum < 4);
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) = 1 << ulSequenceNum;
}


x86 assembly (clang, -O0):
<ADCIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <ADCIntClear+0x31>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x4,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,0xc(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ADCIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = icmp ult i64 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @DEBUG_ASSERT(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
%20 = shl i32 1, %19
%21 = sext i32 %20 to i64
%22 = load i64, i64* %3
%23 = add i64 %22, 12
%24 = inttoptr i64 %23 to i64*
store volatile i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
define void @ADCIntClear(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = trunc i64 %1 to i32
%11 = shl nuw i32 1, %10
%12 = sext i32 %11 to i64
%13 = add i64 %0, 12
%14 = inttoptr i64 %13 to i64*
store volatile i64 %12, i64* %14
ret void
}
void _farpokeb(unsigned short selector, unsigned long offset,
               unsigned char value) {
  __asm__ __volatile__("movw %w0,%%fs\n"
                       "	.byte 0x64 \n"
                       "	movb %b1,(%k2)"
                       :
                       : "rm"(selector), "qi"(value), "r"(offset));
}


x86 assembly (clang, -O0):
<_farpokeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %dx,-0x14(%rbp)
mov    -0x14(%rbp),%fs
mov    %al,%fs:(%ecx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farpokeb>:
mov    %di,-0x2(%rsp)
mov    -0x2(%rsp),%fs
mov    %dl,%fs:(%esi)
ret

LLVM IR (-O0):
define void @_farpokeb(i16 zeroext %0, i64 %1, i8 zeroext %2) {
%4 = alloca i16
%5 = alloca i64
%6 = alloca i8
store i16 %0, i16* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i16, i16* %4
%8 = load i8, i8* %6
%9 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @_farpokeb(i16 zeroext %0, i64 %1, i8 zeroext %2) {
tail call void asm sideeffect "movw ${0:w},%fs\0A\09.byte 0x64 \0A\09movb ${1:b},(${2:k})", "rm,qi,r,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erase();
char getch();
int /*<<< orphan*/ printw(char *);
void waitForUnpause() {
  erase();
  printw("the Game is in pause\n");
  while (getch() != 'p')
    ;
}


x86 assembly (clang, -O0):
<waitForUnpause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <erase@plt>
lea    0xebe(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%eax
cmp    $0x70,%eax
je     115f <waitForUnpause+0x2f>
jmp    1147 <waitForUnpause+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForUnpause>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
lea    0xec1(%rip),%rdi
call   1040 <printw@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getch@plt>
cmp    $0x70,%al
jne    1150 <waitForUnpause+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"the Game is in pause\0A\00"
define void @waitForUnpause() {
%1 = call i32 (...) @erase()
%2 = call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getch()
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 112
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"the Game is in pause\0A\00"
define void @waitForUnpause() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = tail call signext i8 (...) @getch()
%5 = icmp eq i8 %4, 112
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
int test_imm_29int8_reg(signed char val) {
  return ((val) & (0x29 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_29int8_reg(i8 signext %0) {
%2 = and i8 %0, 41
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double grib_op_lt_d(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<grib_op_lt_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_lt_d>:
cmpltsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_lt_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @grib_op_lt_d(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
int abs(int v) {
  if (v < 0)
    return -v;
  return v;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
__int128_t __attribute__((no)) shift_53_i(int data) {
  return (__int128_t)data << 53;
}


x86 assembly (clang, -O0):
<shift_53_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
shld   $0x35,%rcx,%rax
shl    $0x35,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_53_i>:
movslq %edi,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
shld   $0x35,%rax,%rdx
shl    $0x35,%rax
ret

LLVM IR (-O0):
define { i64, i64 } @shift_53_i(i32 %0) {
%2 = alloca i128
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i128
%6 = shl i128 %5, 53
store i128 %6, i128* %2
%7 = bitcast i128* %2 to { i64, i64 }*
%8 = load { i64, i64 }, { i64, i64 }* %7
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @shift_53_i(i32 %0) {
%2 = sext i32 %0 to i128
%3 = shl nsw i128 %2, 53
%4 = trunc i128 %3 to i64
%5 = lshr i128 %3, 64
%6 = trunc i128 %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %4, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
/* Variables and functions */
int /*<<< orphan*/ comm_close_connection();
int /*<<< orphan*/ comm_close_server();
void comm_cleanup() {
  comm_close_connection();
  comm_close_server();
}


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

x86 assembly (clang, -O2):
<comm_cleanup>:
push   %rax
xor    %eax,%eax
call   1040 <comm_close_connection@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <comm_close_server@plt>

LLVM IR (-O0):
define void @comm_cleanup() {
%1 = call i32 (...) @comm_close_connection()
%2 = call i32 (...) @comm_close_server()
ret void
}

LLVM IR (-O2):
define void @comm_cleanup() {
%1 = tail call i32 (...) @comm_close_connection()
%2 = tail call i32 (...) @comm_close_server()
ret void
}
/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ log_show_location(int);
int parse_boolean(char const *);
int log_show_location_from_string(const char *e) {
  int t;
  if ((t = parse_boolean(e)) < 0)
    return -EINVAL;
  log_show_location(t);
  return 0;
}


x86 assembly (clang, -O0):
<log_show_location_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <parse_boolean@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1154 <log_show_location_from_string+0x34>
xor    %eax,%eax
mov    0x2e96(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <log_show_location_from_string+0x43>
mov    -0x14(%rbp),%edi
call   1030 <log_show_location@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_show_location_from_string>:
push   %rax
call   1040 <parse_boolean@plt>
test   %eax,%eax
js     1135 <log_show_location_from_string+0x15>
mov    %eax,%edi
call   1030 <log_show_location@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea4(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @log_show_location_from_string(i8* %0) {
%2 = tail call i32 @parse_boolean(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %1
%8 = tail call i32 @log_show_location(i32 %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
void copia(void) {
  int i = 0;
  extern char linea[], linea_max[];
  while (1) {
    linea_max[i] = linea[i];
    if (linea_max[i] == '\0')
      break;
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2eb4(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
mov    0x2ea6(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1144 <copia+0x44>
jmp    1152 <copia+0x52>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
xor    %eax,%eax
mov    0x2ee7(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copia+0x10>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %17
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %8
store i8 %6, i8* %9
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
br label %20
17: ; preds = %2
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %2
20: ; preds = %16
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ %7, %1 ], [ 0, %0 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ read_and_execute();
int main(void) { return read_and_execute() ? 0 : -1; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @read_and_execute()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @read_and_execute()
%2 = icmp eq i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}