#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*/ GPIOPinTypeGPIOOutput(int, int);
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
int /*<<< orphan*/ Send1byteB(unsigned char);
int /*<<< orphan*/ SysCtlPeripheralEnable(int);
int /*<<< orphan*/ startB();
int /*<<< orphan*/ stopB();
void Confige_1115_B(unsigned int channel) {
  SysCtlPeripheralEnable(0x20000008);
  GPIOPinTypeGPIOOutput(0x40007000, 0x00000020);
  GPIOPinTypeGPIOOutput(0x40007000, 0x00000010);
  GPIOPinWrite(0x40007000, 0x00000010, 0xff);
  GPIOPinWrite(0x40007000, 0x00000020, 0xff);
  unsigned char i = 0;
  unsigned char Initdata[4] = {0};
  switch (channel) {
  case 0:
    Initdata[2] = 0xc2;
    break;
  case 1:
    Initdata[2] = 0xd2;
    break;
  case 2:
    Initdata[2] = 0xe2;
    break;
  case 3:
    Initdata[2] = 0xf2;
    break;
  default:
    break;
  }
  Initdata[0] = 0x90;
  Initdata[1] = 0x01;
  Initdata[3] = 0xe3;
  startB();
  for (i = 0; i < 4; i++) {
    Send1byteB(Initdata[i]);
  }
  stopB();
}


x86 assembly (clang, -O0):
<Confige_1115_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20000008,%edi
call   1040 <SysCtlPeripheralEnable@plt>
mov    $0x40007000,%edi
mov    %edi,-0x24(%rbp)
mov    $0x20,%esi
mov    %esi,-0x20(%rbp)
call   1050 <GPIOPinTypeGPIOOutput@plt>
mov    -0x24(%rbp),%edi
mov    $0x10,%esi
mov    %esi,-0x28(%rbp)
call   1050 <GPIOPinTypeGPIOOutput@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edi
mov    $0xff,%edx
mov    %edx,-0x1c(%rbp)
call   1080 <GPIOPinWrite@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1080 <GPIOPinWrite@plt>
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     120f <Confige_1115_B+0xaf>
mov    -0x18(%rbp),%rax
lea    0xe1e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0xc2,-0xa(%rbp)
jmp    1214 <Confige_1115_B+0xb4>
movb   $0xd2,-0xa(%rbp)
jmp    1214 <Confige_1115_B+0xb4>
movb   $0xe2,-0xa(%rbp)
jmp    1214 <Confige_1115_B+0xb4>
movb   $0xf2,-0xa(%rbp)
jmp    1214 <Confige_1115_B+0xb4>
jmp    1214 <Confige_1115_B+0xb4>
movb   $0x90,-0xc(%rbp)
movb   $0x1,-0xb(%rbp)
movb   $0xe3,-0x9(%rbp)
mov    $0x0,%al
call   1060 <startB@plt>
movb   $0x0,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x4,%eax
jge    1253 <Confige_1115_B+0xf3>
movzbl -0x5(%rbp),%eax
movzbl -0xc(%rbp,%rax,1),%edi
call   1030 <Send1byteB@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    122b <Confige_1115_B+0xcb>
mov    $0x0,%al
call   1070 <stopB@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Confige_1115_B>:
push   %rbx
mov    %edi,%ebx
mov    $0x20000008,%edi
call   1040 <SysCtlPeripheralEnable@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1050 <GPIOPinTypeGPIOOutput@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
call   1050 <GPIOPinTypeGPIOOutput@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1080 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1080 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x4,%al
add    $0xc2,%al
xor    %ecx,%ecx
cmp    $0x4,%ebx
movzbl %al,%ebx
cmovae %ecx,%ebx
xor    %eax,%eax
call   1060 <startB@plt>
mov    $0x90,%edi
call   1030 <Send1byteB@plt>
mov    $0x1,%edi
call   1030 <Send1byteB@plt>
movzbl %bl,%edi
call   1030 <Send1byteB@plt>
mov    $0xe3,%edi
call   1030 <Send1byteB@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <stopB@plt>

LLVM IR (-O0):
define void @Confige_1115_B(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = call i32 @SysCtlPeripheralEnable(i32 536870920)
%6 = call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
%7 = call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 16)
%8 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%9 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
store i8 0, i8* %3
%10 = bitcast [4 x i8]* %4 to i8*
%11 = load i32, i32* %2
switch i32 %11, label %20 [
i32 0, label %12
i32 1, label %14
i32 2, label %16
i32 3, label %18
]
12: ; preds = %1
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 -62, i8* %13
br label %21
14: ; preds = %1
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 -46, i8* %15
br label %21
16: ; preds = %1
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 -30, i8* %17
br label %21
18: ; preds = %1
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 -14, i8* %19
br label %21
20: ; preds = %1
br label %21
21: ; preds = %20, %18, %16, %14, %12
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 -112, i8* %22
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 1, i8* %23
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 -29, i8* %24
%25 = call i32 (...) @startB()
store i8 0, i8* %3
br label %26
26: ; preds = %36, %21
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = icmp slt i32 %28, 4
br i1 %29, label %30, label %39
30: ; preds = %26
%31 = load i8, i8* %3
%32 = zext i8 %31 to i64
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = call i32 @Send1byteB(i8 zeroext %34)
br label %36
36: ; preds = %30
%37 = load i8, i8* %3
%38 = add i8 %37, 1
store i8 %38, i8* %3
br label %26
39: ; preds = %26
%40 = call i32 (...) @stopB()
ret void
}

LLVM IR (-O2):
define void @Confige_1115_B(i32 %0) {
%2 = tail call i32 @SysCtlPeripheralEnable(i32 536870920)
%3 = tail call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
%4 = tail call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 16)
%5 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%6 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
%7 = icmp ult i32 %0, 4
%8 = trunc i32 %0 to i8
%9 = shl i8 %8, 4
%10 = add i8 %9, -62
%11 = select i1 %7, i8 %10, i8 0
%12 = tail call i32 (...) @startB()
%13 = tail call i32 @Send1byteB(i8 zeroext -112)
%14 = tail call i32 @Send1byteB(i8 zeroext 1)
%15 = tail call i32 @Send1byteB(i8 zeroext %11)
%16 = tail call i32 @Send1byteB(i8 zeroext -29)
%17 = tail call i32 (...) @stopB()
ret void
}