#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_retrieve_mixed_cell(int n, int r, int i, int labels[],
                                  int *normal) {
  int fail, k;
  double dblnormal[n];
  fail = _ada_use_c2phc4c(756, &i, labels, dblnormal, 0);
  for (k = 0; k < n; k++)
    normal[k] = (int)dblnormal[k];
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_retrieve_mixed_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x2f4,%edi
lea    -0xc(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a1 <intcelcon_retrieve_mixed_cell+0x91>
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%edx
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    116f <intcelcon_retrieve_mixed_cell+0x5f>
mov    -0x24(%rbp),%eax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_retrieve_mixed_cell>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %edi,%r15d
mov    %edx,-0x24(%rbp)
mov    %edi,%r12d
mov    %rsp,%rbx
lea    0xf(,%r12,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x24(%rbp),%rsi
mov    $0x2f4,%edi
mov    %rcx,%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
test   %r15d,%r15d
jle    1212 <intcelcon_retrieve_mixed_cell+0x102>
cmp    $0x4,%r15d
jae    116d <intcelcon_retrieve_mixed_cell+0x5d>
xor    %ecx,%ecx
jmp    1200 <intcelcon_retrieve_mixed_cell+0xf0>
mov    %r12d,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     121f <intcelcon_retrieve_mixed_cell+0x10f>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvttpd2dq (%rbx,%rsi,8),%xmm0
cvttpd2dq 0x10(%rbx,%rsi,8),%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r14,%rsi,4)
cvttpd2dq 0x20(%rbx,%rsi,8),%xmm0
cvttpd2dq 0x30(%rbx,%rsi,8),%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,0x10(%r14,%rsi,4)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    11a0 <intcelcon_retrieve_mixed_cell+0x90>
test   $0x1,%dl
je     11f0 <intcelcon_retrieve_mixed_cell+0xe0>
cvttpd2dq (%rbx,%rsi,8),%xmm0
cvttpd2dq 0x10(%rbx,%rsi,8),%xmm1
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%r14,%rsi,4)
cmp    %r12,%rcx
je     1212 <intcelcon_retrieve_mixed_cell+0x102>
cs nopw 0x0(%rax,%rax,1)
nop
cvttsd2si (%rbx,%rcx,8),%edx
mov    %edx,(%r14,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%r12
jne    1200 <intcelcon_retrieve_mixed_cell+0xf0>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%dl
jne    11db <intcelcon_retrieve_mixed_cell+0xcb>
jmp    11f0 <intcelcon_retrieve_mixed_cell+0xe0>

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

LLVM IR (-O2):
define i32 @intcelcon_retrieve_mixed_cell(i32 %0, i32 %1, i32 %2, i32* %3, i32* nocapture writeonly %4) {
%6 = alloca i32
store i32 %2, i32* %6
%7 = zext i32 %0 to i64
%8 = alloca double, i64 %7
%9 = call i32 @_ada_use_c2phc4c(i32 756, i32* %6, i32* %3, double* %8, i32 0)
%10 = icmp sgt i32 %0, 0
br i1 %10, label %11, label %81
11: ; preds = %5
%12 = icmp ult i32 %0, 4
br i1 %12, label %71, label %13
13: ; preds = %11
%14 = and i64 %7, 4294967292
%15 = add nsw i64 %14, -4
%16 = lshr exact i64 %15, 2
%17 = add nuw nsw i64 %16, 1
%18 = and i64 %17, 1
%19 = icmp eq i64 %15, 0
br i1 %19, label %53, label %20
20: ; preds = %13
%21 = and i64 %17, 9223372036854775806
br label %22
22: ; preds = %22, %20
%23 = phi i64 [ 0, %20 ], [ %50, %22 ]
%24 = phi i64 [ 0, %20 ], [ %51, %22 ]
%25 = getelementptr inbounds double, double* %8, i64 %23
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = getelementptr inbounds double, double* %25, i64 2
%29 = bitcast double* %28 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = fptosi <2 x double> %27 to <2 x i32>
%32 = fptosi <2 x double> %30 to <2 x i32>
%33 = getelementptr inbounds i32, i32* %4, i64 %23
%34 = bitcast i32* %33 to <2 x i32>*
store <2 x i32> %31, <2 x i32>* %34
%35 = getelementptr inbounds i32, i32* %33, i64 2
%36 = bitcast i32* %35 to <2 x i32>*
store <2 x i32> %32, <2 x i32>* %36
%37 = or i64 %23, 4
%38 = getelementptr inbounds double, double* %8, i64 %37
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = getelementptr inbounds double, double* %38, i64 2
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = fptosi <2 x double> %40 to <2 x i32>
%45 = fptosi <2 x double> %43 to <2 x i32>
%46 = getelementptr inbounds i32, i32* %4, i64 %37
%47 = bitcast i32* %46 to <2 x i32>*
store <2 x i32> %44, <2 x i32>* %47
%48 = getelementptr inbounds i32, i32* %46, i64 2
%49 = bitcast i32* %48 to <2 x i32>*
store <2 x i32> %45, <2 x i32>* %49
%50 = add nuw i64 %23, 8
%51 = add i64 %24, 2
%52 = icmp eq i64 %51, %21
br i1 %52, label %53, label %22
53: ; preds = %22, %13
%54 = phi i64 [ 0, %13 ], [ %50, %22 ]
%55 = icmp eq i64 %18, 0
br i1 %55, label %69, label %56
56: ; preds = %53
%57 = getelementptr inbounds double, double* %8, i64 %54
%58 = bitcast double* %57 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = getelementptr inbounds double, double* %57, i64 2
%61 = bitcast double* %60 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = fptosi <2 x double> %59 to <2 x i32>
%64 = fptosi <2 x double> %62 to <2 x i32>
%65 = getelementptr inbounds i32, i32* %4, i64 %54
%66 = bitcast i32* %65 to <2 x i32>*
store <2 x i32> %63, <2 x i32>* %66
%67 = getelementptr inbounds i32, i32* %65, i64 2
%68 = bitcast i32* %67 to <2 x i32>*
store <2 x i32> %64, <2 x i32>* %68
br label %69
69: ; preds = %53, %56
%70 = icmp eq i64 %14, %7
br i1 %70, label %81, label %71
71: ; preds = %11, %69
%72 = phi i64 [ 0, %11 ], [ %14, %69 ]
br label %73
73: ; preds = %71, %73
%74 = phi i64 [ %79, %73 ], [ %72, %71 ]
%75 = getelementptr inbounds double, double* %8, i64 %74
%76 = load double, double* %75
%77 = fptosi double %76 to i32
%78 = getelementptr inbounds i32, i32* %4, i64 %74
store i32 %77, i32* %78
%79 = add nuw nsw i64 %74, 1
%80 = icmp eq i64 %79, %7
br i1 %80, label %81, label %73
81: ; preds = %73, %69, %5
ret i32 %9
}