#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*/ SPI_IOC_RD_BITS_PER_WORD;
int /*<<< orphan*/ SPI_IOC_RD_LSB_FIRST;
int /*<<< orphan*/ SPI_IOC_RD_MAX_SPEED_HZ;
int /*<<< orphan*/ SPI_IOC_RD_MODE;
int /*<<< orphan*/ SPI_IOC_WR_BITS_PER_WORD;
int /*<<< orphan*/ SPI_IOC_WR_LSB_FIRST;
int /*<<< orphan*/ SPI_IOC_WR_MAX_SPEED_HZ;
int /*<<< orphan*/ SPI_IOC_WR_MODE;
int SPI_LSB_FIRST;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errorMessage(char *, int /*<<< orphan*/);
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int spiConfig(int fileDescriptor, int mode, int speed, int bitsPerWord,
              int lsbFirst) {
  if (ioctl(fileDescriptor, SPI_IOC_WR_MODE, &mode) < 0) {
    errorMessage("cannot set spi mode: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_RD_MODE, &mode) < 0) {
    errorMessage("cannot get spi mode: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_WR_BITS_PER_WORD, &bitsPerWord) < 0) {
    errorMessage("cannot set spi bits per word: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_RD_BITS_PER_WORD, &bitsPerWord) < 0) {
    errorMessage("cannot get spi bits per word: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_WR_MAX_SPEED_HZ, &speed) < 0) {
    errorMessage("cannot set spi speed: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_RD_MAX_SPEED_HZ, &speed) < 0) {
    errorMessage("cannot get spi speed: %s", strerror(errno));
    return -1;
  }
  int lsb = lsbFirst > 0 ? SPI_LSB_FIRST : 0;
  if (ioctl(fileDescriptor, SPI_IOC_WR_LSB_FIRST, &lsb) < 0) {
    errorMessage("cannot set lsb first: %s", strerror(errno));
    return -1;
  }
  if (ioctl(fileDescriptor, SPI_IOC_RD_LSB_FIRST, &lsb) < 0) {
    errorMessage("cannot get lsb first: %s", strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<spiConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    118f <spiConfig+0x5f>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    11d6 <spiConfig+0xa6>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe53(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2e08(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    121d <spiConfig+0xed>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe24(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2da9(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1264 <spiConfig+0x134>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xdfe(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2d2a(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    12ab <spiConfig+0x17b>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xdd8(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2d0b(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    12f2 <spiConfig+0x1c2>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xdaa(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
cmpl   $0x0,-0x18(%rbp)
jle    130d <spiConfig+0x1dd>
mov    0x2cdd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    1317 <spiConfig+0x1e7>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1317 <spiConfig+0x1e7>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2c79(%rip),%rax
mov    (%rax),%esi
lea    -0x1c(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1364 <spiConfig+0x234>
mov    0x2c6d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xd51(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
mov    -0x8(%rbp),%edi
mov    0x2c3a(%rip),%rax
mov    (%rax),%esi
lea    -0x1c(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    13ab <spiConfig+0x27b>
mov    0x2c26(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xd23(%rip),%rdi
call   1040 <errorMessage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13b2 <spiConfig+0x282>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiConfig>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebp
mov    %edi,%ebx
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0xc(%rsp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0x14(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
js     1259 <spiConfig+0x129>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
lea    0x14(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     1273 <spiConfig+0x143>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     128a <spiConfig+0x15a>
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     12a1 <spiConfig+0x171>
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     12b8 <spiConfig+0x188>
mov    0x2dde(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     12cf <spiConfig+0x19f>
xor    %eax,%eax
test   %ebp,%ebp
jle    1208 <spiConfig+0xd8>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
js     12e6 <spiConfig+0x1b6>
mov    0x2d77(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jns    130a <spiConfig+0x1da>
lea    0xe69(%rip),%rbx
jmp    12ed <spiConfig+0x1bd>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xd92(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xd90(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xd91(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xd9b(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xda5(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xda7(%rip),%rdi
jmp    12fe <spiConfig+0x1ce>
lea    0xdb7(%rip),%rbx
mov    0x2cbc(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <errorMessage@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SPI_IOC_WR_MODE = global i32 0
@.str = [24 x i8] c"cannot set spi mode: %s\00"
@errno = global i32 0
@SPI_IOC_RD_MODE = global i32 0
@.str.1 = [24 x i8] c"cannot get spi mode: %s\00"
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
@.str.2 = [33 x i8] c"cannot set spi bits per word: %s\00"
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
@.str.3 = [33 x i8] c"cannot get spi bits per word: %s\00"
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
@.str.4 = [25 x i8] c"cannot set spi speed: %s\00"
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
@.str.5 = [25 x i8] c"cannot get spi speed: %s\00"
@SPI_LSB_FIRST = global i32 0
@SPI_IOC_WR_LSB_FIRST = global i32 0
@.str.6 = [25 x i8] c"cannot set lsb first: %s\00"
@SPI_IOC_RD_LSB_FIRST = global i32 0
@.str.7 = [25 x i8] c"cannot get lsb first: %s\00"
define i32 @spiConfig(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%13 = load i32, i32* %7
%14 = load i32, i32* @SPI_IOC_WR_MODE
%15 = call i64 @ioctl(i32 %13, i32 %14, i32* %8)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %5
%18 = load i32, i32* @errno
%19 = call i32 @strerror(i32 %18)
%20 = call i32 @errorMessage(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %19)
store i32 -1, i32* %6
br label %92
21: ; preds = %5
%22 = load i32, i32* %7
%23 = load i32, i32* @SPI_IOC_RD_MODE
%24 = call i64 @ioctl(i32 %22, i32 %23, i32* %8)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = load i32, i32* @errno
%28 = call i32 @strerror(i32 %27)
%29 = call i32 @errorMessage(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %28)
store i32 -1, i32* %6
br label %92
30: ; preds = %21
%31 = load i32, i32* %7
%32 = load i32, i32* @SPI_IOC_WR_BITS_PER_WORD
%33 = call i64 @ioctl(i32 %31, i32 %32, i32* %10)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %30
%36 = load i32, i32* @errno
%37 = call i32 @strerror(i32 %36)
%38 = call i32 @errorMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %37)
store i32 -1, i32* %6
br label %92
39: ; preds = %30
%40 = load i32, i32* %7
%41 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%42 = call i64 @ioctl(i32 %40, i32 %41, i32* %10)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %39
%45 = load i32, i32* @errno
%46 = call i32 @strerror(i32 %45)
%47 = call i32 @errorMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %46)
store i32 -1, i32* %6
br label %92
48: ; preds = %39
%49 = load i32, i32* %7
%50 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%51 = call i64 @ioctl(i32 %49, i32 %50, i32* %9)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %48
%54 = load i32, i32* @errno
%55 = call i32 @strerror(i32 %54)
%56 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %55)
store i32 -1, i32* %6
br label %92
57: ; preds = %48
%58 = load i32, i32* %7
%59 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%60 = call i64 @ioctl(i32 %58, i32 %59, i32* %9)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load i32, i32* @errno
%64 = call i32 @strerror(i32 %63)
%65 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %64)
store i32 -1, i32* %6
br label %92
66: ; preds = %57
%67 = load i32, i32* %11
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = load i32, i32* @SPI_LSB_FIRST
br label %72
71: ; preds = %66
br label %72
72: ; preds = %71, %69
%73 = phi i32 [ %70, %69 ], [ 0, %71 ]
store i32 %73, i32* %12
%74 = load i32, i32* %7
%75 = load i32, i32* @SPI_IOC_WR_LSB_FIRST
%76 = call i64 @ioctl(i32 %74, i32 %75, i32* %12)
%77 = icmp slt i64 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %72
%79 = load i32, i32* @errno
%80 = call i32 @strerror(i32 %79)
%81 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %80)
store i32 -1, i32* %6
br label %92
82: ; preds = %72
%83 = load i32, i32* %7
%84 = load i32, i32* @SPI_IOC_RD_LSB_FIRST
%85 = call i64 @ioctl(i32 %83, i32 %84, i32* %12)
%86 = icmp slt i64 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %82
%88 = load i32, i32* @errno
%89 = call i32 @strerror(i32 %88)
%90 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %89)
store i32 -1, i32* %6
br label %92
91: ; preds = %82
store i32 0, i32* %6
br label %92
92: ; preds = %91, %87, %78, %62, %53, %44, %35, %26, %17
%93 = load i32, i32* %6
ret i32 %93
}

LLVM IR (-O2):
@SPI_IOC_WR_MODE = global i32 0
@.str = [24 x i8] c"cannot set spi mode: %s\00"
@errno = global i32 0
@SPI_IOC_RD_MODE = global i32 0
@.str.1 = [24 x i8] c"cannot get spi mode: %s\00"
@SPI_IOC_WR_BITS_PER_WORD = global i32 0
@.str.2 = [33 x i8] c"cannot set spi bits per word: %s\00"
@SPI_IOC_RD_BITS_PER_WORD = global i32 0
@.str.3 = [33 x i8] c"cannot get spi bits per word: %s\00"
@SPI_IOC_WR_MAX_SPEED_HZ = global i32 0
@.str.4 = [25 x i8] c"cannot set spi speed: %s\00"
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
@.str.5 = [25 x i8] c"cannot get spi speed: %s\00"
@SPI_LSB_FIRST = global i32 0
@SPI_IOC_WR_LSB_FIRST = global i32 0
@.str.6 = [25 x i8] c"cannot set lsb first: %s\00"
@SPI_IOC_RD_LSB_FIRST = global i32 0
@.str.7 = [25 x i8] c"cannot get lsb first: %s\00"
define i32 @spiConfig(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* @SPI_IOC_WR_MODE
%11 = call i64 @ioctl(i32 %0, i32 %10, i32* %6)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %5
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @errorMessage(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %76
17: ; preds = %5
%18 = load i32, i32* @SPI_IOC_RD_MODE
%19 = call i64 @ioctl(i32 %0, i32 %18, i32* %6)
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32, i32* @errno
%23 = call i32 @strerror(i32 %22)
%24 = call i32 @errorMessage(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %76
25: ; preds = %17
%26 = load i32, i32* @SPI_IOC_WR_BITS_PER_WORD
%27 = call i64 @ioctl(i32 %0, i32 %26, i32* %8)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* @errno
%31 = call i32 @strerror(i32 %30)
%32 = call i32 @errorMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %76
33: ; preds = %25
%34 = load i32, i32* @SPI_IOC_RD_BITS_PER_WORD
%35 = call i64 @ioctl(i32 %0, i32 %34, i32* %8)
%36 = icmp slt i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i32, i32* @errno
%39 = call i32 @strerror(i32 %38)
%40 = call i32 @errorMessage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %39)
br label %76
41: ; preds = %33
%42 = load i32, i32* @SPI_IOC_WR_MAX_SPEED_HZ
%43 = call i64 @ioctl(i32 %0, i32 %42, i32* %7)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i32, i32* @errno
%47 = call i32 @strerror(i32 %46)
%48 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %47)
br label %76
49: ; preds = %41
%50 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%51 = call i64 @ioctl(i32 %0, i32 %50, i32* %7)
%52 = icmp slt i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i32, i32* @errno
%55 = call i32 @strerror(i32 %54)
%56 = call i32 @errorMessage(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %55)
br label %76
57: ; preds = %49
%58 = bitcast i32* %9 to i8*
%59 = icmp sgt i32 %4, 0
%60 = load i32, i32* @SPI_LSB_FIRST
%61 = select i1 %59, i32 %60, i32 0
store i32 %61, i32* %9
%62 = load i32, i32* @SPI_IOC_WR_LSB_FIRST
%63 = call i64 @ioctl(i32 %0, i32 %62, i32* %9)
%64 = icmp slt i64 %63, 0
br i1 %64, label %69, label %65
65: ; preds = %57
%66 = load i32, i32* @SPI_IOC_RD_LSB_FIRST
%67 = call i64 @ioctl(i32 %0, i32 %66, i32* %9)
%68 = icmp slt i64 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %65, %57
%70 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), %57 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), %65 ]
%71 = load i32, i32* @errno
%72 = call i32 @strerror(i32 %71)
%73 = call i32 @errorMessage(i8* %70, i32 %72)
br label %74
74: ; preds = %69, %65
%75 = phi i32 [ 0, %65 ], [ -1, %69 ]
br label %76
76: ; preds = %74, %53, %45, %37, %29, %21, %13
%77 = phi i32 [ -1, %13 ], [ -1, %21 ], [ -1, %29 ], [ -1, %37 ], [ -1, %45 ], [ -1, %53 ], [ %75, %74 ]
ret i32 %77
}