#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*/ assert(int);
char pick_unknown(char ***);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void interactive_parse(char parameters[4][2][64], char *ptr_unknown_choice,
                       float *driving_speed, float *driving_teeth,
                       float *driven_speed, float *driven_teeth) {
  int i;
  printf("Index | Parameter Name\n");
  for (i = 0; i < 4; i++)
    printf("%4s  | %s\n", parameters[i][0], parameters[i][1]);
  *ptr_unknown_choice = pick_unknown(parameters);
  if (*ptr_unknown_choice != 'A') {
    printf("Enter the speed of the driving gear:");
    scanf("%f", driving_speed);
    assert(*driving_speed > 0);
  }
  if (*ptr_unknown_choice != 'B') {
    printf("Enter the number of teeth of the driving gear:");
    scanf("%f", driving_teeth);
    assert(*driving_teeth > 0);
  }
  if (*ptr_unknown_choice != 'C') {
    printf("Enter the speed of the driven gear:");
    scanf("%f", driven_speed);
    assert(*driven_speed > 0);
  }
  if (*ptr_unknown_choice != 'D') {
    printf("Enter the number of teeth of the driven gear:");
    scanf("%f", driven_teeth);
    assert(*driven_teeth > 0);
  }
}


x86 assembly (clang, -O0):
<interactive_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    11bd <interactive_parse+0x7d>
mov    -0x8(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rsi
mov    -0x8(%rbp),%rdx
movslq -0x34(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rdx
add    $0x40,%rdx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1175 <interactive_parse+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <pick_unknown@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
je     1217 <interactive_parse+0xd7>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe51(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x42,%eax
je     1260 <interactive_parse+0x120>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe08(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x43,%eax
je     12a9 <interactive_parse+0x169>
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdbf(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x44,%eax
je     12f2 <interactive_parse+0x1b2>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xd76(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interactive_parse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xf3f(%rip),%rdi
call   1040 <puts@plt>
lea    0x40(%rbp),%rdx
lea    0xe7b(%rip),%r14
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x80(%rbp),%rsi
lea    0xc0(%rbp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x100(%rbp),%rsi
lea    0x140(%rbp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x180(%rbp),%rsi
lea    0x1c0(%rbp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1030 <pick_unknown@plt>
mov    %al,(%rbx)
cmp    $0x41,%al
je     1221 <interactive_parse+0xd1>
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe33(%rip),%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
movss  0x0(%r13),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1060 <assert@plt>
cmpb   $0x42,(%rbx)
je     125a <interactive_parse+0x10a>
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
movss  (%r12),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1060 <assert@plt>
cmpb   $0x43,(%rbx)
je     12a1 <interactive_parse+0x151>
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc1(%rip),%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movss  (%r15),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1060 <assert@plt>
cmpb   $0x44,(%rbx)
jne    12a1 <interactive_parse+0x151>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdde(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd7a(%rip),%rdi
mov    (%rsp),%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
movss  (%rbx),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <assert@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Index | Parameter Name\0A\00"
@.str.1 = [11 x i8] c"%4s | %s\0A\00"
@.str.2 = [37 x i8] c"Enter the speed of the driving gear:\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [47 x i8] c"Enter the number of teeth of the driving gear:\00"
@.str.5 = [36 x i8] c"Enter the speed of the driven gear:\00"
@.str.6 = [46 x i8] c"Enter the number of teeth of the driven gear:\00"
define void @interactive_parse([2 x [64 x i8]]* %0, i8* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca [2 x [64 x i8]]*
%8 = alloca i8*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca i32
store [2 x [64 x i8]]* %0, [2 x [64 x i8]]** %7
store i8* %1, i8** %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %13
br label %15
15: ; preds = %32, %6
%16 = load i32, i32* %13
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = load [2 x [64 x i8]]*, [2 x [64 x i8]]** %7
%20 = load i32, i32* %13
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %19, i64 %21
%23 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %22, i64 0, i64 0
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %23, i64 0, i64 0
%25 = load [2 x [64 x i8]]*, [2 x [64 x i8]]** %7
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %25, i64 %27
%29 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %28, i64 0, i64 1
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %29, i64 0, i64 0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %24, i8* %30)
br label %32
32: ; preds = %18
%33 = load i32, i32* %13
%34 = add nsw i32 %33, 1
store i32 %34, i32* %13
br label %15
35: ; preds = %15
%36 = load [2 x [64 x i8]]*, [2 x [64 x i8]]** %7
%37 = bitcast [2 x [64 x i8]]* %36 to i8***
%38 = call signext i8 @pick_unknown(i8*** %37)
%39 = load i8*, i8** %8
store i8 %38, i8* %39
%40 = load i8*, i8** %8
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 65
br i1 %43, label %44, label %53
44: ; preds = %35
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%46 = load float*, float** %9
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %46)
%48 = load float*, float** %9
%49 = load float, float* %48
%50 = fcmp ogt float %49, 0.000000e+00
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
br label %53
53: ; preds = %44, %35
%54 = load i8*, i8** %8
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 66
br i1 %57, label %58, label %67
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%60 = load float*, float** %10
%61 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %60)
%62 = load float*, float** %10
%63 = load float, float* %62
%64 = fcmp ogt float %63, 0.000000e+00
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
br label %67
67: ; preds = %58, %53
%68 = load i8*, i8** %8
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 67
br i1 %71, label %72, label %81
72: ; preds = %67
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%74 = load float*, float** %11
%75 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %74)
%76 = load float*, float** %11
%77 = load float, float* %76
%78 = fcmp ogt float %77, 0.000000e+00
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
br label %81
81: ; preds = %72, %67
%82 = load i8*, i8** %8
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 68
br i1 %85, label %86, label %95
86: ; preds = %81
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%88 = load float*, float** %12
%89 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %88)
%90 = load float*, float** %12
%91 = load float, float* %90
%92 = fcmp ogt float %91, 0.000000e+00
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
br label %95
95: ; preds = %86, %81
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%4s | %s\0A\00"
@.str.2 = [37 x i8] c"Enter the speed of the driving gear:\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [47 x i8] c"Enter the number of teeth of the driving gear:\00"
@.str.5 = [36 x i8] c"Enter the speed of the driven gear:\00"
@.str.6 = [46 x i8] c"Enter the number of teeth of the driven gear:\00"
@str = [23 x i8] c"Index | Parameter Name\00"
define void @interactive_parse([2 x [64 x i8]]* %0, i8* nocapture %1, float* %2, float* %3, float* %4, float* %5) {
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%8 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 0, i64 0, i64 0
%9 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 0, i64 1, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 1, i64 0, i64 0
%12 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 1, i64 1, i64 0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 2, i64 0, i64 0
%15 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 2, i64 1, i64 0
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
%17 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 3, i64 0, i64 0
%18 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %0, i64 3, i64 1, i64 0
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18)
%20 = bitcast [2 x [64 x i8]]* %0 to i8***
%21 = tail call signext i8 @pick_unknown(i8*** %20)
store i8 %21, i8* %1
%22 = icmp eq i8 %21, 65
br i1 %22, label %32, label %23
23: ; preds = %6
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%26 = load float, float* %2
%27 = fcmp ogt float %26, 0.000000e+00
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = load i8, i8* %1
%31 = icmp eq i8 %30, 66
br i1 %31, label %41, label %32
32: ; preds = %6, %23
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%34 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%35 = load float, float* %3
%36 = fcmp ogt float %35, 0.000000e+00
%37 = zext i1 %36 to i32
%38 = tail call i32 @assert(i32 %37)
%39 = load i8, i8* %1
%40 = icmp eq i8 %39, 67
br i1 %40, label %50, label %41
41: ; preds = %23, %32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%43 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%44 = load float, float* %4
%45 = fcmp ogt float %44, 0.000000e+00
%46 = zext i1 %45 to i32
%47 = tail call i32 @assert(i32 %46)
%48 = load i8, i8* %1
%49 = icmp eq i8 %48, 68
br i1 %49, label %57, label %50
50: ; preds = %32, %41
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%52 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%53 = load float, float* %5
%54 = fcmp ogt float %53, 0.000000e+00
%55 = zext i1 %54 to i32
%56 = tail call i32 @assert(i32 %55)
br label %57
57: ; preds = %50, %41
ret void
}