#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 intcelcon_append_lifted_point(int, int, int *);
int intcelcon_initialize_supports(int);
int intcelcon_set_type_of_mixture(int, int *);
int intcelcon_type_of_mixture(int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void check_intcelcon(int n, int r, int *mix) {
  int fail, retr, i, j, k, nb;
  int retmix[n - 1];
  fail = intcelcon_initialize_supports(r);
  printf("in check_intcelcon, mix = ");
  for (i = 0; i < r; i++)
    printf(" %d", mix[i]);
  printf("\n");
  fail = intcelcon_set_type_of_mixture(r, mix);
  fail = intcelcon_type_of_mixture(&retr, retmix);
  printf("The retrieved number of supports : %d.\n", retr);
  printf("The retrieved mixture : ");
  for (i = 0; i < retr; i++)
    printf(" %d", retmix[i]);
  printf("\n");
  for (i = 0; i < r; i++) {
    printf("How many lifted points for support %d ? ", i);
    scanf("%d", &nb);
    for (j = 0; j < nb; j++) {
      int point[n];
      printf("Give point %d : ", j);
      for (k = 0; k < n; k++)
        scanf("%d", &point[k]);
      fail = intcelcon_append_lifted_point(n, i + 1, point);
    }
  }
}


x86 assembly (clang, -O0):
<check_intcelcon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <intcelcon_initialize_supports@plt>
mov    %eax,-0x14(%rbp)
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ef <check_intcelcon+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bc <check_intcelcon+0x5c>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <intcelcon_set_type_of_mixture@plt>
mov    -0x50(%rbp),%rsi
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <intcelcon_type_of_mixture@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1275 <check_intcelcon+0x115>
mov    -0x50(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1242 <check_intcelcon+0xe2>
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    137b <check_intcelcon+0x21b>
mov    -0x1c(%rbp),%esi
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd6e(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1368 <check_intcelcon+0x208>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%esi
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    133e <check_intcelcon+0x1de>
mov    -0x58(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xcf1(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1309 <check_intcelcon+0x1a9>
mov    -0x58(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
call   1070 <intcelcon_append_lifted_point@plt>
mov    %eax,-0x14(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12be <check_intcelcon+0x15e>
jmp    136d <check_intcelcon+0x20d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    128a <check_intcelcon+0x12a>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_intcelcon>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r12
mov    %esi,%ebx
mov    %rsp,-0x48(%rbp)
mov    %rdi,-0x40(%rbp)
lea    -0x1(%rdi),%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %esi,%edi
call   1070 <intcelcon_initialize_supports@plt>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,-0x2c(%rbp)
test   %ebx,%ebx
jle    11e7 <check_intcelcon+0x77>
mov    -0x2c(%rbp),%r13d
lea    0xe4e(%rip),%r14
xor    %ebx,%ebx
nop
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11d0 <check_intcelcon+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x2c(%rbp),%edi
mov    %r12,%rsi
call   1050 <intcelcon_set_type_of_mixture@plt>
lea    -0x30(%rbp),%rdi
mov    %r15,%rsi
call   1040 <intcelcon_type_of_mixture@plt>
mov    -0x30(%rbp),%esi
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,-0x30(%rbp)
jle    125b <check_intcelcon+0xeb>
lea    0xde7(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
movslq -0x30(%rbp),%rax
cmp    %rax,%rbx
jl     1240 <check_intcelcon+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,-0x2c(%rbp)
mov    -0x40(%rbp),%r15
jle    1347 <check_intcelcon+0x1d7>
mov    %r15d,%eax
lea    0xd9f(%rip),%rbx
mov    %rax,-0x50(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rax,-0x58(%rbp)
xor    %r13d,%r13d
jmp    12aa <check_intcelcon+0x13a>
cs nopw 0x0(%rax,%rax,1)
cmp    -0x2c(%rbp),%r13d
je     1347 <check_intcelcon+0x1d7>
lea    0xdaf(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
lea    -0x34(%rbp),%rsi
call   1090 <scanf@plt>
add    $0x1,%r13d
cmpl   $0x0,-0x34(%rbp)
jle    12a0 <check_intcelcon+0x130>
xor    %r14d,%r14d
mov    %r13d,-0x38(%rbp)
jmp    1304 <check_intcelcon+0x194>
nopw   0x0(%rax,%rax,1)
mov    -0x40(%rbp),%r15
mov    %r15d,%edi
mov    -0x38(%rbp),%r13d
mov    %r13d,%esi
mov    %r12,%rdx
call   1080 <intcelcon_append_lifted_point@plt>
mov    -0x60(%rbp),%rsp
add    $0x1,%r14d
cmp    -0x34(%rbp),%r14d
jge    12a0 <check_intcelcon+0x130>
mov    %rsp,-0x60(%rbp)
mov    %rsp,%r12
sub    -0x58(%rbp),%r12
mov    %r12,%rsp
lea    0xd70(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r15d,%r15d
jle    12e0 <check_intcelcon+0x170>
mov    -0x50(%rbp),%r13
mov    %r12,%r15
nop
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <scanf@plt>
add    $0x4,%r15
add    $0xffffffffffffffff,%r13
jne    1330 <check_intcelcon+0x1c0>
jmp    12e0 <check_intcelcon+0x170>
mov    -0x48(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"in check_intcelcon, mix = \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [40 x i8] c"The retrieved number of supports : %d.\0A\00"
@.str.4 = [25 x i8] c"The retrieved mixture : \00"
@.str.5 = [41 x i8] c"How many lifted points for support %d ? \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [17 x i8] c"Give point %d : \00"
define void @check_intcelcon(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 i8*
%16 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %13
%21 = alloca i32, i64 %19
store i64 %19, i64* %14
%22 = load i32, i32* %5
%23 = call i32 @intcelcon_initialize_supports(i32 %22)
store i32 %23, i32* %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %25
25: ; preds = %36, %3
%26 = load i32, i32* %9
%27 = load i32, i32* %5
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %39
29: ; preds = %25
%30 = load i32*, i32** %6
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %29
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %25
39: ; preds = %25
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* %5
%42 = load i32*, i32** %6
%43 = call i32 @intcelcon_set_type_of_mixture(i32 %41, i32* %42)
store i32 %43, i32* %7
%44 = call i32 @intcelcon_type_of_mixture(i32* %8, i32* %21)
store i32 %44, i32* %7
%45 = load i32, i32* %8
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %48
48: ; preds = %58, %39
%49 = load i32, i32* %9
%50 = load i32, i32* %8
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i32, i32* %9
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %21, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 1
store i32 %60, i32* %9
br label %48
61: ; preds = %48
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %9
br label %63
63: ; preds = %104, %61
%64 = load i32, i32* %9
%65 = load i32, i32* %5
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %107
67: ; preds = %63
%68 = load i32, i32* %9
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %68)
%70 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %12)
store i32 0, i32* %10
br label %71
71: ; preds = %100, %67
%72 = load i32, i32* %10
%73 = load i32, i32* %12
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %103
75: ; preds = %71
%76 = load i32, i32* %4
%77 = zext i32 %76 to i64
%78 = call i8* @llvm.stacksave()
store i8* %78, i8** %15
%79 = alloca i32, i64 %77
store i64 %77, i64* %16
%80 = load i32, i32* %10
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %80)
store i32 0, i32* %11
br label %82
82: ; preds = %91, %75
%83 = load i32, i32* %11
%84 = load i32, i32* %4
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %94
86: ; preds = %82
%87 = load i32, i32* %11
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i32, i32* %79, i64 %88
%90 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %89)
br label %91
91: ; preds = %86
%92 = load i32, i32* %11
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %82
94: ; preds = %82
%95 = load i32, i32* %4
%96 = load i32, i32* %9
%97 = add nsw i32 %96, 1
%98 = call i32 @intcelcon_append_lifted_point(i32 %95, i32 %97, i32* %79)
store i32 %98, i32* %7
%99 = load i8*, i8** %15
br label %100
100: ; preds = %94
%101 = load i32, i32* %10
%102 = add nsw i32 %101, 1
store i32 %102, i32* %10
br label %71
103: ; preds = %71
br label %104
104: ; preds = %103
%105 = load i32, i32* %9
%106 = add nsw i32 %105, 1
store i32 %106, i32* %9
br label %63
107: ; preds = %63
%108 = load i8*, i8** %13
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"in check_intcelcon, mix = \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.3 = [40 x i8] c"The retrieved number of supports : %d.\0A\00"
@.str.4 = [25 x i8] c"The retrieved mixture : \00"
@.str.5 = [41 x i8] c"How many lifted points for support %d ? \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [17 x i8] c"Give point %d : \00"
define void @check_intcelcon(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = add nsw i32 %0, -1
%9 = zext i32 %8 to i64
%10 = tail call i8* @llvm.stacksave()
%11 = alloca i32, i64 %9
%12 = tail call i32 @intcelcon_initialize_supports(i32 %1)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %24
15: ; preds = %3
%16 = zext i32 %1 to i64
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ 0, %15 ], [ %22, %17 ]
%19 = getelementptr inbounds i32, i32* %2, i64 %18
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i64 %18, 1
%23 = icmp eq i64 %22, %16
br i1 %23, label %24, label %17
24: ; preds = %17, %3
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @intcelcon_set_type_of_mixture(i32 %1, i32* %2)
%27 = call i32 @intcelcon_type_of_mixture(i32* %4, i32* %11)
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%31 = load i32, i32* %4
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %24, %33
%34 = phi i64 [ %38, %33 ], [ 0, %24 ]
%35 = getelementptr inbounds i32, i32* %11, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = add nuw nsw i64 %34, 1
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = icmp slt i64 %38, %40
br i1 %41, label %33, label %42
42: ; preds = %33, %24
%43 = call i32 @putchar(i32 10)
br i1 %14, label %44, label %72
44: ; preds = %42
%45 = zext i32 %0 to i64
%46 = icmp sgt i32 %0, 0
br label %47
47: ; preds = %44, %70
%48 = phi i32 [ 0, %44 ], [ %53, %70 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %48)
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%51 = load i32, i32* %5
%52 = icmp sgt i32 %51, 0
%53 = add nuw nsw i32 %48, 1
br i1 %52, label %54, label %70
54: ; preds = %47, %65
%55 = phi i32 [ %67, %65 ], [ 0, %47 ]
%56 = call i8* @llvm.stacksave()
%57 = alloca i32, i64 %45
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %55)
br i1 %46, label %59, label %65
59: ; preds = %54, %59
%60 = phi i64 [ %63, %59 ], [ 0, %54 ]
%61 = getelementptr inbounds i32, i32* %57, i64 %60
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %61)
%63 = add nuw nsw i64 %60, 1
%64 = icmp eq i64 %63, %45
br i1 %64, label %65, label %59
65: ; preds = %59, %54
%66 = call i32 @intcelcon_append_lifted_point(i32 %0, i32 %53, i32* %57)
%67 = add nuw nsw i32 %55, 1
%68 = load i32, i32* %5
%69 = icmp slt i32 %67, %68
br i1 %69, label %54, label %70
70: ; preds = %65, %47
%71 = icmp eq i32 %53, %1
br i1 %71, label %72, label %47
72: ; preds = %70, %42
ret void
}