#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 */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int prompt_for_artificial(void) {
  char answer, nlsb;
  printf("\nEither a homotopy has a parameter among its variables,\n");
  printf("or the parameter is artificial and the homotopy connects\n");
  printf("a target system to a start system with known solutions.\n");
  printf("Is the homotopy an artificial parameter homotopy ? (y/n) ");
  answer = getchar();
  scanf("%c", &nlsb);
  if (answer == 'y')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<prompt_for_artificial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf49(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
lea    0xf6d(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
jne    119b <prompt_for_artificial+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <prompt_for_artificial+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_for_artificial>:
push   %rbx
sub    $0x10,%rsp
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    0xeb5(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
cmp    $0x79,%bl
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"\0AEither a homotopy has a parameter among its variables,\0A\00"
@.str.1 = [58 x i8] c"or the parameter is artificial and the homotopy connects\0A\00"
@.str.2 = [57 x i8] c"a target system to a start system with known solutions.\0A\00"
@.str.3 = [58 x i8] c"Is the homotopy an artificial parameter homotopy ? (y/n) \00"
@.str.4 = [3 x i8] c"%c\00"
define i32 @prompt_for_artificial() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str.3 = [58 x i8] c"Is the homotopy an artificial parameter homotopy ? (y/n) \00"
@.str.4 = [3 x i8] c"%c\00"
@str = [56 x i8] c"\0AEither a homotopy has a parameter among its variables,\00"
@str.5 = [57 x i8] c"or the parameter is artificial and the homotopy connects\00"
@str.6 = [56 x i8] c"a target system to a start system with known solutions.\00"
define i32 @prompt_for_artificial() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%8 = icmp eq i8 %6, 121
%9 = zext i1 %8 to i32
ret i32 %9
}