#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int syscon_string_of_symbols(int *, char *);
void padcon_define_partition(int m, int nvr, int *idz) {
  const int nbc = nvr * 10;
  char smbstr[nbc];
  char buffer[10];
  int nbr = nbc;
  int idx, bufidx, setidx;
  int fail = syscon_string_of_symbols(&nbr, smbstr);
  printf("Defining a partition of the variables ...\n");
  bufidx = 0;
  setidx = 0;
  for (idx = 0; idx < nbr; idx++) {
    if (smbstr[idx] != ' ')
      buffer[bufidx++] = smbstr[idx];
    else {
      buffer[bufidx] = '\0';
      printf("-> which set will %s be in ? ", buffer);
      scanf("%d", &idz[setidx++]);
      bufidx = 0;
    }
  }
  buffer[bufidx] = '\0';
  printf("-> which set will %s be in ? ", buffer);
  scanf("%d", &idz[setidx++]);
  printf("Your partition :");
  for (idx = 0; idx < nvr; idx++)
    printf(" %d", idz[idx]);
  printf("\n");
}


x86 assembly (clang, -O0):
<padcon_define_partition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    %ecx,%ecx
mov    %ecx,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x50(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x38(%rbp),%rdi
call   1040 <syscon_string_of_symbols@plt>
mov    %eax,-0x48(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1245 <padcon_define_partition+0x115>
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11ec <padcon_define_partition+0xbc>
mov    -0x50(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x40(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x40(%rbp)
cltq
mov    %cl,-0x32(%rbp,%rax,1)
jmp    1232 <padcon_define_partition+0x102>
movslq -0x40(%rbp),%rax
movb   $0x0,-0x32(%rbp,%rax,1)
lea    -0x32(%rbp),%rsi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe35(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x40(%rbp)
jmp    1237 <padcon_define_partition+0x107>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11aa <padcon_define_partition+0x7a>
movslq -0x40(%rbp),%rax
movb   $0x0,-0x32(%rbp,%rax,1)
lea    -0x32(%rbp),%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xddc(%rip),%rdi
call   1050 <scanf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12cc <padcon_define_partition+0x19c>
mov    -0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1299 <padcon_define_partition+0x169>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_define_partition>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r15
mov    %rsi,-0x40(%rbp)
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
lea    0xf(%rax),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    %eax,-0x2c(%rbp)
lea    -0x2c(%rbp),%rdi
mov    %rbx,%rsi
call   1060 <syscon_string_of_symbols@plt>
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
mov    -0x2c(%rbp),%eax
test   %eax,%eax
jle    120a <padcon_define_partition+0xba>
xor    %r13d,%r13d
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    11f3 <padcon_define_partition+0xa3>
nopl   0x0(%rax)
movslq %r14d,%rax
movb   $0x0,-0x36(%rbp,%rax,1)
xor    %r14d,%r14d
lea    0xe3e(%rip),%rdi
lea    -0x36(%rbp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movslq %r12d,%rax
add    $0x1,%r12d
lea    (%r15,%rax,4),%rsi
lea    0xe51(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%r13
movslq %eax,%rcx
cmp    %rcx,%r13
jge    1210 <padcon_define_partition+0xc0>
movzbl (%rbx,%r13,1),%ecx
cmp    $0x20,%cl
je     11b0 <padcon_define_partition+0x60>
movslq %r14d,%rdx
add    $0x1,%r14d
mov    %cl,-0x36(%rbp,%rdx,1)
jmp    11e7 <padcon_define_partition+0x97>
xor    %r14d,%r14d
xor    %r12d,%r12d
movslq %r14d,%rax
movb   $0x0,-0x36(%rbp,%rax,1)
lea    0xde1(%rip),%rdi
lea    -0x36(%rbp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movslq %r12d,%rax
lea    (%r15,%rax,4),%rsi
lea    0xdf8(%rip),%rdi
call   1070 <scanf@plt>
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x40(%rbp),%rax
test   %eax,%eax
jle    1277 <padcon_define_partition+0x127>
mov    %eax,%r12d
lea    0xdd2(%rip),%r14
xor    %ebx,%ebx
nop
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1260 <padcon_define_partition+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [30 x i8] c"-> which set will %s be in ? \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"Your partition :\00"
@.str.4 = [4 x i8] c" %d\00"
@str = [42 x i8] c"Defining a partition of the variables ...\00"
define void @padcon_define_partition(i32 %0, i32 %1, i32* %2) {
%4 = alloca [10 x i8]
%5 = alloca i32
%6 = mul nsw i32 %1, 10
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = bitcast i32* %5 to i8*
store i32 %6, i32* %5
%11 = call i32 @syscon_string_of_symbols(i32* %5, i8* %8)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %43
15: ; preds = %3, %36
%16 = phi i32 [ %37, %36 ], [ %13, %3 ]
%17 = phi i64 [ %40, %36 ], [ 0, %3 ]
%18 = phi i32 [ %39, %36 ], [ 0, %3 ]
%19 = phi i32 [ %38, %36 ], [ 0, %3 ]
%20 = getelementptr inbounds i8, i8* %8, i64 %17
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 32
br i1 %22, label %27, label %23
23: ; preds = %15
%24 = add nsw i32 %19, 1
%25 = sext i32 %19 to i64
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %25
store i8 %21, i8* %26
br label %36
27: ; preds = %15
%28 = sext i32 %19 to i64
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %28
store i8 0, i8* %29
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%31 = add nsw i32 %18, 1
%32 = sext i32 %18 to i64
%33 = getelementptr inbounds i32, i32* %2, i64 %32
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %5
br label %36
36: ; preds = %23, %27
%37 = phi i32 [ %16, %23 ], [ %35, %27 ]
%38 = phi i32 [ %24, %23 ], [ 0, %27 ]
%39 = phi i32 [ %18, %23 ], [ %31, %27 ]
%40 = add nuw nsw i64 %17, 1
%41 = sext i32 %37 to i64
%42 = icmp slt i64 %40, %41
br i1 %42, label %15, label %43
43: ; preds = %36, %3
%44 = phi i32 [ 0, %3 ], [ %38, %36 ]
%45 = phi i32 [ 0, %3 ], [ %39, %36 ]
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %46
store i8 0, i8* %47
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%49 = sext i32 %45 to i64
%50 = getelementptr inbounds i32, i32* %2, i64 %49
%51 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %50)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp sgt i32 %1, 0
br i1 %53, label %54, label %63
54: ; preds = %43
%55 = zext i32 %1 to i64
br label %56
56: ; preds = %54, %56
%57 = phi i64 [ 0, %54 ], [ %61, %56 ]
%58 = getelementptr inbounds i32, i32* %2, i64 %57
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %59)
%61 = add nuw nsw i64 %57, 1
%62 = icmp eq i64 %61, %55
br i1 %62, label %63, label %56
63: ; preds = %56, %43
%64 = call i32 @putchar(i32 10)
ret void
}