#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *, float);
int sscanf(char *, char *, float *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
void get_info(float *fvar, char *prompt) {
  char line[80];
  printf("\n%s: [%f] ", prompt, *fvar);
  fgets(line, 80, stdin);
  if (line[0] == '\n')
    return;
  else {
    while (sscanf(line, "%f", fvar) != 1) {
      fprintf(stderr, "ERROR: get_info.  Bad input.  Enter value again: ");
      fgets(line, 80, stdin);
    }
  }
}


x86 assembly (clang, -O0):
<get_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
movsbl -0x60(%rbp),%eax
cmp    $0xa,%eax
jne    1191 <get_info+0x51>
jmp    11e9 <get_info+0xa9>
jmp    1196 <get_info+0x56>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe66(%rip),%rsi
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     11e4 <get_info+0xa4>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e15(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
jmp    1196 <get_info+0x56>
jmp    11e9 <get_info+0xa9>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r15
movss  (%rdi),%xmm0
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%r13
mov    0x0(%r13),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
cmpb   $0xa,(%rsp)
je     11df <get_info+0x9f>
lea    0xe85(%rip),%rsi
mov    %rsp,%rdi
mov    %r15,%rdx
call   1060 <sscanf@plt>
cmp    $0x1,%eax
je     11df <get_info+0x9f>
mov    0x2e3b(%rip),%rbp
lea    0xe6a(%rip),%r14
mov    %rsp,%rbx
lea    0xe5d(%rip),%r12
xchg   %ax,%ax
mov    0x0(%rbp),%edi
mov    %r14,%rsi
call   1050 <fprintf@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    11b0 <get_info+0x70>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A%s: [%f] \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
@stderr = global i32 0
@.str.2 = [50 x i8] c"ERROR: get_info. Bad input. Enter value again: \00"
define void @get_info(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
%5 = alloca [80 x i8]
store float* %0, float** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6, float %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 80, i32 %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %2
br label %31
18: ; preds = %2
br label %19
19: ; preds = %24, %18
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%21 = load float*, float** %3
%22 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %21)
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%28 = load i32, i32* @stdin
%29 = call i32 @fgets(i8* %27, i32 80, i32 %28)
br label %19
30: ; preds = %19
br label %31
31: ; preds = %17, %30
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%s: [%f] \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
@stderr = global i32 0
@.str.2 = [50 x i8] c"ERROR: get_info. Bad input. Enter value again: \00"
define void @get_info(float* %0, i8* %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load float, float* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, float %5)
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %4, i32 80, i32 %7)
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 10
br i1 %10, label %21, label %11
11: ; preds = %2
%12 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %0)
%13 = icmp eq i32 %12, 1
br i1 %13, label %21, label %14
14: ; preds = %11, %14
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* @stdin
%18 = call i32 @fgets(i8* %4, i32 80, i32 %17)
%19 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %0)
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %14
21: ; preds = %14, %11, %2
ret void
}