#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long, long);
int /*<<< orphan*/ printf(char *, char);
void write_dc_info(FILE *fp, char class) {
  long int input_tuples, attrnum;
  if (class == 'S') {
    input_tuples = 1000;
    attrnum = 5;
  } else if (class == 'W') {
    input_tuples = 100000;
    attrnum = 10;
  } else if (class == 'A') {
    input_tuples = 1000000;
    attrnum = 15;
  } else if (class == 'B') {
    input_tuples = 10000000;
    attrnum = 20;
  } else {
    printf("setparams: Internal error: invalid class %c\n", class);
    exit(1);
  }
  fprintf(fp, "long long int input_tuples=%ld, attrnum=%ld;\n", input_tuples,
          attrnum);
}


x86 assembly (clang, -O0):
<write_dc_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
jne    1164 <write_dc_info+0x34>
movq   $0x3e8,-0x18(%rbp)
movq   $0x5,-0x20(%rbp)
jmp    11f3 <write_dc_info+0xc3>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1186 <write_dc_info+0x56>
movq   $0x186a0,-0x18(%rbp)
movq   $0xa,-0x20(%rbp)
jmp    11ee <write_dc_info+0xbe>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    11a8 <write_dc_info+0x78>
movq   $0xf4240,-0x18(%rbp)
movq   $0xf,-0x20(%rbp)
jmp    11e9 <write_dc_info+0xb9>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11ca <write_dc_info+0x9a>
movq   $0x989680,-0x18(%rbp)
movq   $0x14,-0x20(%rbp)
jmp    11e4 <write_dc_info+0xb4>
lea    0xe2f(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11e9 <write_dc_info+0xb9>
jmp    11ee <write_dc_info+0xbe>
jmp    11f3 <write_dc_info+0xc3>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe27(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dc_info>:
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1184 <write_dc_info+0x54>
mov    $0x5,%ecx
mov    $0x3e8,%edx
movzbl %al,%eax
lea    0xeb4(%rip),%r8
movslq (%r8,%rax,4),%rax
add    %r8,%rax
jmp    *%rax
mov    $0xf,%ecx
mov    $0xf4240,%edx
jmp    1177 <write_dc_info+0x47>
mov    $0x14,%ecx
mov    $0x989680,%edx
jmp    1177 <write_dc_info+0x47>
mov    $0xa,%ecx
mov    $0x186a0,%edx
lea    0xf0b(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.1 = [46 x i8] c"long long int input_tuples=%ld, attrnum=%ld;\0A\00"
define void @write_dc_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 83
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 1000, i64* %5
store i64 5, i64* %6
br label %33
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 87
br i1 %14, label %15, label %16
15: ; preds = %11
store i64 100000, i64* %5
store i64 10, i64* %6
br label %32
16: ; preds = %11
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 65
br i1 %19, label %20, label %21
20: ; preds = %16
store i64 1000000, i64* %5
store i64 15, i64* %6
br label %31
21: ; preds = %16
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 66
br i1 %24, label %25, label %26
25: ; preds = %21
store i64 10000000, i64* %5
store i64 20, i64* %6
br label %30
26: ; preds = %21
%27 = load i8, i8* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext %27)
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %25
br label %31
31: ; preds = %30, %20
br label %32
32: ; preds = %31, %15
br label %33
33: ; preds = %32, %10
%34 = load i32*, i32** %3
%35 = load i64, i64* %5
%36 = load i64, i64* %6
%37 = call i32 @fprintf(i32* %34, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i64 %35, i64 %36)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.1 = [46 x i8] c"long long int input_tuples=%ld, attrnum=%ld;\0A\00"
define void @write_dc_info(i32* nocapture %0, i8 signext %1) {
switch i8 %1, label %6 [
i8 83, label %9
i8 87, label %3
i8 65, label %4
i8 66, label %5
]
3: ; preds = %2
br label %9
4: ; preds = %2
br label %9
5: ; preds = %2
br label %9
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2, %3, %5, %4
%10 = phi i64 [ 100000, %3 ], [ 1000000, %4 ], [ 10000000, %5 ], [ 1000, %2 ]
%11 = phi i64 [ 10, %3 ], [ 15, %4 ], [ 20, %5 ], [ 5, %2 ]
%12 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i64 %10, i64 %11)
ret void
}