#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_lifted_point(int, int, int, double *);
int celcon_length_of_supports(int *, int *);
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 = celcon_length_of_supports(&r, nl);
  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++) {
    for (j = 0; j < nl[i]; j++) {
      fail = celcon_get_lifted_point(n, i + 1, j + 1, 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,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x50(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <celcon_length_of_supports@plt>
mov    %eax,-0x8(%rbp)
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d6 <write_lifted_supports+0xa6>
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a3 <write_lifted_supports+0x73>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12c6 <write_lifted_supports+0x196>
movl   $0x0,-0x1c(%rbp)
mov    -0x50(%rbp),%rcx
mov    -0x1c(%rbp),%eax
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    12aa <write_lifted_supports+0x17a>
mov    -0x48(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
call   1050 <celcon_get_lifted_point@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    127c <write_lifted_supports+0x14c>
mov    -0x48(%rbp),%rax
movslq -0x20(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%esi
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1242 <write_lifted_supports+0x112>
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120c <write_lifted_supports+0xdc>
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f9 <write_lifted_supports+0xc9>
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    $0x38,%rsp
mov    %rsp,-0x50(%rbp)
mov    %rdi,-0x38(%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),%rdi
mov    %r12,%rsi
call   1060 <celcon_length_of_supports@plt>
mov    %eax,-0x30(%rbp)
lea    0xe55(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    11eb <write_lifted_supports+0x9b>
lea    0xe67(%rip),%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%r15,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jl     11d0 <write_lifted_supports+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe37(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    12db <write_lifted_supports+0x18b>
mov    -0x38(%rbp),%rax
lea    -0x1(%rax),%r15d
movslq %r15d,%rax
mov    %rax,-0x58(%rbp)
lea    0xe05(%rip),%r13
xor    %edx,%edx
mov    %r12,-0x40(%rbp)
jmp    1252 <write_lifted_supports+0x102>
nopl   0x0(%rax)
mov    -0x40(%rbp),%r12
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq -0x2c(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,%rdx
cmp    %rax,%rcx
jge    12db <write_lifted_supports+0x18b>
lea    0x1(%rdx),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x0,(%r12,%rdx,4)
jle    1234 <write_lifted_supports+0xe4>
xor    %r12d,%r12d
mov    %rdx,-0x60(%rbp)
jmp    1295 <write_lifted_supports+0x145>
nopw   0x0(%rax,%rax,1)
mov    -0x58(%rbp),%rax
movsd  (%rbx,%rax,8),%xmm0
lea    0xdaa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
mov    -0x60(%rbp),%rdx
cmp    (%rax,%rdx,4),%r12d
jge    1230 <write_lifted_supports+0xe0>
add    $0x1,%r12d
mov    -0x38(%rbp),%r14
mov    %r14d,%edi
mov    -0x48(%rbp),%rsi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1070 <celcon_get_lifted_point@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x2,%r14d
jl     1270 <write_lifted_supports+0x120>
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
cvttsd2si (%rbx,%r14,8),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r15
jne    12c0 <write_lifted_supports+0x170>
jmp    1270 <write_lifted_supports+0x120>
mov    -0x50(%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 = call i32 @celcon_length_of_supports(i32* %6, i32* %17)
store i32 %21, i32* %3
%22 = 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 %23
23: ; preds = %33, %1
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %17, i64 %29
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %27
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %23
36: ; preds = %23
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = 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 %39
39: ; preds = %85, %36
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %88
43: ; preds = %39
store i32 0, i32* %8
br label %44
44: ; preds = %80, %43
%45 = load i32, i32* %8
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %17, i64 %47
%49 = load i32, i32* %48
%50 = icmp slt i32 %45, %49
br i1 %50, label %51, label %83
51: ; preds = %44
%52 = load i32, i32* %2
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
%57 = call i32 @celcon_get_lifted_point(i32 %52, i32 %54, i32 %56, double* %20)
store i32 %57, i32* %3
store i32 0, i32* %9
br label %58
58: ; preds = %70, %51
%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 %44
83: ; preds = %44
%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 %39
88: ; preds = %39
%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 = bitcast i32* %2 to i8*
%4 = zext i32 %0 to i64
%5 = tail call i8* @llvm.stacksave()
%6 = alloca i32, i64 %4
%7 = alloca double, i64 %4
%8 = call i32 @celcon_length_of_supports(i32* %2, i32* %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %1, %12
%13 = phi i64 [ %17, %12 ], [ 0, %1 ]
%14 = getelementptr inbounds i32, i32* %6, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nuw nsw i64 %13, 1
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %12, label %21
21: ; preds = %12, %1
%22 = call i32 @putchar(i32 10)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %64
26: ; preds = %21
%27 = add i32 %0, -1
%28 = icmp sgt i32 %0, 1
%29 = sext i32 %27 to i64
%30 = getelementptr inbounds double, double* %7, i64 %29
%31 = zext i32 %27 to i64
br label %32
32: ; preds = %26, %58
%33 = phi i64 [ 0, %26 ], [ %38, %58 ]
%34 = phi i32 [ %8, %26 ], [ %59, %58 ]
%35 = getelementptr inbounds i32, i32* %6, i64 %33
%36 = load i32, i32* %35
%37 = icmp sgt i32 %36, 0
%38 = add nuw nsw i64 %33, 1
br i1 %37, label %39, label %58
39: ; preds = %32
%40 = trunc i64 %38 to i32
br label %41
41: ; preds = %39, %53
%42 = phi i32 [ 0, %39 ], [ %43, %53 ]
%43 = add nuw nsw i32 %42, 1
%44 = call i32 @celcon_get_lifted_point(i32 %0, i32 %40, i32 %43, double* %7)
br i1 %28, label %45, label %53
45: ; preds = %41, %45
%46 = phi i64 [ %51, %45 ], [ 0, %41 ]
%47 = getelementptr inbounds double, double* %7, i64 %46
%48 = load double, double* %47
%49 = fptosi double %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = add nuw nsw i64 %46, 1
%52 = icmp eq i64 %51, %31
br i1 %52, label %53, label %45
53: ; preds = %45, %41
%54 = load double, double* %30
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), double %54)
%56 = load i32, i32* %35
%57 = icmp slt i32 %43, %56
br i1 %57, label %41, label %58
58: ; preds = %53, %32
%59 = phi i32 [ %34, %32 ], [ %44, %53 ]
%60 = call i32 @putchar(i32 10)
%61 = load i32, i32* %2
%62 = sext i32 %61 to i64
%63 = icmp slt i64 %38, %62
br i1 %63, label %32, label %64
64: ; preds = %58, %21
%65 = phi i32 [ %8, %21 ], [ %59, %58 ]
ret i32 %65
}