#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 *, char);
int /*<<< orphan*/ scanf(char *, int *);
void CreateValTbl(char *varTbl, int *valTbl) {
  int i = 0;
  for (i = 0; varTbl[i] != '#'; i++) {
    printf("\tEnter the value of %c: ", varTbl[i]);
    scanf("%d", &valTbl[i]);
  }
}


x86 assembly (clang, -O0):
<CreateValTbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     1194 <CreateValTbl+0x74>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xe9e(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe98(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <CreateValTbl+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateValTbl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%al
cmp    $0x23,%al
je     1175 <CreateValTbl+0x55>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec1(%rip),%r15
lea    0xed3(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movzbl (%rbx),%eax
add    $0x4,%r14
add    $0x1,%rbx
cmp    $0x23,%al
jne    1150 <CreateValTbl+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\09Enter the value of %c: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @CreateValTbl(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 35
br i1 %13, label %14, label %29
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext %19)
%21 = load i32*, i32** %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %14
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\09Enter the value of %c: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @CreateValTbl(i8* nocapture %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 35
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8 [ %13, %5 ], [ %3, %2 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = getelementptr inbounds i32, i32* %1, i64 %6
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw i64 %6, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 35
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}