#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 *, char *);
int solcon_number_of_standard_solutions(int *);
int solcon_read_standard_solutions_from_file(int, char *);
int strlen(char *);
void test_read_solutions_from_file(void) {
  char name[80];
  int nbc, fail, len;
  printf("Give the name of the file : ");
  scanf("%s", name);
  printf("Reading solutions from file with name \"%s\" ...\n", name);
  nbc = strlen(name);
  printf("-> number of characters in name : %d\n", nbc);
  printf("\ncalling solcon_read_standard_solutions_from_file ...\n");
  fail = solcon_read_standard_solutions_from_file(nbc, name);
  fail = solcon_number_of_standard_solutions(&len);
  printf("Number of solutions : %d\n", len);
}


x86 assembly (clang, -O0):
<test_read_solutions_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1050 <solcon_read_standard_solutions_from_file@plt>
mov    %eax,-0x58(%rbp)
lea    -0x5c(%rbp),%rdi
call   1060 <solcon_number_of_standard_solutions@plt>
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_read_solutions_from_file>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea2(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1080 <scanf@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0xea6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <solcon_read_standard_solutions_from_file@plt>
lea    0xc(%rsp),%rdi
call   1070 <solcon_number_of_standard_solutions@plt>
mov    0xc(%rsp),%esi
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Give the name of the file : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [48 x i8] c"Reading solutions from file with name \22%s\22 ...\0A\00"
@.str.3 = [38 x i8] c"-> number of characters in name : %d\0A\00"
@.str.4 = [55 x i8] c"\0Acalling solcon_read_standard_solutions_from_file ...\0A\00"
@.str.5 = [26 x i8] c"Number of solutions : %d\0A\00"
define void @test_read_solutions_from_file() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%17 = call i32 @solcon_read_standard_solutions_from_file(i32 %15, i8* %16)
store i32 %17, i32* %3
%18 = call i32 @solcon_number_of_standard_solutions(i32* %4)
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Give the name of the file : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [48 x i8] c"Reading solutions from file with name \22%s\22 ...\0A\00"
@.str.3 = [38 x i8] c"-> number of characters in name : %d\0A\00"
@.str.5 = [26 x i8] c"Number of solutions : %d\0A\00"
@str = [54 x i8] c"\0Acalling solcon_read_standard_solutions_from_file ...\00"
define void @test_read_solutions_from_file() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 @strlen(i8* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%11 = call i32 @solcon_read_standard_solutions_from_file(i32 %8, i8* %3)
%12 = call i32 @solcon_number_of_standard_solutions(i32* %2)
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %13)
ret void
}