#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 /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pru_bridge_init(int *);
int /*<<< orphan*/ pru_channel_close(int);
int /*<<< orphan*/ pru_channel_open(int, int);
int /*<<< orphan*/ pru_write(int, int /*<<< orphan*/ *, int);
int main() {
  int size[5] = {100, 100, 100, 100, 100};
  pru_bridge_init(size);
  pru_channel_open(1, 1);
  pru_channel_open(2, 1);
  pru_channel_open(3, 1);
  pru_channel_open(4, 1);
  pru_channel_open(5, 1);
  int pru_data = 10000;
  pru_write(1, (uint8_t *)&pru_data, 4);
  pru_write(2, (uint8_t *)&pru_data, 4);
  pru_write(3, (uint8_t *)&pru_data, 4);
  pru_write(4, (uint8_t *)&pru_data, 4);
  pru_write(5, (uint8_t *)&pru_data, 4);
  pru_channel_close(1);
  pru_channel_close(2);
  pru_channel_close(3);
  pru_channel_close(4);
  pru_channel_close(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1060 <pru_bridge_init@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <pru_channel_open@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
movl   $0x2710,-0x24(%rbp)
mov    $0x1,%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x2,%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x3,%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x4,%edx
lea    -0x24(%rbp),%rsi
mov    %edx,%edi
call   1030 <pru_write@plt>
mov    $0x5,%edi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x1,%edi
call   1040 <pru_channel_close@plt>
mov    $0x2,%edi
call   1040 <pru_channel_close@plt>
mov    $0x3,%edi
call   1040 <pru_channel_close@plt>
mov    $0x4,%edi
call   1040 <pru_channel_close@plt>
mov    $0x5,%edi
call   1040 <pru_channel_close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xec5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1060 <pru_bridge_init@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1050 <pru_channel_open@plt>
movl   $0x2710,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <pru_write@plt>
mov    $0x1,%edi
call   1040 <pru_channel_close@plt>
mov    $0x2,%edi
call   1040 <pru_channel_close@plt>
mov    $0x3,%edi
call   1040 <pru_channel_close@plt>
mov    $0x4,%edi
call   1040 <pru_channel_close@plt>
mov    $0x5,%edi
call   1040 <pru_channel_close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.size = [5 x i32] [i32 100, i32 100, i32 100, i32 100, i32 100]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @pru_bridge_init(i32* %5)
%7 = call i32 @pru_channel_open(i32 1, i32 1)
%8 = call i32 @pru_channel_open(i32 2, i32 1)
%9 = call i32 @pru_channel_open(i32 3, i32 1)
%10 = call i32 @pru_channel_open(i32 4, i32 1)
%11 = call i32 @pru_channel_open(i32 5, i32 1)
store i32 10000, i32* %3
%12 = call i32 @pru_write(i32 1, i32* %3, i32 4)
%13 = call i32 @pru_write(i32 2, i32* %3, i32 4)
%14 = call i32 @pru_write(i32 3, i32* %3, i32 4)
%15 = call i32 @pru_write(i32 4, i32* %3, i32 4)
%16 = call i32 @pru_write(i32 5, i32* %3, i32 4)
%17 = call i32 @pru_channel_close(i32 1)
%18 = call i32 @pru_channel_close(i32 2)
%19 = call i32 @pru_channel_close(i32 3)
%20 = call i32 @pru_channel_close(i32 4)
%21 = call i32 @pru_channel_close(i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.size = [5 x i32] [i32 100, i32 100, i32 100, i32 100, i32 100]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @pru_bridge_init(i32* %4)
%6 = call i32 @pru_channel_open(i32 1, i32 1)
%7 = call i32 @pru_channel_open(i32 2, i32 1)
%8 = call i32 @pru_channel_open(i32 3, i32 1)
%9 = call i32 @pru_channel_open(i32 4, i32 1)
%10 = call i32 @pru_channel_open(i32 5, i32 1)
%11 = bitcast i32* %2 to i8*
store i32 10000, i32* %2
%12 = call i32 @pru_write(i32 1, i32* %2, i32 4)
%13 = call i32 @pru_write(i32 2, i32* %2, i32 4)
%14 = call i32 @pru_write(i32 3, i32* %2, i32 4)
%15 = call i32 @pru_write(i32 4, i32* %2, i32 4)
%16 = call i32 @pru_write(i32 5, i32* %2, i32 4)
%17 = call i32 @pru_channel_close(i32 1)
%18 = call i32 @pru_channel_close(i32 2)
%19 = call i32 @pru_channel_close(i32 3)
%20 = call i32 @pru_channel_close(i32 4)
%21 = call i32 @pru_channel_close(i32 5)
ret i32 0
}