#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_solcon(int, int *, int *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void test_standard_solution_strings(int len, int nvar) {
  int k, n, fail;
  double *c;
  printf("\nTesting strings of solutions ... \n\n");
  printf("Give index of solution ( in [1,%d] ) : ", len);
  scanf("%d", &k);
  fail = _ada_use_solcon(30, &k, &n, c);
  printf("-> number of characters in solution %d : %d\n", k, n);
  {
    int i, a[2];
    int v[n];
    char s[n + 1];
    a[0] = k;
    a[1] = n;
    fail = _ada_use_solcon(31, a, v, c);
    for (i = 0; i < n; i++)
      s[i] = (char)v[i];
    s[n] = '\0';
    printf("the solution %d :\n%s\n", k, s);
    a[0] = nvar;
    a[1] = n;
    fail = _ada_use_solcon(38, a, v, c);
    printf("the container after appending solution %d :\n", k);
    fail = _ada_use_solcon(1, a, v, c);
  }
}


x86 assembly (clang, -O0):
<test_standard_solution_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x59(%rbp)
call   1030 <printf@plt>
mov    -0x59(%rbp),%al
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    %rsi,-0x68(%rbp)
call   1050 <scanf@plt>
mov    -0x68(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1e,%edi
lea    -0x10(%rbp),%rdx
call   1040 <_ada_use_solcon@plt>
mov    %eax,%ecx
mov    -0x59(%rbp),%al
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %rax,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rcx
sub    %rsi,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1f,%edi
call   1040 <_ada_use_solcon@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1248 <test_standard_solution_strings+0x118>
mov    -0x50(%rbp),%rax
mov    -0x58(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
mov    %cl,%dl
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1216 <test_standard_solution_strings+0xe6>
mov    -0x50(%rbp),%rdx
movslq -0x10(%rbp),%rax
movb   $0x0,(%rdx,%rax,1)
mov    -0xc(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rdx
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x26,%edi
call   1040 <_ada_use_solcon@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rdx
lea    -0x2c(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edi
call   1040 <_ada_use_solcon@plt>
mov    %eax,-0x14(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_standard_solution_strings>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x28(%rbp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    -0x24(%rbp),%rdx
mov    $0x1e,%edi
mov    %rbx,%rsi
call   1050 <_ada_use_solcon@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r12
mov    -0x24(%rbp),%eax
mov    %rsp,%r15
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    -0x24(%rbp),%eax
lea    0x1(%rax),%ecx
mov    %rsp,%rbx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    -0x28(%rbp),%ecx
mov    %ecx,-0x30(%rbp)
mov    %eax,-0x2c(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x1f,%edi
mov    %r15,%rdx
call   1050 <_ada_use_solcon@plt>
movslq -0x24(%rbp),%r9
test   %r9,%r9
jle    1301 <test_standard_solution_strings+0x1c1>
mov    %r9d,%ecx
cmp    $0x8,%ecx
jae    1210 <test_standard_solution_strings+0xd0>
xor    %edx,%edx
jmp    12f0 <test_standard_solution_strings+0x1b0>
mov    %ecx,%edx
and    $0xfffffff8,%edx
lea    -0x8(%rdx),%rsi
mov    %rsi,%r8
shr    $0x3,%r8
add    $0x1,%r8
test   %rsi,%rsi
je     1369 <test_standard_solution_strings+0x229>
mov    %r8,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movdqa 0xdc2(%rip),%xmm0
xchg   %ax,%ax
movdqa (%r15,%rsi,4),%xmm1
pand   %xmm0,%xmm1
packuswb %xmm1,%xmm1
packuswb %xmm1,%xmm1
movdqa 0x10(%r15,%rsi,4),%xmm2
pand   %xmm0,%xmm2
packuswb %xmm2,%xmm2
packuswb %xmm2,%xmm2
movd   %xmm1,(%rbx,%rsi,1)
movd   %xmm2,0x4(%rbx,%rsi,1)
movdqa 0x20(%r15,%rsi,4),%xmm1
pand   %xmm0,%xmm1
packuswb %xmm1,%xmm1
packuswb %xmm1,%xmm1
movdqa 0x30(%r15,%rsi,4),%xmm2
pand   %xmm0,%xmm2
packuswb %xmm2,%xmm2
packuswb %xmm2,%xmm2
movd   %xmm1,0x8(%rbx,%rsi,1)
movd   %xmm2,0xc(%rbx,%rsi,1)
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1240 <test_standard_solution_strings+0x100>
test   $0x1,%r8b
je     12e6 <test_standard_solution_strings+0x1a6>
movdqa 0xd46(%rip),%xmm0
movdqa (%r15,%rsi,4),%xmm1
pand   %xmm0,%xmm1
packuswb %xmm1,%xmm1
packuswb %xmm1,%xmm1
pand   0x10(%r15,%rsi,4),%xmm0
packuswb %xmm0,%xmm0
packuswb %xmm0,%xmm0
movd   %xmm1,(%rbx,%rsi,1)
movd   %xmm0,0x4(%rbx,%rsi,1)
cmp    %rcx,%rdx
je     1301 <test_standard_solution_strings+0x1c1>
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rdx,4),%eax
mov    %al,(%rbx,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    12f0 <test_standard_solution_strings+0x1b0>
movb   $0x0,(%rbx,%r9,1)
mov    -0x28(%rbp),%esi
lea    0xd58(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x30(%rbp),%rbx
mov    $0x26,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <_ada_use_solcon@plt>
mov    -0x28(%rbp),%esi
lea    0xd3c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <_ada_use_solcon@plt>
mov    %r12,%rsp
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%r8b
jne    12b2 <test_standard_solution_strings+0x172>
jmp    12e6 <test_standard_solution_strings+0x1a6>

LLVM IR (-O0):
@.str = [37 x i8] c"\0ATesting strings of solutions ... \0A\0A\00"
@.str.1 = [40 x i8] c"Give index of solution ( in [1,%d] ) : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [45 x i8] c"-> number of characters in solution %d : %d\0A\00"
@.str.4 = [22 x i8] c"the solution %d :\0A%s\0A\00"
@.str.5 = [45 x i8] c"the container after appending solution %d :\0A\00"
define void @test_standard_solution_strings(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca [2 x i32]
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%18 = load double*, double** %8
%19 = call i32 @_ada_use_solcon(i32 30, i32* %5, i32* %6, double* %18)
store i32 %19, i32* %7
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %11
%26 = alloca i32, i64 %24
store i64 %24, i64* %12
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
%29 = zext i32 %28 to i64
%30 = alloca i8, i64 %29
store i64 %29, i64* %13
%31 = load i32, i32* %5
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %31, i32* %32
%33 = load i32, i32* %6
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %33, i32* %34
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%36 = load double*, double** %8
%37 = call i32 @_ada_use_solcon(i32 31, i32* %35, i32* %26, double* %36)
store i32 %37, i32* %7
store i32 0, i32* %9
br label %38
38: ; preds = %51, %2
%39 = load i32, i32* %9
%40 = load i32, i32* %6
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %54
42: ; preds = %38
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %26, i64 %44
%46 = load i32, i32* %45
%47 = trunc i32 %46 to i8
%48 = load i32, i32* %9
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %30, i64 %49
store i8 %47, i8* %50
br label %51
51: ; preds = %42
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %38
54: ; preds = %38
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %30, i64 %56
store i8 0, i8* %57
%58 = load i32, i32* %5
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %58, i8* %30)
%60 = load i32, i32* %4
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %60, i32* %61
%62 = load i32, i32* %6
%63 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %62, i32* %63
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%65 = load double*, double** %8
%66 = call i32 @_ada_use_solcon(i32 38, i32* %64, i32* %26, double* %65)
store i32 %66, i32* %7
%67 = load i32, i32* %5
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i32 %67)
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%70 = load double*, double** %8
%71 = call i32 @_ada_use_solcon(i32 1, i32* %69, i32* %26, double* %70)
store i32 %71, i32* %7
%72 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"Give index of solution ( in [1,%d] ) : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [45 x i8] c"-> number of characters in solution %d : %d\0A\00"
@.str.4 = [22 x i8] c"the solution %d :\0A%s\0A\00"
@.str.5 = [45 x i8] c"the container after appending solution %d :\0A\00"
@str = [36 x i8] c"\0ATesting strings of solutions ... \0A\00"
define void @test_standard_solution_strings(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%11 = call i32 @_ada_use_solcon(i32 30, i32* %3, i32* %4, double* undef)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %13)
%15 = bitcast [2 x i32]* %5 to i8*
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
%19 = alloca i32, i64 %17
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = zext i32 %21 to i64
%23 = alloca i8, i64 %22
%24 = load i32, i32* %3
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %24, i32* %25
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %20, i32* %26
%27 = call i32 @_ada_use_solcon(i32 31, i32* %25, i32* %19, double* undef)
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %101
30: ; preds = %2
%31 = zext i32 %28 to i64
%32 = icmp ult i32 %28, 8
br i1 %32, label %91, label %33
33: ; preds = %30
%34 = and i64 %31, 4294967288
%35 = add nsw i64 %34, -8
%36 = lshr exact i64 %35, 3
%37 = add nuw nsw i64 %36, 1
%38 = and i64 %37, 1
%39 = icmp eq i64 %35, 0
br i1 %39, label %73, label %40
40: ; preds = %33
%41 = and i64 %37, 4611686018427387902
br label %42
42: ; preds = %42, %40
%43 = phi i64 [ 0, %40 ], [ %70, %42 ]
%44 = phi i64 [ 0, %40 ], [ %71, %42 ]
%45 = getelementptr inbounds i32, i32* %19, i64 %43
%46 = bitcast i32* %45 to <4 x i32>*
%47 = load <4 x i32>, <4 x i32>* %46
%48 = getelementptr inbounds i32, i32* %45, i64 4
%49 = bitcast i32* %48 to <4 x i32>*
%50 = load <4 x i32>, <4 x i32>* %49
%51 = trunc <4 x i32> %47 to <4 x i8>
%52 = trunc <4 x i32> %50 to <4 x i8>
%53 = getelementptr inbounds i8, i8* %23, i64 %43
%54 = bitcast i8* %53 to <4 x i8>*
store <4 x i8> %51, <4 x i8>* %54
%55 = getelementptr inbounds i8, i8* %53, i64 4
%56 = bitcast i8* %55 to <4 x i8>*
store <4 x i8> %52, <4 x i8>* %56
%57 = or i64 %43, 8
%58 = getelementptr inbounds i32, i32* %19, i64 %57
%59 = bitcast i32* %58 to <4 x i32>*
%60 = load <4 x i32>, <4 x i32>* %59
%61 = getelementptr inbounds i32, i32* %58, i64 4
%62 = bitcast i32* %61 to <4 x i32>*
%63 = load <4 x i32>, <4 x i32>* %62
%64 = trunc <4 x i32> %60 to <4 x i8>
%65 = trunc <4 x i32> %63 to <4 x i8>
%66 = getelementptr inbounds i8, i8* %23, i64 %57
%67 = bitcast i8* %66 to <4 x i8>*
store <4 x i8> %64, <4 x i8>* %67
%68 = getelementptr inbounds i8, i8* %66, i64 4
%69 = bitcast i8* %68 to <4 x i8>*
store <4 x i8> %65, <4 x i8>* %69
%70 = add nuw i64 %43, 16
%71 = add i64 %44, 2
%72 = icmp eq i64 %71, %41
br i1 %72, label %73, label %42
73: ; preds = %42, %33
%74 = phi i64 [ 0, %33 ], [ %70, %42 ]
%75 = icmp eq i64 %38, 0
br i1 %75, label %89, label %76
76: ; preds = %73
%77 = getelementptr inbounds i32, i32* %19, i64 %74
%78 = bitcast i32* %77 to <4 x i32>*
%79 = load <4 x i32>, <4 x i32>* %78
%80 = getelementptr inbounds i32, i32* %77, i64 4
%81 = bitcast i32* %80 to <4 x i32>*
%82 = load <4 x i32>, <4 x i32>* %81
%83 = trunc <4 x i32> %79 to <4 x i8>
%84 = trunc <4 x i32> %82 to <4 x i8>
%85 = getelementptr inbounds i8, i8* %23, i64 %74
%86 = bitcast i8* %85 to <4 x i8>*
store <4 x i8> %83, <4 x i8>* %86
%87 = getelementptr inbounds i8, i8* %85, i64 4
%88 = bitcast i8* %87 to <4 x i8>*
store <4 x i8> %84, <4 x i8>* %88
br label %89
89: ; preds = %73, %76
%90 = icmp eq i64 %34, %31
br i1 %90, label %101, label %91
91: ; preds = %30, %89
%92 = phi i64 [ 0, %30 ], [ %34, %89 ]
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ %99, %93 ], [ %92, %91 ]
%95 = getelementptr inbounds i32, i32* %19, i64 %94
%96 = load i32, i32* %95
%97 = trunc i32 %96 to i8
%98 = getelementptr inbounds i8, i8* %23, i64 %94
store i8 %97, i8* %98
%99 = add nuw nsw i64 %94, 1
%100 = icmp eq i64 %99, %31
br i1 %100, label %101, label %93
101: ; preds = %93, %89, %2
%102 = sext i32 %28 to i64
%103 = getelementptr inbounds i8, i8* %23, i64 %102
store i8 0, i8* %103
%104 = load i32, i32* %3
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %104, i8* %23)
store i32 %1, i32* %25
%106 = load i32, i32* %4
store i32 %106, i32* %26
%107 = call i32 @_ada_use_solcon(i32 38, i32* %25, i32* %19, double* undef)
%108 = load i32, i32* %3
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i32 %108)
%110 = call i32 @_ada_use_solcon(i32 1, i32* %25, i32* %19, double* undef)
ret void
}