#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_solpool(int, int *, int *, double *);
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  printf("\nTesting Solutions Pool...\n");
  adainit();
  {
    int n, s, fail, *b;
    double *c;
    printf("\nGive the size of the pool : ");
    scanf("%d", &n);
    fail = _ada_use_solpool(0, &n, b, c);
    fail = _ada_use_solpool(1, &s, b, c);
    printf("The size of the pool after initialization : %d\n", s);
  }
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <adainit@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1070 <_ada_use_solpool@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%edi
lea    -0xc(%rbp),%rsi
call   1070 <_ada_use_solpool@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <adafinal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <adainit@plt>
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1080 <_ada_use_solpool@plt>
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
call   1080 <_ada_use_solpool@plt>
mov    0x8(%rsp),%esi
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0ATesting Solutions Pool...\0A\00"
@.str.1 = [30 x i8] c"\0AGive the size of the pool : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"The size of the pool after initialization : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @adainit()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32*, i32** %5
%12 = load double*, double** %6
%13 = call i32 @_ada_use_solpool(i32 0, i32* %2, i32* %11, double* %12)
store i32 %13, i32* %4
%14 = load i32*, i32** %5
%15 = load double*, double** %6
%16 = call i32 @_ada_use_solpool(i32 1, i32* %3, i32* %14, double* %15)
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"\0AGive the size of the pool : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [48 x i8] c"The size of the pool after initialization : %d\0A\00"
@str = [27 x i8] c"\0ATesting Solutions Pool...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @adainit()
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = call i32 @_ada_use_solpool(i32 0, i32* %1, i32* undef, double* undef)
%10 = call i32 @_ada_use_solpool(i32 1, i32* %2, i32* undef, double* undef)
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @adafinal()
ret i32 0
}