#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);
void makeVal(char code, double *val) {
  double i_value;
  int j;
  assert(code >= 0 && code <= 22);
  if (code < 22)
    i_value = 0.0;
  else
    i_value = 1.0;
  for (j = 0; j < 20; j++)
    val[j] = i_value;
  if (code < 20)
    val[code] = 1.0;
  else {
    if (code == 20)
      val[2] = val[3] = 1.0;
    if (code == 21)
      val[5] = val[6] = 1.0;
  }
}


x86 assembly (clang, -O0):
<makeVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
jl     1141 <makeVal+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0x16,%eax
setle  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x16,%eax
jge    1168 <makeVal+0x58>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1175 <makeVal+0x65>
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    11a6 <makeVal+0x96>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117c <makeVal+0x6c>
movsbl -0x1(%rbp),%eax
cmp    $0x14,%eax
jge    11ce <makeVal+0xbe>
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
movsd  0xe3c(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1231 <makeVal+0x121>
movsbl -0x1(%rbp),%eax
cmp    $0x14,%eax
jne    11fd <makeVal+0xed>
mov    -0x10(%rbp),%rax
movsd  0xe19(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe08(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
movsbl -0x1(%rbp),%eax
cmp    $0x15,%eax
jne    122c <makeVal+0x11c>
mov    -0x10(%rbp),%rax
movsd  0xdea(%rip),%xmm0
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
movsd  0xdd9(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
jmp    1231 <makeVal+0x121>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeVal>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x17,%bpl
setb   %dil
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
cmp    $0x16,%bpl
jl     1138 <makeVal+0x28>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,(%rbx)
movsd  %xmm0,0x8(%rbx)
movsd  %xmm0,0x10(%rbx)
movsd  %xmm0,0x18(%rbx)
movsd  %xmm0,0x20(%rbx)
movsd  %xmm0,0x28(%rbx)
movsd  %xmm0,0x30(%rbx)
movsd  %xmm0,0x38(%rbx)
movsd  %xmm0,0x40(%rbx)
movsd  %xmm0,0x48(%rbx)
movsd  %xmm0,0x50(%rbx)
movsd  %xmm0,0x58(%rbx)
movsd  %xmm0,0x60(%rbx)
movsd  %xmm0,0x68(%rbx)
movsd  %xmm0,0x70(%rbx)
movsd  %xmm0,0x78(%rbx)
movsd  %xmm0,0x80(%rbx)
movsd  %xmm0,0x88(%rbx)
movsd  %xmm0,0x90(%rbx)
movsd  %xmm0,0x98(%rbx)
movabs $0x3ff0000000000000,%rax
cmp    $0x13,%bpl
jg     11c1 <makeVal+0xb1>
movsbq %bpl,%rcx
lea    (%rbx,%rcx,8),%rbx
jmp    11df <makeVal+0xcf>
cmp    $0x15,%bpl
je     11d7 <makeVal+0xc7>
cmp    $0x14,%bpl
jne    11e2 <makeVal+0xd2>
mov    %rax,0x18(%rbx)
add    $0x10,%rbx
jmp    11df <makeVal+0xcf>
mov    %rax,0x30(%rbx)
add    $0x28,%rbx
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @makeVal(i8 signext %0, double* %1) {
%3 = alloca i8
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store i8 %0, i8* %3
store double* %1, double** %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 22
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %19, 22
br i1 %20, label %21, label %22
21: ; preds = %14
store double 0.000000e+00, double* %5
br label %23
22: ; preds = %14
store double 1.000000e+00, double* %5
br label %23
23: ; preds = %22, %21
store i32 0, i32* %6
br label %24
24: ; preds = %33, %23
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 20
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load double, double* %5
%29 = load double*, double** %4
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double %28, double* %32
br label %33
33: ; preds = %27
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %24
36: ; preds = %24
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = icmp slt i32 %38, 20
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = load double*, double** %4
%42 = load i8, i8* %3
%43 = sext i8 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double 1.000000e+00, double* %44
br label %64
45: ; preds = %36
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 20
br i1 %48, label %49, label %54
49: ; preds = %45
%50 = load double*, double** %4
%51 = getelementptr inbounds double, double* %50, i64 3
store double 1.000000e+00, double* %51
%52 = load double*, double** %4
%53 = getelementptr inbounds double, double* %52, i64 2
store double 1.000000e+00, double* %53
br label %54
54: ; preds = %49, %45
%55 = load i8, i8* %3
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 21
br i1 %57, label %58, label %63
58: ; preds = %54
%59 = load double*, double** %4
%60 = getelementptr inbounds double, double* %59, i64 6
store double 1.000000e+00, double* %60
%61 = load double*, double** %4
%62 = getelementptr inbounds double, double* %61, i64 5
store double 1.000000e+00, double* %62
br label %63
63: ; preds = %58, %54
br label %64
64: ; preds = %63, %40
ret void
}

LLVM IR (-O2):
define void @makeVal(i8 signext %0, double* nocapture writeonly %1) {
%3 = icmp ult i8 %0, 23
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp slt i8 %0, 22
%7 = select i1 %6, double 0.000000e+00, double 1.000000e+00
store double %7, double* %1
%8 = getelementptr inbounds double, double* %1, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %1, i64 2
store double %7, double* %9
%10 = getelementptr inbounds double, double* %1, i64 3
store double %7, double* %10
%11 = getelementptr inbounds double, double* %1, i64 4
store double %7, double* %11
%12 = getelementptr inbounds double, double* %1, i64 5
store double %7, double* %12
%13 = getelementptr inbounds double, double* %1, i64 6
store double %7, double* %13
%14 = getelementptr inbounds double, double* %1, i64 7
store double %7, double* %14
%15 = getelementptr inbounds double, double* %1, i64 8
store double %7, double* %15
%16 = getelementptr inbounds double, double* %1, i64 9
store double %7, double* %16
%17 = getelementptr inbounds double, double* %1, i64 10
store double %7, double* %17
%18 = getelementptr inbounds double, double* %1, i64 11
store double %7, double* %18
%19 = getelementptr inbounds double, double* %1, i64 12
store double %7, double* %19
%20 = getelementptr inbounds double, double* %1, i64 13
store double %7, double* %20
%21 = getelementptr inbounds double, double* %1, i64 14
store double %7, double* %21
%22 = getelementptr inbounds double, double* %1, i64 15
store double %7, double* %22
%23 = getelementptr inbounds double, double* %1, i64 16
store double %7, double* %23
%24 = getelementptr inbounds double, double* %1, i64 17
store double %7, double* %24
%25 = getelementptr inbounds double, double* %1, i64 18
store double %7, double* %25
%26 = getelementptr inbounds double, double* %1, i64 19
store double %7, double* %26
%27 = icmp slt i8 %0, 20
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = sext i8 %0 to i64
%30 = getelementptr inbounds double, double* %1, i64 %29
br label %34
31: ; preds = %2
switch i8 %0, label %36 [
i8 20, label %32
i8 21, label %33
]
32: ; preds = %31
store double 1.000000e+00, double* %10
br label %34
33: ; preds = %31
store double 1.000000e+00, double* %13
br label %34
34: ; preds = %28, %33, %32
%35 = phi double* [ %9, %32 ], [ %12, %33 ], [ %30, %28 ]
store double 1.000000e+00, double* %35
br label %36
36: ; preds = %34, %31
ret void
}