#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_CLR_CLK();
scalar_t__ LCD_SDO();
int /*<<< orphan*/ LCD_SET_CLK();
unsigned char Read1(void) {
  unsigned char Data = 0;
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 7);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 6);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 5);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 4);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 3);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 2);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 1);
  LCD_CLR_CLK();
  LCD_SET_CLK();
  if (LCD_SDO())
    Data |= (1 << 0);
  return Data;
}


x86 assembly (clang, -O0):
<Read1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     1167 <Read1+0x37>
movzbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     1190 <Read1+0x60>
movzbl -0x1(%rbp),%eax
or     $0x40,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     11b9 <Read1+0x89>
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     11e2 <Read1+0xb2>
movzbl -0x1(%rbp),%eax
or     $0x10,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     120b <Read1+0xdb>
movzbl -0x1(%rbp),%eax
or     $0x8,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     1234 <Read1+0x104>
movzbl -0x1(%rbp),%eax
or     $0x4,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     125d <Read1+0x12d>
movzbl -0x1(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <LCD_CLR_CLK@plt>
mov    $0x0,%al
call   1050 <LCD_SET_CLK@plt>
mov    $0x0,%al
call   1040 <LCD_SDO@plt>
cmp    $0x0,%rax
je     1286 <Read1+0x156>
movzbl -0x1(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read1>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
test   %rax,%rax
setne  %bl
shl    $0x7,%bl
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
lea    0x40(%rbx),%ecx
test   %rax,%rax
movzbl %bl,%eax
movzbl %cl,%ebx
cmove  %eax,%ebx
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%ebp
cmove  %ebx,%ebp
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
mov    %ebp,%ecx
or     $0x10,%cl
test   %rax,%rax
movzbl %cl,%ebx
cmove  %ebp,%ebx
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
mov    %ebx,%ecx
or     $0x8,%cl
test   %rax,%rax
movzbl %cl,%ebp
cmove  %ebx,%ebp
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
mov    %ebp,%ecx
or     $0x4,%cl
test   %rax,%rax
movzbl %cl,%ebx
cmove  %ebp,%ebx
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
mov    %ebx,%ecx
or     $0x2,%cl
test   %rax,%rax
movzbl %cl,%ebp
cmove  %ebx,%ebp
xor    %eax,%eax
call   1030 <LCD_CLR_CLK@plt>
xor    %eax,%eax
call   1050 <LCD_SET_CLK@plt>
xor    %eax,%eax
call   1040 <LCD_SDO@plt>
test   %rax,%rax
setne  %al
or     %bpl,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @Read1() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @LCD_CLR_CLK()
%3 = call i32 (...) @LCD_SET_CLK()
%4 = call i64 (...) @LCD_SDO()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8, i8* %1
%8 = zext i8 %7 to i32
%9 = or i32 %8, 128
%10 = trunc i32 %9 to i8
store i8 %10, i8* %1
br label %11
11: ; preds = %6, %0
%12 = call i32 (...) @LCD_CLR_CLK()
%13 = call i32 (...) @LCD_SET_CLK()
%14 = call i64 (...) @LCD_SDO()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8, i8* %1
%18 = zext i8 %17 to i32
%19 = or i32 %18, 64
%20 = trunc i32 %19 to i8
store i8 %20, i8* %1
br label %21
21: ; preds = %16, %11
%22 = call i32 (...) @LCD_CLR_CLK()
%23 = call i32 (...) @LCD_SET_CLK()
%24 = call i64 (...) @LCD_SDO()
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load i8, i8* %1
%28 = zext i8 %27 to i32
%29 = or i32 %28, 32
%30 = trunc i32 %29 to i8
store i8 %30, i8* %1
br label %31
31: ; preds = %26, %21
%32 = call i32 (...) @LCD_CLR_CLK()
%33 = call i32 (...) @LCD_SET_CLK()
%34 = call i64 (...) @LCD_SDO()
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %31
%37 = load i8, i8* %1
%38 = zext i8 %37 to i32
%39 = or i32 %38, 16
%40 = trunc i32 %39 to i8
store i8 %40, i8* %1
br label %41
41: ; preds = %36, %31
%42 = call i32 (...) @LCD_CLR_CLK()
%43 = call i32 (...) @LCD_SET_CLK()
%44 = call i64 (...) @LCD_SDO()
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %41
%47 = load i8, i8* %1
%48 = zext i8 %47 to i32
%49 = or i32 %48, 8
%50 = trunc i32 %49 to i8
store i8 %50, i8* %1
br label %51
51: ; preds = %46, %41
%52 = call i32 (...) @LCD_CLR_CLK()
%53 = call i32 (...) @LCD_SET_CLK()
%54 = call i64 (...) @LCD_SDO()
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %51
%57 = load i8, i8* %1
%58 = zext i8 %57 to i32
%59 = or i32 %58, 4
%60 = trunc i32 %59 to i8
store i8 %60, i8* %1
br label %61
61: ; preds = %56, %51
%62 = call i32 (...) @LCD_CLR_CLK()
%63 = call i32 (...) @LCD_SET_CLK()
%64 = call i64 (...) @LCD_SDO()
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %61
%67 = load i8, i8* %1
%68 = zext i8 %67 to i32
%69 = or i32 %68, 2
%70 = trunc i32 %69 to i8
store i8 %70, i8* %1
br label %71
71: ; preds = %66, %61
%72 = call i32 (...) @LCD_CLR_CLK()
%73 = call i32 (...) @LCD_SET_CLK()
%74 = call i64 (...) @LCD_SDO()
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %71
%77 = load i8, i8* %1
%78 = zext i8 %77 to i32
%79 = or i32 %78, 1
%80 = trunc i32 %79 to i8
store i8 %80, i8* %1
br label %81
81: ; preds = %76, %71
%82 = load i8, i8* %1
ret i8 %82
}

LLVM IR (-O2):
define zeroext i8 @Read1() {
%1 = tail call i32 (...) @LCD_CLR_CLK()
%2 = tail call i32 (...) @LCD_SET_CLK()
%3 = tail call i64 (...) @LCD_SDO()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8 0, i8 -128
%6 = tail call i32 (...) @LCD_CLR_CLK()
%7 = tail call i32 (...) @LCD_SET_CLK()
%8 = tail call i64 (...) @LCD_SDO()
%9 = icmp eq i64 %8, 0
%10 = or i8 %5, 64
%11 = select i1 %9, i8 %5, i8 %10
%12 = tail call i32 (...) @LCD_CLR_CLK()
%13 = tail call i32 (...) @LCD_SET_CLK()
%14 = tail call i64 (...) @LCD_SDO()
%15 = icmp eq i64 %14, 0
%16 = or i8 %11, 32
%17 = select i1 %15, i8 %11, i8 %16
%18 = tail call i32 (...) @LCD_CLR_CLK()
%19 = tail call i32 (...) @LCD_SET_CLK()
%20 = tail call i64 (...) @LCD_SDO()
%21 = icmp eq i64 %20, 0
%22 = or i8 %17, 16
%23 = select i1 %21, i8 %17, i8 %22
%24 = tail call i32 (...) @LCD_CLR_CLK()
%25 = tail call i32 (...) @LCD_SET_CLK()
%26 = tail call i64 (...) @LCD_SDO()
%27 = icmp eq i64 %26, 0
%28 = or i8 %23, 8
%29 = select i1 %27, i8 %23, i8 %28
%30 = tail call i32 (...) @LCD_CLR_CLK()
%31 = tail call i32 (...) @LCD_SET_CLK()
%32 = tail call i64 (...) @LCD_SDO()
%33 = icmp eq i64 %32, 0
%34 = or i8 %29, 4
%35 = select i1 %33, i8 %29, i8 %34
%36 = tail call i32 (...) @LCD_CLR_CLK()
%37 = tail call i32 (...) @LCD_SET_CLK()
%38 = tail call i64 (...) @LCD_SDO()
%39 = icmp eq i64 %38, 0
%40 = or i8 %35, 2
%41 = select i1 %39, i8 %35, i8 %40
%42 = tail call i32 (...) @LCD_CLR_CLK()
%43 = tail call i32 (...) @LCD_SET_CLK()
%44 = tail call i64 (...) @LCD_SDO()
%45 = icmp ne i64 %44, 0
%46 = zext i1 %45 to i8
%47 = or i8 %41, %46
ret i8 %47
}