#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_msg(char *);
void lcd_disp1(int choose) {
  char msg1[] = "MUX 8:1 IS OK%";
  char msg2[] = "MUX 8:1 IS BAD%";
  char msg3[] = "DEC 3:8 IS OK%";
  char msg4[] = "DEC 3:8 IS BAD%";
  char msg5[] = "FA 2BIT IS OK%";
  char msg6[] = "FA 2BIT IS BAD%";
  switch (choose) {
  case 1:
    lcd_msg(msg1);
    break;
  case 2:
    lcd_msg(msg2);
    break;
  case 3:
    lcd_msg(msg3);
    break;
  case 4:
    lcd_msg(msg4);
    break;
  case 5:
    lcd_msg(msg5);
    break;
  case 6:
    lcd_msg(msg6);
    break;
  }
}


x86 assembly (clang, -O0):
<lcd_disp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
movabs $0x254b4f20534920,%rax
mov    %rax,-0x11(%rbp)
movabs $0x20313a382058554d,%rcx
3a 31 20
mov    %rcx,-0x18(%rbp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
mov    %rax,-0x39(%rbp)
movabs $0x20383a3320434544,%rcx
3a 38 20
mov    %rcx,-0x40(%rbp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
mov    %rax,-0x59(%rbp)
movabs $0x2054494232204146,%rax
49 54 20
mov    %rax,-0x60(%rbp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x5,%eax
ja     11f7 <lcd_disp1+0xe7>
mov    -0x78(%rbp),%rax
lea    0xe61(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x18(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    11f7 <lcd_disp1+0xe7>
lea    -0x30(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    11f7 <lcd_disp1+0xe7>
lea    -0x40(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    11f7 <lcd_disp1+0xe7>
lea    -0x50(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    11f7 <lcd_disp1+0xe7>
lea    -0x60(%rbp),%rdi
call   1030 <lcd_msg@plt>
jmp    11f7 <lcd_disp1+0xe7>
lea    -0x70(%rbp),%rdi
call   1030 <lcd_msg@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_disp1>:
sub    $0x68,%rsp
movabs $0x254b4f20534920,%rax
mov    %rax,0x27(%rsp)
movabs $0x20313a382058554d,%rcx
3a 31 20
mov    %rcx,0x20(%rsp)
movaps 0xf17(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %rax,0x17(%rsp)
movabs $0x20383a3320434544,%rcx
3a 38 20
mov    %rcx,0x10(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rax,0x7(%rsp)
movabs $0x2054494232204146,%rax
49 54 20
mov    %rax,(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     11c1 <lcd_disp1+0xb1>
lea    0x20(%rsp),%rax
lea    0xe6f(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x50(%rsp),%rax
jmp    11b9 <lcd_disp1+0xa9>
lea    0x10(%rsp),%rax
jmp    11b9 <lcd_disp1+0xa9>
lea    0x40(%rsp),%rax
jmp    11b9 <lcd_disp1+0xa9>
mov    %rsp,%rax
jmp    11b9 <lcd_disp1+0xa9>
lea    0x30(%rsp),%rax
mov    %rax,%rdi
call   1030 <lcd_msg@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.lcd_disp1.msg1 = [15 x i8] c"MUX 8:1 IS OK%\00"
@__const.lcd_disp1.msg2 = [16 x i8] c"MUX 8:1 IS BAD%\00"
@__const.lcd_disp1.msg3 = [15 x i8] c"DEC 3:8 IS OK%\00"
@__const.lcd_disp1.msg4 = [16 x i8] c"DEC 3:8 IS BAD%\00"
@__const.lcd_disp1.msg5 = [15 x i8] c"FA 2BIT IS OK%\00"
@__const.lcd_disp1.msg6 = [16 x i8] c"FA 2BIT IS BAD%\00"
define void @lcd_disp1(i32 %0) {
%2 = alloca i32
%3 = alloca [15 x i8]
%4 = alloca [16 x i8]
%5 = alloca [15 x i8]
%6 = alloca [16 x i8]
%7 = alloca [15 x i8]
%8 = alloca [16 x i8]
store i32 %0, i32* %2
%9 = bitcast [15 x i8]* %3 to i8*
%10 = bitcast [16 x i8]* %4 to i8*
%11 = bitcast [15 x i8]* %5 to i8*
%12 = bitcast [16 x i8]* %6 to i8*
%13 = bitcast [15 x i8]* %7 to i8*
%14 = bitcast [16 x i8]* %8 to i8*
%15 = load i32, i32* %2
switch i32 %15, label %34 [
i32 1, label %16
i32 2, label %19
i32 3, label %22
i32 4, label %25
i32 5, label %28
i32 6, label %31
]
16: ; preds = %1
%17 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%18 = call i32 @lcd_msg(i8* %17)
br label %34
19: ; preds = %1
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%21 = call i32 @lcd_msg(i8* %20)
br label %34
22: ; preds = %1
%23 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%24 = call i32 @lcd_msg(i8* %23)
br label %34
25: ; preds = %1
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%27 = call i32 @lcd_msg(i8* %26)
br label %34
28: ; preds = %1
%29 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%30 = call i32 @lcd_msg(i8* %29)
br label %34
31: ; preds = %1
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%33 = call i32 @lcd_msg(i8* %32)
br label %34
34: ; preds = %1, %31, %28, %25, %22, %19, %16
ret void
}

LLVM IR (-O2):
@__const.lcd_disp1.msg1 = [15 x i8] c"MUX 8:1 IS OK%\00"
@__const.lcd_disp1.msg2 = [16 x i8] c"MUX 8:1 IS BAD%\00"
@__const.lcd_disp1.msg3 = [15 x i8] c"DEC 3:8 IS OK%\00"
@__const.lcd_disp1.msg4 = [16 x i8] c"DEC 3:8 IS BAD%\00"
@__const.lcd_disp1.msg5 = [15 x i8] c"FA 2BIT IS OK%\00"
@__const.lcd_disp1.msg6 = [16 x i8] c"FA 2BIT IS BAD%\00"
define void @lcd_disp1(i32 %0) {
%2 = alloca [15 x i8]
%3 = alloca [16 x i8]
%4 = alloca [15 x i8]
%5 = alloca [16 x i8]
%6 = alloca [15 x i8]
%7 = alloca [16 x i8]
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
switch i32 %0, label %22 [
i32 1, label %19
i32 2, label %14
i32 3, label %15
i32 4, label %16
i32 5, label %17
i32 6, label %18
]
14: ; preds = %1
br label %19
15: ; preds = %1
br label %19
16: ; preds = %1
br label %19
17: ; preds = %1
br label %19
18: ; preds = %1
br label %19
19: ; preds = %1, %14, %15, %16, %17, %18
%20 = phi i8* [ %13, %18 ], [ %12, %17 ], [ %11, %16 ], [ %10, %15 ], [ %9, %14 ], [ %8, %1 ]
%21 = call i32 @lcd_msg(i8* %20)
br label %22
22: ; preds = %19, %1
ret void
}