#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*/ lcd_clear(int);
int /*<<< orphan*/ lcd_msg(char *);
void lcd_disp2(int choose) {
  char msg1[] = "JK1 IS OK%";
  char msg2[] = "JK1 IS BAD%";
  char msg3[] = "JK2 IS OK%";
  char msg4[] = "JK2 IS BAD%";
  char msg5[] = "D1 IS OK%";
  char msg6[] = "D1 IS BAD%";
  char msg7[] = "D2 IS OK%";
  char msg8[] = "D2 IS BAD%";
  switch (choose) {
  case 1:
    lcd_msg(msg1);
    lcd_clear(0xc0);
    break;
  case 2:
    lcd_msg(msg2);
    lcd_clear(0xc0);
    break;
  case 3:
    lcd_msg(msg3);
    break;
  case 4:
    lcd_msg(msg4);
    break;
  case 5:
    lcd_msg(msg5);
    lcd_clear(0xc0);
    break;
  case 6:
    lcd_msg(msg6);
    lcd_clear(0xc0);
    break;
  case 7:
    lcd_msg(msg7);
    break;
  case 8:
    lcd_msg(msg8);
    break;
  }
}


x86 assembly (clang, -O0):
<lcd_disp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
movabs $0x4f20534920314b4a,%rax
53 20 4f
mov    %rax,-0x10(%rbp)
movl   $0x254b4f,-0x9(%rbp)
movabs $0x4220534920314b4a,%rax
53 20 42
mov    %rax,-0x20(%rbp)
movl   $0x254441,-0x18(%rbp)
movabs $0x4f20534920324b4a,%rax
53 20 4f
mov    %rax,-0x30(%rbp)
movl   $0x254b4f,-0x29(%rbp)
movabs $0x4220534920324b4a,%rax
53 20 42
mov    %rax,-0x40(%rbp)
movl   $0x254441,-0x38(%rbp)
movabs $0x4b4f205349203144,%rax
20 4f 4b
mov    %rax,-0x50(%rbp)
movw   $0x25,-0x48(%rbp)
movabs $0x4142205349203144,%rax
20 42 41
mov    %rax,-0x60(%rbp)
movl   $0x254441,-0x59(%rbp)
movabs $0x4b4f205349203244,%rax
20 4f 4b
mov    %rax,-0x70(%rbp)
movw   $0x25,-0x68(%rbp)
movabs $0x4142205349203244,%rax
20 42 41
mov    %rax,-0x80(%rbp)
movl   $0x254441,-0x79(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x88(%rbp)
sub    $0x7,%eax
ja     1296 <lcd_disp2+0x176>
mov    -0x88(%rbp),%rax
lea    0xe06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x10(%rbp),%rdi
call   1030 <lcd_msg@plt>
mov    $0xc0,%edi
call   1040 <lcd_clear@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x20(%rbp),%rdi
call   1030 <lcd_msg@plt>
mov    $0xc0,%edi
call   1040 <lcd_clear@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x30(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x40(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x50(%rbp),%rdi
call   1030 <lcd_msg@plt>
mov    $0xc0,%edi
call   1040 <lcd_clear@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x60(%rbp),%rdi
call   1030 <lcd_msg@plt>
mov    $0xc0,%edi
call   1040 <lcd_clear@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x70(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    1296 <lcd_disp2+0x176>
lea    -0x80(%rbp),%rdi
call   1030 <lcd_msg@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_disp2>:
sub    $0x88,%rsp
movabs $0x4f20534920314b4a,%rax
53 20 4f
mov    %rax,0x58(%rsp)
movl   $0x254b4f,0x5f(%rsp)
movabs $0x4220534920314b4a,%rax
53 20 42
mov    %rax,0x78(%rsp)
movl   $0x254441,0x80(%rsp)
movabs $0x4f20534920324b4a,%rax
53 20 4f
mov    %rax,0x48(%rsp)
movl   $0x254b4f,0x4f(%rsp)
movabs $0x4220534920324b4a,%rax
53 20 42
mov    %rax,0x68(%rsp)
movl   $0x254441,0x70(%rsp)
movabs $0x4b4f205349203144,%rax
20 4f 4b
mov    %rax,0x18(%rsp)
movw   $0x25,0x20(%rsp)
movabs $0x4142205349203144,%rax
20 42 41
mov    %rax,0x38(%rsp)
movl   $0x254441,0x3f(%rsp)
movabs $0x4b4f205349203244,%rax
20 4f 4b
mov    %rax,0x8(%rsp)
movw   $0x25,0x10(%rsp)
movabs $0x4142205349203244,%rax
20 42 41
mov    %rax,0x28(%rsp)
movl   $0x254441,0x2f(%rsp)
add    $0xffffffff,%edi
cmp    $0x7,%edi
ja     1248 <lcd_disp2+0x128>
lea    0xe11(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x58(%rsp),%rdi
jmp    1220 <lcd_disp2+0x100>
lea    0x78(%rsp),%rdi
jmp    1220 <lcd_disp2+0x100>
lea    0x48(%rsp),%rdi
jmp    1243 <lcd_disp2+0x123>
lea    0x68(%rsp),%rdi
jmp    1243 <lcd_disp2+0x123>
lea    0x18(%rsp),%rdi
jmp    1220 <lcd_disp2+0x100>
lea    0x38(%rsp),%rdi
call   1030 <lcd_msg@plt>
mov    $0xc0,%edi
call   1040 <lcd_clear@plt>
add    $0x88,%rsp
ret
lea    0x8(%rsp),%rdi
jmp    1243 <lcd_disp2+0x123>
lea    0x28(%rsp),%rdi
call   1030 <lcd_msg@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@__const.lcd_disp2.msg1 = [11 x i8] c"JK1 IS OK%\00"
@__const.lcd_disp2.msg2 = [12 x i8] c"JK1 IS BAD%\00"
@__const.lcd_disp2.msg3 = [11 x i8] c"JK2 IS OK%\00"
@__const.lcd_disp2.msg4 = [12 x i8] c"JK2 IS BAD%\00"
@__const.lcd_disp2.msg5 = [10 x i8] c"D1 IS OK%\00"
@__const.lcd_disp2.msg6 = [11 x i8] c"D1 IS BAD%\00"
@__const.lcd_disp2.msg7 = [10 x i8] c"D2 IS OK%\00"
@__const.lcd_disp2.msg8 = [11 x i8] c"D2 IS BAD%\00"
define void @lcd_disp2(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca [12 x i8]
%5 = alloca [11 x i8]
%6 = alloca [12 x i8]
%7 = alloca [10 x i8]
%8 = alloca [11 x i8]
%9 = alloca [10 x i8]
%10 = alloca [11 x i8]
store i32 %0, i32* %2
%11 = bitcast [11 x i8]* %3 to i8*
%12 = bitcast [12 x i8]* %4 to i8*
%13 = bitcast [11 x i8]* %5 to i8*
%14 = bitcast [12 x i8]* %6 to i8*
%15 = bitcast [10 x i8]* %7 to i8*
%16 = bitcast [11 x i8]* %8 to i8*
%17 = bitcast [10 x i8]* %9 to i8*
%18 = bitcast [11 x i8]* %10 to i8*
%19 = load i32, i32* %2
switch i32 %19, label %48 [
i32 1, label %20
i32 2, label %24
i32 3, label %28
i32 4, label %31
i32 5, label %34
i32 6, label %38
i32 7, label %42
i32 8, label %45
]
20: ; preds = %1
%21 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%22 = call i32 @lcd_msg(i8* %21)
%23 = call i32 @lcd_clear(i32 192)
br label %48
24: ; preds = %1
%25 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%26 = call i32 @lcd_msg(i8* %25)
%27 = call i32 @lcd_clear(i32 192)
br label %48
28: ; preds = %1
%29 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%30 = call i32 @lcd_msg(i8* %29)
br label %48
31: ; preds = %1
%32 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%33 = call i32 @lcd_msg(i8* %32)
br label %48
34: ; preds = %1
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%36 = call i32 @lcd_msg(i8* %35)
%37 = call i32 @lcd_clear(i32 192)
br label %48
38: ; preds = %1
%39 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%40 = call i32 @lcd_msg(i8* %39)
%41 = call i32 @lcd_clear(i32 192)
br label %48
42: ; preds = %1
%43 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%44 = call i32 @lcd_msg(i8* %43)
br label %48
45: ; preds = %1
%46 = getelementptr inbounds [11 x i8], [11 x i8]* %10, i64 0, i64 0
%47 = call i32 @lcd_msg(i8* %46)
br label %48
48: ; preds = %1, %45, %42, %38, %34, %31, %28, %24, %20
ret void
}

LLVM IR (-O2):
@__const.lcd_disp2.msg1 = [11 x i8] c"JK1 IS OK%\00"
@__const.lcd_disp2.msg2 = [12 x i8] c"JK1 IS BAD%\00"
@__const.lcd_disp2.msg3 = [11 x i8] c"JK2 IS OK%\00"
@__const.lcd_disp2.msg4 = [12 x i8] c"JK2 IS BAD%\00"
@__const.lcd_disp2.msg5 = [10 x i8] c"D1 IS OK%\00"
@__const.lcd_disp2.msg6 = [11 x i8] c"D1 IS BAD%\00"
@__const.lcd_disp2.msg7 = [10 x i8] c"D2 IS OK%\00"
@__const.lcd_disp2.msg8 = [11 x i8] c"D2 IS BAD%\00"
define void @lcd_disp2(i32 %0) {
%2 = alloca [11 x i8]
%3 = alloca [12 x i8]
%4 = alloca [11 x i8]
%5 = alloca [12 x i8]
%6 = alloca [10 x i8]
%7 = alloca [11 x i8]
%8 = alloca [10 x i8]
%9 = alloca [11 x i8]
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds [11 x i8], [11 x i8]* %9, i64 0, i64 0
switch i32 %0, label %38 [
i32 1, label %18
i32 2, label %21
i32 3, label %24
i32 4, label %26
i32 5, label %28
i32 6, label %31
i32 7, label %34
i32 8, label %36
]
18: ; preds = %1
%19 = call i32 @lcd_msg(i8* %10)
%20 = call i32 @lcd_clear(i32 192)
br label %38
21: ; preds = %1
%22 = call i32 @lcd_msg(i8* %11)
%23 = call i32 @lcd_clear(i32 192)
br label %38
24: ; preds = %1
%25 = call i32 @lcd_msg(i8* %12)
br label %38
26: ; preds = %1
%27 = call i32 @lcd_msg(i8* %13)
br label %38
28: ; preds = %1
%29 = call i32 @lcd_msg(i8* %14)
%30 = call i32 @lcd_clear(i32 192)
br label %38
31: ; preds = %1
%32 = call i32 @lcd_msg(i8* %15)
%33 = call i32 @lcd_clear(i32 192)
br label %38
34: ; preds = %1
%35 = call i32 @lcd_msg(i8* %16)
br label %38
36: ; preds = %1
%37 = call i32 @lcd_msg(i8* %17)
br label %38
38: ; preds = %1, %36, %34, %31, %28, %26, %24, %21, %18
ret void
}