#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_SCL();
scalar_t__ LCD_READ_BIT();
int /*<<< orphan*/ LCD_SET_SCL();
int /*<<< orphan*/ LCD_SET_SDA_IN();
unsigned char _Read1(void) {
  unsigned char c = 0;
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 7);
  else
    c &= ~(1 << 7);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 6);
  else
    c &= ~(1 << 6);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 5);
  else
    c &= ~(1 << 5);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 4);
  else
    c &= ~(1 << 4);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 3);
  else
    c &= ~(1 << 3);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 2);
  else
    c &= ~(1 << 2);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 1);
  else
    c &= ~(1 << 1);
  LCD_CLR_SCL();
  LCD_SET_SCL();
  if (LCD_READ_BIT())
    c |= (1 << 0);
  else
    c &= ~(1 << 0);
  LCD_CLR_SCL();
  LCD_SET_SDA_IN();
  LCD_SET_SCL();
  LCD_CLR_SCL();
  return c;
}


x86 assembly (clang, -O0):
<_Read1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     1175 <_Read1+0x35>
movzbl -0x1(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x1(%rbp)
jmp    1181 <_Read1+0x41>
movzbl -0x1(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     11af <_Read1+0x6f>
movzbl -0x1(%rbp),%eax
or     $0x40,%eax
mov    %al,-0x1(%rbp)
jmp    11b9 <_Read1+0x79>
movzbl -0x1(%rbp),%eax
and    $0xffffffbf,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     11e7 <_Read1+0xa7>
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    11f1 <_Read1+0xb1>
movzbl -0x1(%rbp),%eax
and    $0xffffffdf,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     121f <_Read1+0xdf>
movzbl -0x1(%rbp),%eax
or     $0x10,%eax
mov    %al,-0x1(%rbp)
jmp    1229 <_Read1+0xe9>
movzbl -0x1(%rbp),%eax
and    $0xffffffef,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     1257 <_Read1+0x117>
movzbl -0x1(%rbp),%eax
or     $0x8,%eax
mov    %al,-0x1(%rbp)
jmp    1261 <_Read1+0x121>
movzbl -0x1(%rbp),%eax
and    $0xfffffff7,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     128f <_Read1+0x14f>
movzbl -0x1(%rbp),%eax
or     $0x4,%eax
mov    %al,-0x1(%rbp)
jmp    1299 <_Read1+0x159>
movzbl -0x1(%rbp),%eax
and    $0xfffffffb,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     12c7 <_Read1+0x187>
movzbl -0x1(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x1(%rbp)
jmp    12d1 <_Read1+0x191>
movzbl -0x1(%rbp),%eax
and    $0xfffffffd,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1030 <LCD_READ_BIT@plt>
cmp    $0x0,%rax
je     12ff <_Read1+0x1bf>
movzbl -0x1(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1309 <_Read1+0x1c9>
movzbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
mov    $0x0,%al
call   1050 <LCD_SET_SDA_IN@plt>
mov    $0x0,%al
call   1040 <LCD_SET_SCL@plt>
mov    $0x0,%al
call   1060 <LCD_CLR_SCL@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Read1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %bpl
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
mov    %rax,%r14
shl    $0x7,%bpl
lea    0x40(%rbp),%ebx
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %r14,%r14
movzbl %bpl,%ecx
movzbl %bl,%edx
cmove  %ecx,%edx
lea    0x20(%rdx),%ecx
test   %rax,%rax
movzbl %cl,%ebp
cmove  %edx,%ebp
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %r14b
shl    $0x4,%r14b
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %bl
shl    $0x3,%bl
or     %r14b,%bl
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %r14b
shl    $0x2,%r14b
or     %bl,%r14b
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %r15b
add    %r15b,%r15b
or     %r14b,%r15b
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1030 <LCD_READ_BIT@plt>
test   %rax,%rax
setne  %bl
or     %r15b,%bl
or     %bpl,%bl
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
xor    %eax,%eax
call   1050 <LCD_SET_SDA_IN@plt>
xor    %eax,%eax
call   1040 <LCD_SET_SCL@plt>
xor    %eax,%eax
call   1060 <LCD_CLR_SCL@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @_Read1() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 (...) @LCD_SET_SCL()
%3 = call i64 (...) @LCD_READ_BIT()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i8, i8* %1
%7 = zext i8 %6 to i32
%8 = or i32 %7, 128
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
br label %15
10: ; preds = %0
%11 = load i8, i8* %1
%12 = zext i8 %11 to i32
%13 = and i32 %12, -129
%14 = trunc i32 %13 to i8
store i8 %14, i8* %1
br label %15
15: ; preds = %10, %5
%16 = call i32 (...) @LCD_CLR_SCL()
%17 = call i32 (...) @LCD_SET_SCL()
%18 = call i64 (...) @LCD_READ_BIT()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load i8, i8* %1
%22 = zext i8 %21 to i32
%23 = or i32 %22, 64
%24 = trunc i32 %23 to i8
store i8 %24, i8* %1
br label %30
25: ; preds = %15
%26 = load i8, i8* %1
%27 = zext i8 %26 to i32
%28 = and i32 %27, -65
%29 = trunc i32 %28 to i8
store i8 %29, i8* %1
br label %30
30: ; preds = %25, %20
%31 = call i32 (...) @LCD_CLR_SCL()
%32 = call i32 (...) @LCD_SET_SCL()
%33 = call i64 (...) @LCD_READ_BIT()
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = load i8, i8* %1
%37 = zext i8 %36 to i32
%38 = or i32 %37, 32
%39 = trunc i32 %38 to i8
store i8 %39, i8* %1
br label %45
40: ; preds = %30
%41 = load i8, i8* %1
%42 = zext i8 %41 to i32
%43 = and i32 %42, -33
%44 = trunc i32 %43 to i8
store i8 %44, i8* %1
br label %45
45: ; preds = %40, %35
%46 = call i32 (...) @LCD_CLR_SCL()
%47 = call i32 (...) @LCD_SET_SCL()
%48 = call i64 (...) @LCD_READ_BIT()
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %45
%51 = load i8, i8* %1
%52 = zext i8 %51 to i32
%53 = or i32 %52, 16
%54 = trunc i32 %53 to i8
store i8 %54, i8* %1
br label %60
55: ; preds = %45
%56 = load i8, i8* %1
%57 = zext i8 %56 to i32
%58 = and i32 %57, -17
%59 = trunc i32 %58 to i8
store i8 %59, i8* %1
br label %60
60: ; preds = %55, %50
%61 = call i32 (...) @LCD_CLR_SCL()
%62 = call i32 (...) @LCD_SET_SCL()
%63 = call i64 (...) @LCD_READ_BIT()
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %60
%66 = load i8, i8* %1
%67 = zext i8 %66 to i32
%68 = or i32 %67, 8
%69 = trunc i32 %68 to i8
store i8 %69, i8* %1
br label %75
70: ; preds = %60
%71 = load i8, i8* %1
%72 = zext i8 %71 to i32
%73 = and i32 %72, -9
%74 = trunc i32 %73 to i8
store i8 %74, i8* %1
br label %75
75: ; preds = %70, %65
%76 = call i32 (...) @LCD_CLR_SCL()
%77 = call i32 (...) @LCD_SET_SCL()
%78 = call i64 (...) @LCD_READ_BIT()
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %85
80: ; preds = %75
%81 = load i8, i8* %1
%82 = zext i8 %81 to i32
%83 = or i32 %82, 4
%84 = trunc i32 %83 to i8
store i8 %84, i8* %1
br label %90
85: ; preds = %75
%86 = load i8, i8* %1
%87 = zext i8 %86 to i32
%88 = and i32 %87, -5
%89 = trunc i32 %88 to i8
store i8 %89, i8* %1
br label %90
90: ; preds = %85, %80
%91 = call i32 (...) @LCD_CLR_SCL()
%92 = call i32 (...) @LCD_SET_SCL()
%93 = call i64 (...) @LCD_READ_BIT()
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %90
%96 = load i8, i8* %1
%97 = zext i8 %96 to i32
%98 = or i32 %97, 2
%99 = trunc i32 %98 to i8
store i8 %99, i8* %1
br label %105
100: ; preds = %90
%101 = load i8, i8* %1
%102 = zext i8 %101 to i32
%103 = and i32 %102, -3
%104 = trunc i32 %103 to i8
store i8 %104, i8* %1
br label %105
105: ; preds = %100, %95
%106 = call i32 (...) @LCD_CLR_SCL()
%107 = call i32 (...) @LCD_SET_SCL()
%108 = call i64 (...) @LCD_READ_BIT()
%109 = icmp ne i64 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %105
%111 = load i8, i8* %1
%112 = zext i8 %111 to i32
%113 = or i32 %112, 1
%114 = trunc i32 %113 to i8
store i8 %114, i8* %1
br label %120
115: ; preds = %105
%116 = load i8, i8* %1
%117 = zext i8 %116 to i32
%118 = and i32 %117, -2
%119 = trunc i32 %118 to i8
store i8 %119, i8* %1
br label %120
120: ; preds = %115, %110
%121 = call i32 (...) @LCD_CLR_SCL()
%122 = call i32 (...) @LCD_SET_SDA_IN()
%123 = call i32 (...) @LCD_SET_SCL()
%124 = call i32 (...) @LCD_CLR_SCL()
%125 = load i8, i8* %1
ret i8 %125
}

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