#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 padcon_get_standard_solution(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char *);
int solcon_length_standard_solution_string(int, int *);
int solcon_write_standard_solution_string(int, int, char *);
void show_standard_solution(int index) {
  int fail, strlensol;
  fail = padcon_get_standard_solution(index, 0);
  fail = solcon_length_standard_solution_string(index, &strlensol);
  {
    char idxsol[strlensol + 1];
    fail = solcon_write_standard_solution_string(index, strlensol, idxsol);
    printf("Solution %d :\n%s\n", index, idxsol);
  }
}


x86 assembly (clang, -O0):
<show_standard_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1060 <padcon_get_standard_solution@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1050 <solcon_length_standard_solution_string@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <solcon_write_standard_solution_string@plt>
mov    -0x28(%rbp),%rdx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_standard_solution>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %esi,%esi
call   1060 <padcon_get_standard_solution@plt>
lea    -0x1c(%rbp),%rsi
mov    %r14d,%edi
call   1050 <solcon_length_standard_solution_string@plt>
mov    %rsp,%r15
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x1c(%rbp),%esi
mov    %r14d,%edi
mov    %rbx,%rdx
call   1030 <solcon_write_standard_solution_string@plt>
lea    0xe71(%rip),%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %r15,%rsp
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Solution %d :\0A%s\0A\00"
define void @show_standard_solution(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @padcon_get_standard_solution(i32 %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @solcon_length_standard_solution_string(i32 %9, i32* %4)
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %5
%15 = alloca i8, i64 %13
store i64 %13, i64* %6
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = call i32 @solcon_write_standard_solution_string(i32 %16, i32 %17, i8* %15)
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %19, i8* %15)
%21 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Solution %d :\0A%s\0A\00"
define void @show_standard_solution(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @padcon_get_standard_solution(i32 %0, i32 0)
%5 = call i32 @solcon_length_standard_solution_string(i32 %0, i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
%10 = alloca i8, i64 %8
%11 = load i32, i32* %2
%12 = call i32 @solcon_write_standard_solution_string(i32 %0, i32 %11, i8* %10)
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %10)
ret void
}