#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 k, fail, *b, i, j, mv, nl[r], kk;
  double *c, normal[n], pt[n];
  printf("\nGive a cell number : ");
  scanf("%d", &k);
  fail = celcon_get_inner_normal(n, k, normal);
  if (fail == 1)
    printf("an error happened...\n");
  else {
    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    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%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)
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x78(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <celcon_get_inner_normal@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1238 <query_cell+0xc8>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15c3 <query_cell+0x453>
mov    -0xc(%rbp),%esi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1285 <query_cell+0x115>
mov    -0x78(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe17(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1250 <query_cell+0xe0>
mov    -0x88(%rbp),%rdx
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <celcon_number_of_points_in_cell@plt>
mov    %eax,-0x10(%rbp)
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e5 <query_cell+0x175>
mov    -0x88(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12af <query_cell+0x13f>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13d2 <query_cell+0x262>
movl   $0x0,-0x20(%rbp)
mov    -0x88(%rbp),%rcx
mov    -0x20(%rbp),%eax
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    13bf <query_cell+0x24f>
mov    -0x80(%rbp),%r8
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
call   1060 <celcon_get_point_in_cell@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1391 <query_cell+0x221>
mov    -0x80(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%esi
lea    0xcec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1357 <query_cell+0x1e7>
mov    -0x80(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xcdc(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    131b <query_cell+0x1ab>
jmp    13c4 <query_cell+0x254>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1308 <query_cell+0x198>
mov    -0xc(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   1070 <celcon_mixed_volume@plt>
mov    %eax,-0x10(%rbp)
mov    -0x24(%rbp),%esi
lea    0xca4(%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,-0x60(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%r8
sub    %rdx,%r8
mov    %r8,-0x90(%rbp)
mov    %r8,%rsp
mov    %rax,-0x70(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1090 <celcon_retrieve_mixed_cell@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xc3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14ab <query_cell+0x33b>
mov    -0x90(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xbf0(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1473 <query_cell+0x303>
mov    -0x98(%rbp),%rax
mov    (%rax),%esi
lea    0xc08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     150d <query_cell+0x39d>
mov    -0x98(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    14d7 <query_cell+0x367>
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     15ae <query_cell+0x43e>
movl   $0x0,-0x20(%rbp)
mov    -0x98(%rbp),%rcx
mov    -0x20(%rbp),%eax
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1592 <query_cell+0x422>
mov    -0x98(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x3c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xaeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1549 <query_cell+0x3d9>
lea    0xb87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1536 <query_cell+0x3c6>
lea    0xb0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
mov    -0x10(%rbp),%eax
mov    -0x30(%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    %edi,%ebx
mov    %rsp,%r15
mov    %rsi,-0x38(%rbp)
mov    %esi,%eax
mov    %rsp,%rcx
mov    %rax,-0x68(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%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,-0x80(%rbp)
sub    %rax,%r14
mov    %r14,%rsp
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe50(%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    1234 <query_cell+0xa4>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    15af <query_cell+0x41f>
mov    %r15,-0x78(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xdd5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,-0x40(%rbp)
test   %ebx,%ebx
jle    127a <query_cell+0xea>
xor    %ebx,%ebx
lea    0xdfd(%rip),%r15
nopw   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1260 <query_cell+0xd0>
mov    %r12,-0x70(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%rbx
mov    %ebx,%esi
mov    -0x48(%rbp),%rdx
call   1050 <celcon_number_of_points_in_cell@plt>
lea    0xd9c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    13bb <query_cell+0x22b>
lea    0xda5(%rip),%r15
xor    %ebx,%ebx
mov    -0x68(%rbp),%r13
mov    -0x48(%rbp),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    12c0 <query_cell+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe0c(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x38(%rbp)
mov    -0x40(%rbp),%r15
jle    13d5 <query_cell+0x245>
mov    %r12,%rax
lea    -0x1(%r15),%r12d
movslq %r12d,%rcx
mov    %rcx,-0x88(%rbp)
lea    0xd3f(%rip),%rbx
xor    %ecx,%ecx
jmp    1331 <query_cell+0x1a1>
nopw   0x0(%rax,%rax,1)
mov    -0x50(%rbp),%rdx
mov    %rdx,%rcx
cmp    -0x68(%rbp),%rdx
je     13d5 <query_cell+0x245>
lea    0x1(%rcx),%rdx
mov    %rdx,-0x50(%rbp)
cmpl   $0x0,(%rax,%rcx,4)
jle    1320 <query_cell+0x190>
xor    %r13d,%r13d
mov    %rcx,-0x58(%rbp)
jmp    137d <query_cell+0x1ed>
nopl   0x0(%rax,%rax,1)
mov    -0x88(%rbp),%rax
movsd  (%r14,%rax,8),%xmm0
lea    0xcf2(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%rcx
cmp    (%rax,%rcx,4),%r13d
mov    -0x40(%rbp),%r15
jge    1320 <query_cell+0x190>
mov    -0x2c(%rbp),%esi
add    $0x1,%r13d
mov    %r15d,%edi
mov    -0x50(%rbp),%rdx
mov    %r13d,%ecx
mov    %r14,%r8
call   1080 <celcon_get_point_in_cell@plt>
cmp    $0x2,%r15d
jl     1350 <query_cell+0x1c0>
xor    %r15d,%r15d
nop
cvttsd2si (%r14,%r15,8),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r12
jne    13a0 <query_cell+0x210>
jmp    1350 <query_cell+0x1c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd28(%rip),%rdi
call   1040 <puts@plt>
mov    -0x40(%rbp),%r15
mov    -0x2c(%rbp),%edi
lea    -0x5c(%rbp),%rsi
call   1090 <celcon_mixed_volume@plt>
mov    -0x5c(%rbp),%esi
lea    0xc74(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rsp,-0x48(%rbp)
mov    -0x38(%rbp),%r13
lea    0x1(%r13,%r15,2),%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
mov    %r15,%rbx
mov    %rsp,%r15
sub    -0x80(%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    0xc31(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
mov    -0x70(%rbp),%r12
jle    147d <query_cell+0x2ed>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r15,%rbx,8),%xmm0
lea    0xbe9(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1460 <query_cell+0x2d0>
mov    (%r14),%esi
lea    0xc0c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc27(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r13d,%r13d
jle    1582 <query_cell+0x3f2>
lea    0x1(%r13),%eax
mov    %eax,%r12d
mov    $0x1,%ebx
lea    0xb9a(%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    14c0 <query_cell+0x330>
mov    %r12,-0x50(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xbf0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r13d,%r13d
jle    159a <query_cell+0x40a>
lea    0x4(%r14),%rax
mov    %rax,-0x58(%rbp)
mov    $0x1,%r12d
lea    0xb41(%rip),%rbx
jmp    1538 <query_cell+0x3a8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xbc9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r12
cmp    -0x50(%rbp),%r12
je     159a <query_cell+0x40a>
cmpl   $0x0,(%r14,%r12,4)
jle    1520 <query_cell+0x390>
mov    %r13,-0x38(%rbp)
movslq %r13d,%rax
mov    -0x58(%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     1560 <query_cell+0x3d0>
mov    -0x38(%rbp),%r13
add    %r15d,%r13d
jmp    1520 <query_cell+0x390>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xb49(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x48(%rbp),%rsp
mov    -0x78(%rbp),%r15
mov    -0x40(%rbp),%eax
mov    %r15,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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