#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 */
struct wcfxs {
  int dummy;
};

/* Variables and functions */
int fx_program_register_SPI2UART(struct wcfxs *, int, int);
int /*<<< orphan*/ fx_write_SPI2UART(struct wcfxs *, int, int);
int init_SC16IS750(struct wcfxs *wc, int port) {
  int ret;
  ret = fx_program_register_SPI2UART(wc, port, 0x1880);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x0006);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x0800);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x18BF);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x10D0);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x1803);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x2004);
  if (ret)
    return 1;
  ret = fx_program_register_SPI2UART(wc, port, 0x301E);
  if (ret)
    return 1;
  fx_write_SPI2UART(wc, port, 0x10c6);
  ret = fx_program_register_SPI2UART(wc, port, 0x0801);
  if (ret)
    return 1;
  fx_write_SPI2UART(wc, port, 0x1007);
  fx_write_SPI2UART(wc, port, 0x5825);
  ret = fx_program_register_SPI2UART(wc, port, 0x5025);
  if (ret)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<init_SC16IS750>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1880,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1159 <init_SC16IS750+0x39>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x6,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1183 <init_SC16IS750+0x63>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x800,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11ad <init_SC16IS750+0x8d>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x18bf,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11d7 <init_SC16IS750+0xb7>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x10d0,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1201 <init_SC16IS750+0xe1>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1803,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     122b <init_SC16IS750+0x10b>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x2004,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1255 <init_SC16IS750+0x135>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x301e,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     127f <init_SC16IS750+0x15f>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x10c6,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x801,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     12ba <init_SC16IS750+0x19a>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1007,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x5825,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x5025,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1306 <init_SC16IS750+0x1e6>
movl   $0x1,-0x4(%rbp)
jmp    130d <init_SC16IS750+0x1ed>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_SC16IS750>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1880,%edx
call   1040 <fx_program_register_SPI2UART@plt>
mov    $0x1,%r14d
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x6,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x800,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x18bf,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x10d0,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1803,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2004,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x301e,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x10c6,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x801,%edx
call   1040 <fx_program_register_SPI2UART@plt>
test   %eax,%eax
jne    122e <init_SC16IS750+0x10e>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1007,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x5825,%edx
call   1030 <fx_write_SPI2UART@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x5025,%edx
call   1040 <fx_program_register_SPI2UART@plt>
xor    %r14d,%r14d
test   %eax,%eax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.wcfxs = type { i32 }
define i32 @init_SC16IS750(%struct.wcfxs* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.wcfxs*
%5 = alloca i32
%6 = alloca i32
store %struct.wcfxs* %0, %struct.wcfxs** %4
store i32 %1, i32* %5
%7 = load %struct.wcfxs*, %struct.wcfxs** %4
%8 = load i32, i32* %5
%9 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %7, i32 %8, i32 6272)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %86
13: ; preds = %2
%14 = load %struct.wcfxs*, %struct.wcfxs** %4
%15 = load i32, i32* %5
%16 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %14, i32 %15, i32 6)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 1, i32* %3
br label %86
20: ; preds = %13
%21 = load %struct.wcfxs*, %struct.wcfxs** %4
%22 = load i32, i32* %5
%23 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %21, i32 %22, i32 2048)
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %3
br label %86
27: ; preds = %20
%28 = load %struct.wcfxs*, %struct.wcfxs** %4
%29 = load i32, i32* %5
%30 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %28, i32 %29, i32 6335)
store i32 %30, i32* %6
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %3
br label %86
34: ; preds = %27
%35 = load %struct.wcfxs*, %struct.wcfxs** %4
%36 = load i32, i32* %5
%37 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %35, i32 %36, i32 4304)
store i32 %37, i32* %6
%38 = load i32, i32* %6
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %34
store i32 1, i32* %3
br label %86
41: ; preds = %34
%42 = load %struct.wcfxs*, %struct.wcfxs** %4
%43 = load i32, i32* %5
%44 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %42, i32 %43, i32 6147)
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %41
store i32 1, i32* %3
br label %86
48: ; preds = %41
%49 = load %struct.wcfxs*, %struct.wcfxs** %4
%50 = load i32, i32* %5
%51 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %49, i32 %50, i32 8196)
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %48
store i32 1, i32* %3
br label %86
55: ; preds = %48
%56 = load %struct.wcfxs*, %struct.wcfxs** %4
%57 = load i32, i32* %5
%58 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %56, i32 %57, i32 12318)
store i32 %58, i32* %6
%59 = load i32, i32* %6
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %55
store i32 1, i32* %3
br label %86
62: ; preds = %55
%63 = load %struct.wcfxs*, %struct.wcfxs** %4
%64 = load i32, i32* %5
%65 = call i32 @fx_write_SPI2UART(%struct.wcfxs* %63, i32 %64, i32 4294)
%66 = load %struct.wcfxs*, %struct.wcfxs** %4
%67 = load i32, i32* %5
%68 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %66, i32 %67, i32 2049)
store i32 %68, i32* %6
%69 = load i32, i32* %6
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %62
store i32 1, i32* %3
br label %86
72: ; preds = %62
%73 = load %struct.wcfxs*, %struct.wcfxs** %4
%74 = load i32, i32* %5
%75 = call i32 @fx_write_SPI2UART(%struct.wcfxs* %73, i32 %74, i32 4103)
%76 = load %struct.wcfxs*, %struct.wcfxs** %4
%77 = load i32, i32* %5
%78 = call i32 @fx_write_SPI2UART(%struct.wcfxs* %76, i32 %77, i32 22565)
%79 = load %struct.wcfxs*, %struct.wcfxs** %4
%80 = load i32, i32* %5
%81 = call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %79, i32 %80, i32 20517)
store i32 %81, i32* %6
%82 = load i32, i32* %6
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %72
store i32 1, i32* %3
br label %86
85: ; preds = %72
store i32 0, i32* %3
br label %86
86: ; preds = %85, %84, %71, %61, %54, %47, %40, %33, %26, %19, %12
%87 = load i32, i32* %3
ret i32 %87
}

LLVM IR (-O2):
%struct.wcfxs = type { i32 }
define i32 @init_SC16IS750(%struct.wcfxs* %0, i32 %1) {
%3 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 6272)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %36
5: ; preds = %2
%6 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 6)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %36
8: ; preds = %5
%9 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 2048)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 6335)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %36
14: ; preds = %11
%15 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 4304)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %36
17: ; preds = %14
%18 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 6147)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %36
20: ; preds = %17
%21 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 8196)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %36
23: ; preds = %20
%24 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 12318)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %36
26: ; preds = %23
%27 = tail call i32 @fx_write_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 4294)
%28 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 2049)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %26
%31 = tail call i32 @fx_write_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 4103)
%32 = tail call i32 @fx_write_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 22565)
%33 = tail call i32 @fx_program_register_SPI2UART(%struct.wcfxs* %0, i32 %1, i32 20517)
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i32
br label %36
36: ; preds = %30, %26, %23, %20, %17, %14, %11, %8, %5, %2
%37 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 1, %8 ], [ 1, %11 ], [ 1, %14 ], [ 1, %17 ], [ 1, %20 ], [ 1, %23 ], [ 1, %26 ], [ %35, %30 ]
ret i32 %37
}