#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_lifted_point(int n, int i, int j, int *point) {
  int fail, k;
  double fltpoint[n];
  fail = _ada_use_c2phc4c(747, &i, &j, fltpoint, 0);
  for (k = 0; k < n; k++)
    point[k] = (int)fltpoint[k];
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_get_lifted_point>:
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    -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    $0x2eb,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
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    119d <intcelcon_get_lifted_point+0x8d>
mov    -0x38(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%edx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    116b <intcelcon_get_lifted_point+0x5b>
mov    -0x1c(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_get_lifted_point>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %edi,%r15d
mov    %esi,-0x28(%rbp)
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    -0x28(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x2eb,%edi
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
test   %r15d,%r15d
jle    1212 <intcelcon_get_lifted_point+0x102>
cmp    $0x4,%r15d
jae    1171 <intcelcon_get_lifted_point+0x61>
xor    %ecx,%ecx
jmp    1200 <intcelcon_get_lifted_point+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_lifted_point+0x10f>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
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_lifted_point+0x90>
test   $0x1,%dl
je     11f0 <intcelcon_get_lifted_point+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_lifted_point+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_lifted_point+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_lifted_point+0xcb>
jmp    11f0 <intcelcon_get_lifted_point+0xe0>

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

LLVM IR (-O2):
define i32 @intcelcon_get_lifted_point(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = alloca i32
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = zext i32 %0 to i64
%8 = alloca double, i64 %7
%9 = call i32 @_ada_use_c2phc4c(i32 747, i32* %5, i32* %6, double* %8, i32 0)
%10 = icmp sgt i32 %0, 0
br i1 %10, label %11, label %81
11: ; preds = %4
%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* %3, 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* %3, 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* %3, 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* %3, 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, %4
ret i32 %9
}