#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_celcon(int, int *, int *, double *);
int /*<<< orphan*/ printf(char *, ...);
int write_lifted_supports(int n) {
  int fail, a, b, r, i, j, k;
  int nl[n];
  double *c, pt[n];
  fail = _ada_use_celcon(5, &r, nl, c);
  printf("\nlength of the lifted support lists :");
  for (i = 0; i < r; i++)
    printf(" %d", nl[i]);
  printf("\n");
  printf("the lifted supports:\n");
  for (i = 0; i < r; i++) {
    a = i + 1;
    for (j = 0; j < nl[i]; j++) {
      b = j + 1;
      fail = _ada_use_celcon(6, &a, &b, pt);
      for (k = 0; k < n - 1; k++)
        printf(" %d", (int)pt[k]);
      printf(" %.15le\n", pt[n - 1]);
    }
    printf("\n");
  }
  return fail;
}


x86 assembly (clang, -O0):
<write_lifted_supports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rcx
sub    %rsi,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rcx
mov    $0x5,%edi
lea    -0x14(%rbp),%rsi
call   1040 <_ada_use_celcon@plt>
mov    %eax,-0x8(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11cf <write_lifted_supports+0xaf>
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119c <write_lifted_supports+0x7c>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12cf <write_lifted_supports+0x1af>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x50(%rbp),%rcx
mov    -0x1c(%rbp),%eax
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    12b3 <write_lifted_supports+0x193>
mov    -0x48(%rbp),%rcx
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x6,%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <_ada_use_celcon@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1285 <write_lifted_supports+0x165>
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    124b <write_lifted_supports+0x12b>
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xda2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120e <write_lifted_supports+0xee>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f2 <write_lifted_supports+0xd2>
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lifted_supports>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsp,-0x48(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %edi,%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
mov    %rsp,%rbx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x2c(%rbp),%rsi
mov    $0x5,%edi
mov    %r12,%rdx
call   1060 <_ada_use_celcon@plt>
mov    %eax,-0x30(%rbp)
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    11db <write_lifted_supports+0x9b>
lea    0xe72(%rip),%r13
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    (%r12,%r14,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
movslq -0x2c(%rbp),%rax
cmp    %rax,%r14
jl     11c0 <write_lifted_supports+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe47(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    12cb <write_lifted_supports+0x18b>
mov    -0x40(%rbp),%rax
lea    -0x1(%rax),%r14d
movslq %r14d,%rax
mov    %rax,-0x58(%rbp)
lea    0xe15(%rip),%r13
xor    %ecx,%ecx
mov    %r12,-0x60(%rbp)
jmp    123e <write_lifted_supports+0xfe>
nopl   0x0(%rax)
mov    -0x50(%rbp),%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq -0x2c(%rbp),%rax
mov    %r15,%rcx
cmp    %rax,%r15
jge    12cb <write_lifted_supports+0x18b>
lea    0x1(%rcx),%r15
mov    %r15d,-0x38(%rbp)
cmpl   $0x0,(%r12,%rcx,4)
jle    1224 <write_lifted_supports+0xe4>
mov    %r15,-0x50(%rbp)
xor    %r15d,%r15d
mov    %rcx,-0x68(%rbp)
jmp    1285 <write_lifted_supports+0x145>
nopw   0x0(%rax,%rax,1)
mov    -0x58(%rbp),%rax
movsd  (%rbx,%rax,8),%xmm0
lea    0xdba(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x60(%rbp),%r12
mov    -0x68(%rbp),%rcx
cmp    (%r12,%rcx,4),%r15d
jge    1220 <write_lifted_supports+0xe0>
add    $0x1,%r15d
mov    %r15d,-0x34(%rbp)
mov    $0x6,%edi
lea    -0x38(%rbp),%rsi
lea    -0x34(%rbp),%rdx
mov    %rbx,%rcx
call   1060 <_ada_use_celcon@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x2,-0x40(%rbp)
jl     1260 <write_lifted_supports+0x120>
xor    %r12d,%r12d
xchg   %ax,%ax
cvttsd2si (%rbx,%r12,8),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r14
jne    12b0 <write_lifted_supports+0x170>
jmp    1260 <write_lifted_supports+0x120>
mov    -0x48(%rbp),%rsp
mov    -0x30(%rbp),%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0Alength of the lifted support lists :\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [22 x i8] c"the lifted supports:\0A\00"
@.str.4 = [9 x i8] c" %.15le\0A\00"
define i32 @write_lifted_supports(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca double*
%13 = alloca i64
store i32 %0, i32* %2
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %10
%17 = alloca i32, i64 %15
store i64 %15, i64* %11
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
%20 = alloca double, i64 %19
store i64 %19, i64* %13
%21 = load double*, double** %12
%22 = call i32 @_ada_use_celcon(i32 5, i32* %6, i32* %17, double* %21)
store i32 %22, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %24
24: ; preds = %34, %1
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %17, i64 %30
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %28
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %24
37: ; preds = %24
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %40
40: ; preds = %85, %37
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %88
44: ; preds = %40
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
store i32 0, i32* %8
br label %47
47: ; preds = %80, %44
%48 = load i32, i32* %8
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %17, i64 %50
%52 = load i32, i32* %51
%53 = icmp slt i32 %48, %52
br i1 %53, label %54, label %83
54: ; preds = %47
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
%57 = call i32 @_ada_use_celcon(i32 6, i32* %4, i32* %5, double* %20)
store i32 %57, i32* %3
store i32 0, i32* %9
br label %58
58: ; preds = %70, %54
%59 = load i32, i32* %9
%60 = load i32, i32* %2
%61 = sub nsw i32 %60, 1
%62 = icmp slt i32 %59, %61
br i1 %62, label %63, label %73
63: ; preds = %58
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %20, i64 %65
%67 = load double, double* %66
%68 = fptosi double %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %63
%71 = load i32, i32* %9
%72 = add nsw i32 %71, 1
store i32 %72, i32* %9
br label %58
73: ; preds = %58
%74 = load i32, i32* %2
%75 = sub nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %20, i64 %76
%78 = load double, double* %77
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), double %78)
br label %80
80: ; preds = %73
%81 = load i32, i32* %8
%82 = add nsw i32 %81, 1
store i32 %82, i32* %8
br label %47
83: ; preds = %47
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %85
85: ; preds = %83
%86 = load i32, i32* %7
%87 = add nsw i32 %86, 1
store i32 %87, i32* %7
br label %40
88: ; preds = %40
%89 = load i32, i32* %3
%90 = load i8*, i8** %10
ret i32 %89
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0Alength of the lifted support lists :\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.4 = [9 x i8] c" %.15le\0A\00"
@str = [21 x i8] c"the lifted supports:\00"
define i32 @write_lifted_supports(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = zext i32 %0 to i64
%9 = tail call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = alloca double, i64 %8
%12 = call i32 @_ada_use_celcon(i32 5, i32* %4, i32* %10, double* undef)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %1, %16
%17 = phi i64 [ %21, %16 ], [ 0, %1 ]
%18 = getelementptr inbounds i32, i32* %10, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = add nuw nsw i64 %17, 1
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %16, label %25
25: ; preds = %16, %1
%26 = call i32 @putchar(i32 10)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %67
30: ; preds = %25
%31 = add i32 %0, -1
%32 = icmp sgt i32 %0, 1
%33 = sext i32 %31 to i64
%34 = getelementptr inbounds double, double* %11, i64 %33
%35 = zext i32 %31 to i64
br label %36
36: ; preds = %30, %61
%37 = phi i64 [ 0, %30 ], [ %39, %61 ]
%38 = phi i32 [ %12, %30 ], [ %62, %61 ]
%39 = add nuw nsw i64 %37, 1
%40 = trunc i64 %39 to i32
store i32 %40, i32* %2
%41 = getelementptr inbounds i32, i32* %10, i64 %37
%42 = load i32, i32* %41
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %61
44: ; preds = %36, %56
%45 = phi i32 [ %46, %56 ], [ 0, %36 ]
%46 = add nuw nsw i32 %45, 1
store i32 %46, i32* %3
%47 = call i32 @_ada_use_celcon(i32 6, i32* %2, i32* %3, double* %11)
br i1 %32, label %48, label %56
48: ; preds = %44, %48
%49 = phi i64 [ %54, %48 ], [ 0, %44 ]
%50 = getelementptr inbounds double, double* %11, i64 %49
%51 = load double, double* %50
%52 = fptosi double %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = add nuw nsw i64 %49, 1
%55 = icmp eq i64 %54, %35
br i1 %55, label %56, label %48
56: ; preds = %48, %44
%57 = load double, double* %34
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), double %57)
%59 = load i32, i32* %41
%60 = icmp slt i32 %46, %59
br i1 %60, label %44, label %61
61: ; preds = %56, %36
%62 = phi i32 [ %38, %36 ], [ %47, %56 ]
%63 = call i32 @putchar(i32 10)
%64 = load i32, i32* %4
%65 = sext i32 %64 to i64
%66 = icmp slt i64 %39, %65
br i1 %66, label %36, label %67
67: ; preds = %61, %25
%68 = phi i32 [ %12, %25 ], [ %62, %61 ]
ret i32 %68
}