#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_get_inner_normal(int n, int i, int *normal) {
  int *b, fail, k;
  double dblnormal[n];
  fail = _ada_use_c2phc4c(748, &i, b, dblnormal, 0);
  for (k = 0; k < n; k++)
    normal[k] = (int)dblnormal[k];
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_get_inner_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x2ec,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119a <intcelcon_get_inner_normal+0x8a>
mov    -0x38(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%edx
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <intcelcon_get_inner_normal+0x58>
mov    -0x1c(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_get_inner_normal>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %edi,%r15d
mov    %esi,-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    $0x2ec,%edi
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
test   %r15d,%r15d
jle    1212 <intcelcon_get_inner_normal+0x102>
cmp    $0x4,%r15d
jae    116a <intcelcon_get_inner_normal+0x5a>
xor    %ecx,%ecx
jmp    1200 <intcelcon_get_inner_normal+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_get_inner_normal+0x10f>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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_get_inner_normal+0x90>
test   $0x1,%dl
je     11f0 <intcelcon_get_inner_normal+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_get_inner_normal+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_get_inner_normal+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_get_inner_normal+0xcb>
jmp    11f0 <intcelcon_get_inner_normal+0xe0>

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

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