#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_append_mixed_cell(int n, int r, int k, int labels[],
                                int *normal) {
  int d[3], fail, i;
  double dblnormal[n];
  for (i = 0; i < n; i++)
    dblnormal[i] = (double)normal[i];
  d[0] = r;
  d[1] = n;
  d[2] = k;
  fail = _ada_use_c2phc4c(754, d, labels, dblnormal, 0);
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_append_mixed_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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,-0x40(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118b <intcelcon_append_mixed_cell+0x7b>
mov    -0x50(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cvtsi2sdl (%rcx,%rdx,4),%xmm0
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1157 <intcelcon_append_mixed_cell+0x47>
mov    -0x50(%rbp),%rcx
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x2f2,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x40(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_append_mixed_cell>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%r14
mov    %edi,%r9d
mov    %rsp,%r11
lea    0xf(,%r9,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r11
mov    %r11,%rsp
test   %edi,%edi
jle    1208 <intcelcon_append_mixed_cell+0xf8>
cmp    $0x4,%edi
jae    114c <intcelcon_append_mixed_cell+0x3c>
xor    %ebx,%ebx
jmp    11f0 <intcelcon_append_mixed_cell+0xe0>
mov    %r9d,%ebx
and    $0xfffffffc,%ebx
lea    -0x4(%rbx),%rax
mov    %rax,%r10
shr    $0x2,%r10
add    $0x1,%r10
test   %rax,%rax
je     1236 <intcelcon_append_mixed_cell+0x126>
mov    %r10,%r15
and    $0xfffffffffffffffe,%r15
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvtdq2pd (%r8,%rax,4),%xmm0
cvtdq2pd 0x8(%r8,%rax,4),%xmm1
movaps %xmm0,(%r11,%rax,8)
movaps %xmm1,0x10(%r11,%rax,8)
cvtdq2pd 0x10(%r8,%rax,4),%xmm0
cvtdq2pd 0x18(%r8,%rax,4),%xmm1
movapd %xmm0,0x20(%r11,%rax,8)
movaps %xmm1,0x30(%r11,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%r15
jne    1180 <intcelcon_append_mixed_cell+0x70>
test   $0x1,%r10b
je     11dc <intcelcon_append_mixed_cell+0xcc>
cvtdq2pd (%r8,%rax,4),%xmm0
cvtdq2pd 0x8(%r8,%rax,4),%xmm1
movapd %xmm0,(%r11,%rax,8)
movaps %xmm1,0x10(%r11,%rax,8)
cmp    %r9,%rbx
je     1208 <intcelcon_append_mixed_cell+0xf8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sdl (%r8,%rbx,4),%xmm0
movsd  %xmm0,(%r11,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r9
jne    11f0 <intcelcon_append_mixed_cell+0xe0>
mov    %esi,-0x24(%rbp)
mov    %edi,-0x20(%rbp)
mov    %edx,-0x1c(%rbp)
lea    -0x24(%rbp),%rsi
mov    $0x2f2,%edi
mov    %rcx,%rdx
mov    %r11,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %r14,%rsp
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
test   $0x1,%r10b
jne    11c3 <intcelcon_append_mixed_cell+0xb3>
jmp    11dc <intcelcon_append_mixed_cell+0xcc>

LLVM IR (-O0):
define i32 @intcelcon_append_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 [3 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = 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
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %14
%19 = alloca double, i64 %17
store i64 %17, i64* %15
store i32 0, i32* %13
br label %20
20: ; preds = %34, %5
%21 = load i32, i32* %13
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %37
24: ; preds = %20
%25 = load i32*, i32** %10
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = sitofp i32 %29 to double
%31 = load i32, i32* %13
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %19, i64 %32
store double %30, double* %33
br label %34
34: ; preds = %24
%35 = load i32, i32* %13
%36 = add nsw i32 %35, 1
store i32 %36, i32* %13
br label %20
37: ; preds = %20
%38 = load i32, i32* %7
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %38, i32* %39
%40 = load i32, i32* %6
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %40, i32* %41
%42 = load i32, i32* %8
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %42, i32* %43
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%45 = load i32*, i32** %9
%46 = call i32 @_ada_use_c2phc4c(i32 754, i32* %44, i32* %45, double* %19, i32 0)
store i32 %46, i32* %12
%47 = load i32, i32* %12
%48 = load i8*, i8** %14
ret i32 %47
}

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