#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*/ free(char *);
char *next_varbprec_solution(int, int, int, int, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int call_varbprec_path_tracker(void) {
  int fail, len;
  int want = 8;
  int maxprc = 256;
  int maxitr = 3;
  int vrb = 1;
  char *sol, answer;
  do {
    sol = next_varbprec_solution(want, maxprc, maxitr, vrb, &len, &fail);
    if (fail == 0) {
      printf("The next solution :\n%s\n", sol);
      free(sol);
    }
    printf("Continue to next step ? (y/n) ");
    scanf("%c", &answer);
    scanf("%c", &answer);
  } while (answer == 'y');
  return fail;
}


x86 assembly (clang, -O0):
<call_varbprec_path_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x8,-0xc(%rbp)
movl   $0x100,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x8(%rbp),%r8
lea    -0x4(%rbp),%r9
call   1040 <next_varbprec_solution@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11a6 <call_varbprec_path_tracker+0x66>
mov    -0x20(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0x21(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe6c(%rip),%rdi
lea    -0x21(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x21(%rbp),%eax
cmp    $0x79,%eax
je     1164 <call_varbprec_path_tracker+0x24>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_varbprec_path_tracker>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r12
lea    0xeb9(%rip),%r13
lea    0xed1(%rip),%rbx
lea    0xf(%rsp),%rbp
jmp    1197 <call_varbprec_path_tracker+0x57>
nopl   (%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
cmpb   $0x79,0xf(%rsp)
jne    11db <call_varbprec_path_tracker+0x9b>
mov    $0x8,%edi
mov    $0x100,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    %r14,%r8
mov    %r12,%r9
call   1040 <next_varbprec_solution@plt>
cmpl   $0x0,0x10(%rsp)
jne    1170 <call_varbprec_path_tracker+0x30>
mov    %rax,%r15
lea    0xe39(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    1170 <call_varbprec_path_tracker+0x30>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The next solution :\0A%s\0A\00"
@.str.1 = [31 x i8] c"Continue to next step ? (y/n) \00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @call_varbprec_path_tracker() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
store i32 8, i32* %3
store i32 256, i32* %4
store i32 3, i32* %5
store i32 1, i32* %6
br label %9
9: ; preds = %26, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i8* @next_varbprec_solution(i32 %10, i32 %11, i32 %12, i32 %13, i32* %2, i32* %1)
store i8* %14, i8** %7
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %9
%18 = load i8*, i8** %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %7
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %17, %9
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %26
26: ; preds = %22
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 121
br i1 %29, label %9, label %30
30: ; preds = %26
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [24 x i8] c"The next solution :\0A%s\0A\00"
@.str.1 = [31 x i8] c"Continue to next step ? (y/n) \00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @call_varbprec_path_tracker() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
br label %6
6: ; preds = %13, %0
%7 = call i8* @next_varbprec_solution(i32 8, i32 256, i32 3, i32 1, i32* %2, i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%12 = call i32 @free(i8* %7)
br label %13
13: ; preds = %10, %6
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%17 = load i8, i8* %3
%18 = icmp eq i8 %17, 121
br i1 %18, label %6, label %19
19: ; preds = %13
%20 = load i32, i32* %1
ret i32 %20
}