#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*/ lcm_reset();
int /*<<< orphan*/ printk(char *, int);
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id() {
  int para1, para2, para3, para4, para5, para6;
  lcm_reset();
  send_ctrl_cmd(0xD3);
  para1 = read_data_cmd();
  para2 = read_data_cmd();
  para3 = read_data_cmd();
  para4 = read_data_cmd();
  printk("il9481 LCD read id1 = %x \n", para1);
  printk("il9481 LCD read id2 = %x \n", para2);
  printk("il9481 LCD read id3 = %x \n", para3);
  printk("il9481 LCD read id4 = %x \n", para4);
  printk("il9481 LCD read id5 = %x \n", para5);
  printk("il9481 LCD read id6 = %x \n", para6);
  para1 = para1 & 0xFF;
  para2 = para2 & 0xFF;
  para3 = para3 & 0xFF;
  para4 = para4 & 0xFF;
  para5 = para5 & 0xFF;
  para6 = para6 & 0xFF;
  if ((para2 == 0x00) && (para3 == 0x94) && (para4 == 0x86))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <lcm_reset@plt>
mov    $0xd3,%edi
call   1060 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1050 <read_data_cmd@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <read_data_cmd@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <read_data_cmd@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <read_data_cmd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printk@plt>
mov    -0xc(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printk@plt>
mov    -0x10(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printk@plt>
mov    -0x14(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printk@plt>
mov    -0x18(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printk@plt>
mov    -0x1c(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    124d <lcm_compare_id+0x10d>
cmpl   $0x94,-0x10(%rbp)
jne    124d <lcm_compare_id+0x10d>
cmpl   $0x86,-0x14(%rbp)
jne    124d <lcm_compare_id+0x10d>
movl   $0x1,-0x4(%rbp)
jmp    1254 <lcm_compare_id+0x114>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <lcm_reset@plt>
mov    $0xd3,%edi
call   1060 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1050 <read_data_cmd@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <read_data_cmd@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <read_data_cmd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <read_data_cmd@plt>
mov    %eax,%r15d
lea    0xe7b(%rip),%rdi
mov    %ebp,%esi
call   1030 <printk@plt>
lea    0xe88(%rip),%rdi
mov    %r14d,%esi
call   1030 <printk@plt>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
call   1030 <printk@plt>
lea    0xea1(%rip),%rdi
mov    %r15d,%esi
call   1030 <printk@plt>
lea    0xead(%rip),%rdi
call   1030 <printk@plt>
lea    0xebc(%rip),%rdi
call   1030 <printk@plt>
movzbl %r14b,%eax
movzbl %bl,%ecx
xor    $0x94,%ecx
or     %eax,%ecx
sete   %al
cmp    $0x86,%r15b
sete   %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"il9481 LCD read id1 = %x \0A\00"
@.str.1 = [27 x i8] c"il9481 LCD read id2 = %x \0A\00"
@.str.2 = [27 x i8] c"il9481 LCD read id3 = %x \0A\00"
@.str.3 = [27 x i8] c"il9481 LCD read id4 = %x \0A\00"
@.str.4 = [27 x i8] c"il9481 LCD read id5 = %x \0A\00"
@.str.5 = [27 x i8] c"il9481 LCD read id6 = %x \0A\00"
define i32 @lcm_compare_id() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = call i32 (...) @lcm_reset()
%9 = call i32 @send_ctrl_cmd(i32 211)
%10 = call i32 (...) @read_data_cmd()
store i32 %10, i32* %2
%11 = call i32 (...) @read_data_cmd()
store i32 %11, i32* %3
%12 = call i32 (...) @read_data_cmd()
store i32 %12, i32* %4
%13 = call i32 (...) @read_data_cmd()
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %4
%19 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %5
%21 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %6
%23 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %7
%25 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = and i32 %26, 255
store i32 %27, i32* %2
%28 = load i32, i32* %3
%29 = and i32 %28, 255
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = and i32 %30, 255
store i32 %31, i32* %4
%32 = load i32, i32* %5
%33 = and i32 %32, 255
store i32 %33, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %34, 255
store i32 %35, i32* %6
%36 = load i32, i32* %7
%37 = and i32 %36, 255
store i32 %37, i32* %7
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %0
%41 = load i32, i32* %4
%42 = icmp eq i32 %41, 148
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i32, i32* %5
%45 = icmp eq i32 %44, 134
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 1, i32* %1
br label %48
47: ; preds = %43, %40, %0
store i32 0, i32* %1
br label %48
48: ; preds = %47, %46
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@.str = [27 x i8] c"il9481 LCD read id1 = %x \0A\00"
@.str.1 = [27 x i8] c"il9481 LCD read id2 = %x \0A\00"
@.str.2 = [27 x i8] c"il9481 LCD read id3 = %x \0A\00"
@.str.3 = [27 x i8] c"il9481 LCD read id4 = %x \0A\00"
@.str.4 = [27 x i8] c"il9481 LCD read id5 = %x \0A\00"
@.str.5 = [27 x i8] c"il9481 LCD read id6 = %x \0A\00"
define i32 @lcm_compare_id() {
%1 = tail call i32 (...) @lcm_reset()
%2 = tail call i32 @send_ctrl_cmd(i32 211)
%3 = tail call i32 (...) @read_data_cmd()
%4 = tail call i32 (...) @read_data_cmd()
%5 = tail call i32 (...) @read_data_cmd()
%6 = tail call i32 (...) @read_data_cmd()
%7 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%9 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%10 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%11 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 undef)
%12 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 undef)
%13 = and i32 %4, 255
%14 = and i32 %5, 255
%15 = and i32 %6, 255
%16 = icmp eq i32 %13, 0
%17 = icmp eq i32 %14, 148
%18 = select i1 %16, i1 %17, i1 false
%19 = icmp eq i32 %15, 134
%20 = select i1 %18, i1 %19, i1 false
%21 = zext i1 %20 to i32
ret i32 %21
}