#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ delay(int);
void gpio_iic_write(unsigned char wbyte) {
  unsigned char i;
  (*((volatile uint32_t *)0xE02000C0)) =
      ((*((volatile uint32_t *)0xE02000C0)) & 0xfffffff0) | 0x00000001;
  for (i = 0; i < 8; i++) {
    if ((wbyte & 0x80) == 0x80)
      (*((volatile uint32_t *)0xE02000C4)) |= 1 << 0x00;
    else
      (*((volatile uint32_t *)0xE02000C4)) &= ~(1 << 0x00);
    wbyte <<= 1;
    (*((volatile uint32_t *)0xE02000C4)) |= 1 << 0x01;
    delay((10));
    (*((volatile uint32_t *)0xE02000C4)) &= ~(1 << 0x01);
    delay((10));
  }
}


x86 assembly (clang, -O0):
<gpio_iic_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe02000c0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
or     $0x1,%ecx
mov    $0xe02000c0,%eax
mov    %ecx,(%rax)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    11cb <gpio_iic_write+0xbb>
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    116d <gpio_iic_write+0x5d>
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
jmp    117e <gpio_iic_write+0x6e>
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    $0xe02000c4,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0xe02000c4,%eax
mov    %ecx,(%rax)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1136 <gpio_iic_write+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_iic_write>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xe02000c4,%ebx
mov    -0x4(%rbx),%eax
and    $0xfffffff0,%eax
or     $0x1,%eax
mov    %eax,-0x4(%rbx)
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x7,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x6,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x5,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x4,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x3,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    $0x2,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
mov    %ebp,%ecx
shr    %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
mov    (%rbx),%eax
and    $0xfffffffe,%eax
and    $0x1,%ebp
or     %eax,%ebp
mov    %ebp,(%rbx)
orl    $0x2,(%rbx)
mov    $0xa,%edi
call   1030 <delay@plt>
andl   $0xfffffffd,(%rbx)
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @gpio_iic_write(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%5 = and i32 %4, -16
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 3760193728 to i32*)
store i8 0, i8* %3
br label %7
7: ; preds = %33, %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %36
11: ; preds = %7
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 128
%15 = icmp eq i32 %14, 128
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%18 = or i32 %17, 1
store volatile i32 %18, i32* inttoptr (i64 3760193732 to i32*)
br label %22
19: ; preds = %11
%20 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%21 = and i32 %20, -2
store volatile i32 %21, i32* inttoptr (i64 3760193732 to i32*)
br label %22
22: ; preds = %19, %16
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
%27 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%28 = or i32 %27, 2
store volatile i32 %28, i32* inttoptr (i64 3760193732 to i32*)
%29 = call i32 @delay(i32 10)
%30 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%31 = and i32 %30, -3
store volatile i32 %31, i32* inttoptr (i64 3760193732 to i32*)
%32 = call i32 @delay(i32 10)
br label %33
33: ; preds = %22
%34 = load i8, i8* %3
%35 = add i8 %34, 1
store i8 %35, i8* %3
br label %7
36: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @gpio_iic_write(i8 zeroext %0) {
%2 = load volatile i32, i32* inttoptr (i64 3760193728 to i32*)
%3 = and i32 %2, -16
%4 = or i32 %3, 1
store volatile i32 %4, i32* inttoptr (i64 3760193728 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%6 = and i32 %5, -2
%7 = lshr i8 %0, 7
%8 = zext i8 %7 to i32
%9 = or i32 %6, %8
store volatile i32 %9, i32* inttoptr (i64 3760193732 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%11 = or i32 %10, 2
store volatile i32 %11, i32* inttoptr (i64 3760193732 to i32*)
%12 = tail call i32 @delay(i32 10)
%13 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%14 = and i32 %13, -3
store volatile i32 %14, i32* inttoptr (i64 3760193732 to i32*)
%15 = tail call i32 @delay(i32 10)
%16 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%17 = and i32 %16, -2
%18 = lshr i8 %0, 6
%19 = and i8 %18, 1
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
store volatile i32 %21, i32* inttoptr (i64 3760193732 to i32*)
%22 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%23 = or i32 %22, 2
store volatile i32 %23, i32* inttoptr (i64 3760193732 to i32*)
%24 = tail call i32 @delay(i32 10)
%25 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%26 = and i32 %25, -3
store volatile i32 %26, i32* inttoptr (i64 3760193732 to i32*)
%27 = tail call i32 @delay(i32 10)
%28 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%29 = and i32 %28, -2
%30 = lshr i8 %0, 5
%31 = and i8 %30, 1
%32 = zext i8 %31 to i32
%33 = or i32 %29, %32
store volatile i32 %33, i32* inttoptr (i64 3760193732 to i32*)
%34 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%35 = or i32 %34, 2
store volatile i32 %35, i32* inttoptr (i64 3760193732 to i32*)
%36 = tail call i32 @delay(i32 10)
%37 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%38 = and i32 %37, -3
store volatile i32 %38, i32* inttoptr (i64 3760193732 to i32*)
%39 = tail call i32 @delay(i32 10)
%40 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%41 = and i32 %40, -2
%42 = lshr i8 %0, 4
%43 = and i8 %42, 1
%44 = zext i8 %43 to i32
%45 = or i32 %41, %44
store volatile i32 %45, i32* inttoptr (i64 3760193732 to i32*)
%46 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%47 = or i32 %46, 2
store volatile i32 %47, i32* inttoptr (i64 3760193732 to i32*)
%48 = tail call i32 @delay(i32 10)
%49 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%50 = and i32 %49, -3
store volatile i32 %50, i32* inttoptr (i64 3760193732 to i32*)
%51 = tail call i32 @delay(i32 10)
%52 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%53 = and i32 %52, -2
%54 = lshr i8 %0, 3
%55 = and i8 %54, 1
%56 = zext i8 %55 to i32
%57 = or i32 %53, %56
store volatile i32 %57, i32* inttoptr (i64 3760193732 to i32*)
%58 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%59 = or i32 %58, 2
store volatile i32 %59, i32* inttoptr (i64 3760193732 to i32*)
%60 = tail call i32 @delay(i32 10)
%61 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%62 = and i32 %61, -3
store volatile i32 %62, i32* inttoptr (i64 3760193732 to i32*)
%63 = tail call i32 @delay(i32 10)
%64 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%65 = and i32 %64, -2
%66 = lshr i8 %0, 2
%67 = and i8 %66, 1
%68 = zext i8 %67 to i32
%69 = or i32 %65, %68
store volatile i32 %69, i32* inttoptr (i64 3760193732 to i32*)
%70 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%71 = or i32 %70, 2
store volatile i32 %71, i32* inttoptr (i64 3760193732 to i32*)
%72 = tail call i32 @delay(i32 10)
%73 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%74 = and i32 %73, -3
store volatile i32 %74, i32* inttoptr (i64 3760193732 to i32*)
%75 = tail call i32 @delay(i32 10)
%76 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%77 = and i32 %76, -2
%78 = lshr i8 %0, 1
%79 = and i8 %78, 1
%80 = zext i8 %79 to i32
%81 = or i32 %77, %80
store volatile i32 %81, i32* inttoptr (i64 3760193732 to i32*)
%82 = and i8 %0, 1
%83 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%84 = or i32 %83, 2
store volatile i32 %84, i32* inttoptr (i64 3760193732 to i32*)
%85 = tail call i32 @delay(i32 10)
%86 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%87 = and i32 %86, -3
store volatile i32 %87, i32* inttoptr (i64 3760193732 to i32*)
%88 = tail call i32 @delay(i32 10)
%89 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%90 = and i32 %89, -2
%91 = zext i8 %82 to i32
%92 = or i32 %90, %91
store volatile i32 %92, i32* inttoptr (i64 3760193732 to i32*)
%93 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%94 = or i32 %93, 2
store volatile i32 %94, i32* inttoptr (i64 3760193732 to i32*)
%95 = tail call i32 @delay(i32 10)
%96 = load volatile i32, i32* inttoptr (i64 3760193732 to i32*)
%97 = and i32 %96, -3
store volatile i32 %97, i32* inttoptr (i64 3760193732 to i32*)
%98 = tail call i32 @delay(i32 10)
ret void
}