#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 celcon_get_inner_normal(int, int, double *);
int celcon_get_point_in_cell(int, int, int, int, double *);
int celcon_mixed_volume(int, int *);
int celcon_number_of_points_in_cell(int, int, int *);
int celcon_retrieve_mixed_cell(int, int, int, int *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int query_cell(int n, int r, int *cellnb) {
  int k, fail, *b, i, j, mv, nl[r], kk;
  double *c, normal[n], pt[n];
  printf("Give a cell number : ");
  scanf("%d", &k);
  fail = celcon_get_inner_normal(n, k, normal);
  if (fail == 1)
    printf("an error happened...\n");
  else {
    *cellnb = k;
    printf("inner normal for cell %d :\n", k);
    for (i = 0; i < n; i++)
      printf("%.15le\n", normal[i]);
    fail = celcon_number_of_points_in_cell(k, r, nl);
    printf("number of points in supports :");
    for (i = 0; i < r; i++)
      printf(" %d", nl[i]);
    printf("\n");
    printf("points in the supports :\n");
    for (i = 0; i < r; i++) {
      for (j = 0; j < nl[i]; j++) {
        fail = celcon_get_point_in_cell(n, k, i + 1, j + 1, pt);
        for (kk = 0; kk < n - 1; kk++)
          printf(" %d", (int)pt[kk]);
        printf(" %.15le\n", pt[n - 1]);
      }
    }
    fail = celcon_mixed_volume(k, &mv);
    printf("mixed volume : %d\n", mv);
    {
      int cl[1 + r + 2 * n];
      double inner_normal[n];
      fail = celcon_retrieve_mixed_cell(n, r, k, cl, inner_normal);
      printf("the inner normal for cell %d : \n", k);
      for (i = 0; i < n; i++)
        printf(" %.15le\n", inner_normal[i]);
      printf("total number of points in supports : %d\n", cl[0]);
      printf("number of points in supports : ");
      for (i = 1; i <= r; i++)
        printf(" %d", cl[i]);
      printf("\n");
      printf("labels of points : ");
      kk = r;
      for (i = 1; i <= r; i++) {
        for (j = 0; j < cl[i]; j++)
          printf(" %d", cl[++kk]);
        printf(" | ");
      }
      printf("\n");
    }
  }
  return fail;
}


x86 assembly (clang, -O0):
<query_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe61(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x80(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <celcon_get_inner_normal@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    123f <query_cell+0xcf>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15dc <query_cell+0x46c>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%esi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1295 <query_cell+0x125>
mov    -0x80(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe06(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1260 <query_cell+0xf0>
mov    -0x90(%rbp),%rdx
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <celcon_number_of_points_in_cell@plt>
mov    %eax,-0x18(%rbp)
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12f5 <query_cell+0x185>
mov    -0x90(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12bf <query_cell+0x14f>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13eb <query_cell+0x27b>
movl   $0x0,-0x28(%rbp)
mov    -0x90(%rbp),%rcx
mov    -0x28(%rbp),%eax
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    13d8 <query_cell+0x268>
mov    -0x88(%rbp),%r8
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
call   1060 <celcon_get_point_in_cell@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13a7 <query_cell+0x237>
mov    -0x88(%rbp),%rax
movslq -0x44(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%esi
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    136a <query_cell+0x1fa>
mov    -0x88(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xcc2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    132b <query_cell+0x1bb>
jmp    13dd <query_cell+0x26d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1318 <query_cell+0x1a8>
mov    -0x14(%rbp),%edi
lea    -0x2c(%rbp),%rsi
call   1070 <celcon_mixed_volume@plt>
mov    %eax,-0x18(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xc8a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    0x1(%rax,%rcx,2),%eax
mov    %rsp,%rcx
mov    %rcx,-0x68(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%r8
sub    %rdx,%r8
mov    %r8,-0x98(%rbp)
mov    %r8,%rsp
mov    %rax,-0x78(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1090 <celcon_retrieve_mixed_cell@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xc23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14c4 <query_cell+0x354>
mov    -0x98(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xbd6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    148c <query_cell+0x31c>
mov    -0xa0(%rbp),%rax
mov    (%rax),%esi
lea    0xbee(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1526 <query_cell+0x3b6>
mov    -0xa0(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14f0 <query_cell+0x380>
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbd0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     15c7 <query_cell+0x457>
movl   $0x0,-0x28(%rbp)
mov    -0xa0(%rbp),%rcx
mov    -0x28(%rbp),%eax
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    15ab <query_cell+0x43b>
mov    -0xa0(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xad1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1562 <query_cell+0x3f2>
lea    0xb6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    154f <query_cell+0x3df>
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    -0x18(%rbp),%eax
mov    -0x38(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_cell>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r15
mov    %edi,%ebx
mov    %rsp,-0x70(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %esi,%eax
mov    %rsp,%rcx
mov    %rax,-0x78(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %edi,%r12d
mov    %rsp,%r13
lea    0xf(,%r12,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r14
mov    %rax,-0x88(%rbp)
sub    %rax,%r14
mov    %r14,%rsp
lea    0xe04(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe48(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x2c(%rbp),%esi
mov    %ebx,%edi
mov    %r13,%rdx
call   1060 <celcon_get_inner_normal@plt>
cmp    $0x1,%eax
jne    123f <query_cell+0xaf>
lea    0xee0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
mov    -0x70(%rbp),%rcx
jmp    15bf <query_cell+0x42f>
mov    -0x2c(%rbp),%esi
mov    %esi,(%r15)
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,-0x50(%rbp)
test   %ebx,%ebx
jle    128a <query_cell+0xfa>
xor    %ebx,%ebx
lea    0xdf2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x0(%r13,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1270 <query_cell+0xe0>
mov    %r12,-0x80(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%rbx
mov    %ebx,%esi
mov    -0x40(%rbp),%r13
mov    %r13,%rdx
call   1050 <celcon_number_of_points_in_cell@plt>
lea    0xd88(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    13cb <query_cell+0x23b>
lea    0xd91(%rip),%r15
xor    %ebx,%ebx
mov    -0x78(%rbp),%r12
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    12d0 <query_cell+0x140>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdfa(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x38(%rbp)
jle    13e1 <query_cell+0x251>
mov    %r13,%rsi
mov    -0x50(%rbp),%rax
lea    -0x1(%rax),%r12d
movslq %r12d,%rax
mov    %rax,-0x90(%rbp)
lea    0xd2d(%rip),%r13
xor    %eax,%eax
mov    -0x50(%rbp),%rbx
jmp    1341 <query_cell+0x1b1>
nopl   0x0(%rax)
mov    -0x48(%rbp),%rdx
mov    %rdx,%rax
cmp    -0x78(%rbp),%rdx
je     13e1 <query_cell+0x251>
lea    0x1(%rax),%rdx
mov    %rdx,-0x48(%rbp)
cmpl   $0x0,(%rsi,%rax,4)
jle    1330 <query_cell+0x1a0>
xor    %ecx,%ecx
mov    %rax,-0x58(%rbp)
jmp    138b <query_cell+0x1fb>
nopw   0x0(%rax,%rax,1)
mov    -0x90(%rbp),%rax
movsd  (%r14,%rax,8),%xmm0
lea    0xce1(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%ecx
cmp    (%rsi,%rax,4),%ecx
jge    1330 <query_cell+0x1a0>
mov    -0x2c(%rbp),%esi
add    $0x1,%ecx
mov    %ebx,%edi
mov    -0x48(%rbp),%rdx
mov    %ecx,-0x60(%rbp)
mov    %r14,%r8
call   1080 <celcon_get_point_in_cell@plt>
cmp    $0x2,%ebx
jl     1360 <query_cell+0x1d0>
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
cvttsd2si (%r14,%r15,8),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r12
jne    13b0 <query_cell+0x220>
jmp    1360 <query_cell+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd17(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%edi
lea    -0x64(%rbp),%rsi
call   1090 <celcon_mixed_volume@plt>
mov    -0x64(%rbp),%esi
lea    0xc67(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,-0x58(%rbp)
mov    -0x38(%rbp),%r13
mov    -0x50(%rbp),%rbx
lea    0x1(%r13,%rbx,2),%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%r15
sub    -0x88(%rbp),%r15
mov    %r15,%rsp
mov    -0x2c(%rbp),%edx
mov    %ebx,%edi
mov    %r13d,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   10b0 <celcon_retrieve_mixed_cell@plt>
mov    %eax,-0x40(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xc20(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
mov    -0x80(%rbp),%r12
jle    148d <query_cell+0x2fd>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r15,%rbx,8),%xmm0
lea    0xbd8(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1470 <query_cell+0x2e0>
mov    (%r14),%esi
lea    0xbfb(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc16(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r13d,%r13d
jle    1592 <query_cell+0x402>
lea    0x1(%r13),%eax
mov    %eax,%r12d
mov    $0x1,%ebx
lea    0xb89(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    14d0 <query_cell+0x340>
mov    %r12,-0x60(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xbdf(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r13d,%r13d
jle    15aa <query_cell+0x41a>
lea    0x4(%r14),%rax
mov    %rax,-0x48(%rbp)
mov    $0x1,%r12d
lea    0xb30(%rip),%rbx
jmp    1548 <query_cell+0x3b8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xbb8(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r12
cmp    -0x60(%rbp),%r12
je     15aa <query_cell+0x41a>
cmpl   $0x0,(%r14,%r12,4)
jle    1530 <query_cell+0x3a0>
mov    %r13,-0x38(%rbp)
movslq %r13d,%rax
mov    -0x48(%rbp),%rcx
lea    (%rcx,%rax,4),%r13
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%r15,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r15
cmp    (%r14,%r12,4),%r15d
jl     1570 <query_cell+0x3e0>
mov    -0x38(%rbp),%r13
add    %r15d,%r13d
jmp    1530 <query_cell+0x3a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xb38(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x58(%rbp),%rsp
mov    -0x70(%rbp),%rcx
mov    -0x40(%rbp),%eax
mov    %rcx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Give a cell number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"an error happened...\0A\00"
@.str.3 = [28 x i8] c"inner normal for cell %d :\0A\00"
@.str.4 = [8 x i8] c"%.15le\0A\00"
@.str.5 = [31 x i8] c"number of points in supports :\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [26 x i8] c"points in the supports :\0A\00"
@.str.9 = [9 x i8] c" %.15le\0A\00"
@.str.10 = [19 x i8] c"mixed volume : %d\0A\00"
@.str.11 = [33 x i8] c"the inner normal for cell %d : \0A\00"
@.str.12 = [41 x i8] c"total number of points in supports : %d\0A\00"
@.str.13 = [32 x i8] c"number of points in supports : \00"
@.str.14 = [20 x i8] c"labels of points : \00"
@.str.15 = [4 x i8] c" | \00"
define i32 @query_cell(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 i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
%16 = alloca double*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i8*
%20 = alloca i64
%21 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %13
%25 = alloca i32, i64 %23
store i64 %23, i64* %14
%26 = load i32, i32* %4
%27 = zext i32 %26 to i64
%28 = alloca double, i64 %27
store i64 %27, i64* %17
%29 = load i32, i32* %4
%30 = zext i32 %29 to i64
%31 = alloca double, i64 %30
store i64 %30, i64* %18
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%34 = load i32, i32* %4
%35 = load i32, i32* %7
%36 = call i32 @celcon_get_inner_normal(i32 %34, i32 %35, double* %28)
store i32 %36, i32* %8
%37 = load i32, i32* %8
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %216
41: ; preds = %3
%42 = load i32, i32* %7
%43 = load i32*, i32** %6
store i32 %42, i32* %43
%44 = load i32, i32* %7
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %44)
store i32 0, i32* %10
br label %46
46: ; preds = %56, %41
%47 = load i32, i32* %10
%48 = load i32, i32* %4
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %59
50: ; preds = %46
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %28, i64 %52
%54 = load double, double* %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %54)
br label %56
56: ; preds = %50
%57 = load i32, i32* %10
%58 = add nsw i32 %57, 1
store i32 %58, i32* %10
br label %46
59: ; preds = %46
%60 = load i32, i32* %7
%61 = load i32, i32* %5
%62 = call i32 @celcon_number_of_points_in_cell(i32 %60, i32 %61, i32* %25)
store i32 %62, i32* %8
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %10
br label %64
64: ; preds = %74, %59
%65 = load i32, i32* %10
%66 = load i32, i32* %5
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %77
68: ; preds = %64
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %25, i64 %70
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %68
%75 = load i32, i32* %10
%76 = add nsw i32 %75, 1
store i32 %76, i32* %10
br label %64
77: ; preds = %64
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %10
br label %80
80: ; preds = %126, %77
%81 = load i32, i32* %10
%82 = load i32, i32* %5
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %129
84: ; preds = %80
store i32 0, i32* %11
br label %85
85: ; preds = %122, %84
%86 = load i32, i32* %11
%87 = load i32, i32* %10
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %25, i64 %88
%90 = load i32, i32* %89
%91 = icmp slt i32 %86, %90
br i1 %91, label %92, label %125
92: ; preds = %85
%93 = load i32, i32* %4
%94 = load i32, i32* %7
%95 = load i32, i32* %10
%96 = add nsw i32 %95, 1
%97 = load i32, i32* %11
%98 = add nsw i32 %97, 1
%99 = call i32 @celcon_get_point_in_cell(i32 %93, i32 %94, i32 %96, i32 %98, double* %31)
store i32 %99, i32* %8
store i32 0, i32* %15
br label %100
100: ; preds = %112, %92
%101 = load i32, i32* %15
%102 = load i32, i32* %4
%103 = sub nsw i32 %102, 1
%104 = icmp slt i32 %101, %103
br i1 %104, label %105, label %115
105: ; preds = %100
%106 = load i32, i32* %15
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %31, i64 %107
%109 = load double, double* %108
%110 = fptosi double %109 to i32
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %110)
br label %112
112: ; preds = %105
%113 = load i32, i32* %15
%114 = add nsw i32 %113, 1
store i32 %114, i32* %15
br label %100
115: ; preds = %100
%116 = load i32, i32* %4
%117 = sub nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %31, i64 %118
%120 = load double, double* %119
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %120)
br label %122
122: ; preds = %115
%123 = load i32, i32* %11
%124 = add nsw i32 %123, 1
store i32 %124, i32* %11
br label %85
125: ; preds = %85
br label %126
126: ; preds = %125
%127 = load i32, i32* %10
%128 = add nsw i32 %127, 1
store i32 %128, i32* %10
br label %80
129: ; preds = %80
%130 = load i32, i32* %7
%131 = call i32 @celcon_mixed_volume(i32 %130, i32* %12)
store i32 %131, i32* %8
%132 = load i32, i32* %12
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %132)
%134 = load i32, i32* %5
%135 = add nsw i32 1, %134
%136 = load i32, i32* %4
%137 = mul nsw i32 2, %136
%138 = add nsw i32 %135, %137
%139 = zext i32 %138 to i64
%140 = call i8* @llvm.stacksave()
store i8* %140, i8** %19
%141 = alloca i32, i64 %139
store i64 %139, i64* %20
%142 = load i32, i32* %4
%143 = zext i32 %142 to i64
%144 = alloca double, i64 %143
store i64 %143, i64* %21
%145 = load i32, i32* %4
%146 = load i32, i32* %5
%147 = load i32, i32* %7
%148 = call i32 @celcon_retrieve_mixed_cell(i32 %145, i32 %146, i32 %147, i32* %141, double* %144)
store i32 %148, i32* %8
%149 = load i32, i32* %7
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i32 %149)
store i32 0, i32* %10
br label %151
151: ; preds = %161, %129
%152 = load i32, i32* %10
%153 = load i32, i32* %4
%154 = icmp slt i32 %152, %153
br i1 %154, label %155, label %164
155: ; preds = %151
%156 = load i32, i32* %10
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %144, i64 %157
%159 = load double, double* %158
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %159)
br label %161
161: ; preds = %155
%162 = load i32, i32* %10
%163 = add nsw i32 %162, 1
store i32 %163, i32* %10
br label %151
164: ; preds = %151
%165 = getelementptr inbounds i32, i32* %141, i64 0
%166 = load i32, i32* %165
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i32 %166)
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %10
br label %169
169: ; preds = %179, %164
%170 = load i32, i32* %10
%171 = load i32, i32* %5
%172 = icmp sle i32 %170, %171
br i1 %172, label %173, label %182
173: ; preds = %169
%174 = load i32, i32* %10
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i32, i32* %141, i64 %175
%177 = load i32, i32* %176
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %177)
br label %179
179: ; preds = %173
%180 = load i32, i32* %10
%181 = add nsw i32 %180, 1
store i32 %181, i32* %10
br label %169
182: ; preds = %169
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%185 = load i32, i32* %5
store i32 %185, i32* %15
store i32 1, i32* %10
br label %186
186: ; preds = %210, %182
%187 = load i32, i32* %10
%188 = load i32, i32* %5
%189 = icmp sle i32 %187, %188
br i1 %189, label %190, label %213
190: ; preds = %186
store i32 0, i32* %11
br label %191
191: ; preds = %205, %190
%192 = load i32, i32* %11
%193 = load i32, i32* %10
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds i32, i32* %141, i64 %194
%196 = load i32, i32* %195
%197 = icmp slt i32 %192, %196
br i1 %197, label %198, label %208
198: ; preds = %191
%199 = load i32, i32* %15
%200 = add nsw i32 %199, 1
store i32 %200, i32* %15
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i32, i32* %141, i64 %201
%203 = load i32, i32* %202
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %203)
br label %205
205: ; preds = %198
%206 = load i32, i32* %11
%207 = add nsw i32 %206, 1
store i32 %207, i32* %11
br label %191
208: ; preds = %191
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
br label %210
210: ; preds = %208
%211 = load i32, i32* %10
%212 = add nsw i32 %211, 1
store i32 %212, i32* %10
br label %186
213: ; preds = %186
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%215 = load i8*, i8** %19
br label %216
216: ; preds = %213, %39
%217 = load i32, i32* %8
%218 = load i8*, i8** %13
ret i32 %217
}

LLVM IR (-O2):
@.str = [22 x i8] c"Give a cell number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"inner normal for cell %d :\0A\00"
@.str.4 = [8 x i8] c"%.15le\0A\00"
@.str.5 = [31 x i8] c"number of points in supports :\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.9 = [9 x i8] c" %.15le\0A\00"
@.str.10 = [19 x i8] c"mixed volume : %d\0A\00"
@.str.11 = [33 x i8] c"the inner normal for cell %d : \0A\00"
@.str.12 = [41 x i8] c"total number of points in supports : %d\0A\00"
@.str.13 = [32 x i8] c"number of points in supports : \00"
@.str.14 = [20 x i8] c"labels of points : \00"
@.str.15 = [4 x i8] c" | \00"
@str = [25 x i8] c"points in the supports :\00"
@str.16 = [21 x i8] c"an error happened...\00"
define i32 @query_cell(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = zext i32 %1 to i64
%9 = tail call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = zext i32 %0 to i64
%12 = alloca double, i64 %11
%13 = alloca double, i64 %11
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%16 = load i32, i32* %4
%17 = call i32 @celcon_get_inner_normal(i32 %0, i32 %16, double* %12)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
br label %156
21: ; preds = %3
%22 = load i32, i32* %4
store i32 %22, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = icmp sgt i32 %0, 0
br i1 %24, label %25, label %32
25: ; preds = %21, %25
%26 = phi i64 [ %30, %25 ], [ 0, %21 ]
%27 = getelementptr inbounds double, double* %12, i64 %26
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %28)
%30 = add nuw nsw i64 %26, 1
%31 = icmp eq i64 %30, %11
br i1 %31, label %32, label %25
32: ; preds = %25, %21
%33 = load i32, i32* %4
%34 = call i32 @celcon_number_of_points_in_cell(i32 %33, i32 %1, i32* %10)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp sgt i32 %1, 0
br i1 %36, label %37, label %81
37: ; preds = %32, %37
%38 = phi i64 [ %42, %37 ], [ 0, %32 ]
%39 = getelementptr inbounds i32, i32* %10, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = add nuw nsw i64 %38, 1
%43 = icmp eq i64 %42, %8
br i1 %43, label %44, label %37
44: ; preds = %37
%45 = call i32 @putchar(i32 10)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br i1 %36, label %47, label %84
47: ; preds = %44
%48 = add i32 %0, -1
%49 = icmp sgt i32 %0, 1
%50 = sext i32 %48 to i64
%51 = getelementptr inbounds double, double* %13, i64 %50
%52 = zext i32 %48 to i64
br label %53
53: ; preds = %47, %79
%54 = phi i64 [ 0, %47 ], [ %58, %79 ]
%55 = getelementptr inbounds i32, i32* %10, i64 %54
%56 = load i32, i32* %55
%57 = icmp sgt i32 %56, 0
%58 = add nuw nsw i64 %54, 1
br i1 %57, label %59, label %79
59: ; preds = %53
%60 = trunc i64 %58 to i32
br label %61
61: ; preds = %59, %74
%62 = phi i32 [ 0, %59 ], [ %64, %74 ]
%63 = load i32, i32* %4
%64 = add nuw nsw i32 %62, 1
%65 = call i32 @celcon_get_point_in_cell(i32 %0, i32 %63, i32 %60, i32 %64, double* %13)
br i1 %49, label %66, label %74
66: ; preds = %61, %66
%67 = phi i64 [ %72, %66 ], [ 0, %61 ]
%68 = getelementptr inbounds double, double* %13, i64 %67
%69 = load double, double* %68
%70 = fptosi double %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %70)
%72 = add nuw nsw i64 %67, 1
%73 = icmp eq i64 %72, %52
br i1 %73, label %74, label %66
74: ; preds = %66, %61
%75 = load double, double* %51
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %75)
%77 = load i32, i32* %55
%78 = icmp slt i32 %64, %77
br i1 %78, label %61, label %79
79: ; preds = %74, %53
%80 = icmp eq i64 %58, %8
br i1 %80, label %84, label %53
81: ; preds = %32
%82 = call i32 @putchar(i32 10)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %84
84: ; preds = %79, %81, %44
%85 = load i32, i32* %4
%86 = call i32 @celcon_mixed_volume(i32 %85, i32* %5)
%87 = load i32, i32* %5
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %87)
%89 = add i32 %1, 1
%90 = shl nsw i32 %0, 1
%91 = add nsw i32 %89, %90
%92 = zext i32 %91 to i64
%93 = call i8* @llvm.stacksave()
%94 = alloca i32, i64 %92
%95 = alloca double, i64 %11
%96 = load i32, i32* %4
%97 = call i32 @celcon_retrieve_mixed_cell(i32 %0, i32 %1, i32 %96, i32* %94, double* %95)
%98 = load i32, i32* %4
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i32 %98)
br i1 %24, label %100, label %107
100: ; preds = %84, %100
%101 = phi i64 [ %105, %100 ], [ 0, %84 ]
%102 = getelementptr inbounds double, double* %95, i64 %101
%103 = load double, double* %102
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %103)
%105 = add nuw nsw i64 %101, 1
%106 = icmp eq i64 %105, %11
br i1 %106, label %107, label %100
107: ; preds = %100, %84
%108 = load i32, i32* %94
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i32 %108)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
%111 = icmp slt i32 %1, 1
br i1 %111, label %151, label %112
112: ; preds = %107
%113 = zext i32 %89 to i64
br label %114
114: ; preds = %112, %114
%115 = phi i64 [ 1, %112 ], [ %119, %114 ]
%116 = getelementptr inbounds i32, i32* %94, i64 %115
%117 = load i32, i32* %116
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %117)
%119 = add nuw nsw i64 %115, 1
%120 = icmp eq i64 %119, %113
br i1 %120, label %121, label %114
121: ; preds = %114
%122 = call i32 @putchar(i32 10)
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
br i1 %111, label %154, label %124
124: ; preds = %121
%125 = zext i32 %89 to i64
br label %126
126: ; preds = %124, %146
%127 = phi i64 [ 1, %124 ], [ %149, %146 ]
%128 = phi i32 [ %1, %124 ], [ %147, %146 ]
%129 = getelementptr inbounds i32, i32* %94, i64 %127
%130 = load i32, i32* %129
%131 = icmp sgt i32 %130, 0
br i1 %131, label %132, label %146
132: ; preds = %126
%133 = sext i32 %128 to i64
br label %134
134: ; preds = %132, %134
%135 = phi i64 [ %133, %132 ], [ %137, %134 ]
%136 = phi i32 [ 0, %132 ], [ %141, %134 ]
%137 = add nsw i64 %135, 1
%138 = getelementptr inbounds i32, i32* %94, i64 %137
%139 = load i32, i32* %138
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %139)
%141 = add nuw nsw i32 %136, 1
%142 = load i32, i32* %129
%143 = icmp slt i32 %141, %142
br i1 %143, label %134, label %144
144: ; preds = %134
%145 = trunc i64 %137 to i32
br label %146
146: ; preds = %144, %126
%147 = phi i32 [ %128, %126 ], [ %145, %144 ]
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%149 = add nuw nsw i64 %127, 1
%150 = icmp eq i64 %149, %125
br i1 %150, label %154, label %126
151: ; preds = %107
%152 = call i32 @putchar(i32 10)
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
br label %154
154: ; preds = %146, %151, %121
%155 = call i32 @putchar(i32 10)
br label %156
156: ; preds = %154, %19
%157 = phi i32 [ 1, %19 ], [ %97, %154 ]
ret i32 %157
}