#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*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ send_report20(int, unsigned char *, int);
void send_msg20(int fd, const unsigned char c0, const unsigned char c1,
                const unsigned char c2, const unsigned char c3,
                const unsigned char c4, const unsigned char c5,
                const unsigned char c6, const unsigned char c7,
                const unsigned char c8, const unsigned char c9,
                const unsigned char c10, const unsigned char c11,
                const unsigned char c12, const unsigned char c13,
                const unsigned char c14, const unsigned char c15,
                const unsigned char c16, const unsigned char c17,
                const unsigned char c18) {
  unsigned char b[19];
  b[0] = c0;
  b[1] = c1;
  b[2] = c2;
  b[3] = c3;
  b[4] = c4;
  b[5] = c5;
  b[6] = c6;
  b[7] = c7;
  b[8] = c8;
  b[9] = c9;
  b[10] = c10;
  b[11] = c11;
  b[12] = c12;
  b[13] = c13;
  b[14] = c14;
  b[15] = c15;
  b[16] = c16;
  b[17] = c17;
  b[18] = c18;
  if (send_report20(fd, b, 19) < 0) {
    perror("error sending to device");
    close(fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<send_msg20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x30(%rbp)
mov    %ecx,%eax
mov    -0x30(%rbp),%ecx
mov    %eax,-0x2c(%rbp)
mov    %edx,%eax
mov    -0x2c(%rbp),%edx
mov    %eax,-0x28(%rbp)
mov    %esi,%eax
mov    -0x28(%rbp),%esi
mov    %eax,-0x24(%rbp)
mov    %edi,%r8d
mov    -0x24(%rbp),%edi
mov    %r9b,%al
mov    0x78(%rbp),%r9b
mov    0x70(%rbp),%r9b
mov    0x68(%rbp),%r9b
mov    0x60(%rbp),%r9b
mov    0x58(%rbp),%r9b
mov    0x50(%rbp),%r9b
mov    0x48(%rbp),%r9b
mov    0x40(%rbp),%r9b
mov    0x38(%rbp),%r9b
mov    0x30(%rbp),%r9b
mov    0x28(%rbp),%r9b
mov    0x20(%rbp),%r9b
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8d,-0x4(%rbp)
mov    %dil,-0x5(%rbp)
mov    %sil,-0x6(%rbp)
mov    %dl,-0x7(%rbp)
mov    %cl,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x20(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x1f(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x1e(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x1d(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x1c(%rbp)
mov    0x10(%rbp),%al
mov    %al,-0x1b(%rbp)
mov    0x18(%rbp),%al
mov    %al,-0x1a(%rbp)
mov    0x20(%rbp),%al
mov    %al,-0x19(%rbp)
mov    0x28(%rbp),%al
mov    %al,-0x18(%rbp)
mov    0x30(%rbp),%al
mov    %al,-0x17(%rbp)
mov    0x38(%rbp),%al
mov    %al,-0x16(%rbp)
mov    0x40(%rbp),%al
mov    %al,-0x15(%rbp)
mov    0x48(%rbp),%al
mov    %al,-0x14(%rbp)
mov    0x50(%rbp),%al
mov    %al,-0x13(%rbp)
mov    0x58(%rbp),%al
mov    %al,-0x12(%rbp)
mov    0x60(%rbp),%al
mov    %al,-0x11(%rbp)
mov    0x68(%rbp),%al
mov    %al,-0x10(%rbp)
mov    0x70(%rbp),%al
mov    %al,-0xf(%rbp)
mov    0x78(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x13,%edx
call   1050 <send_report20@plt>
cmp    $0x0,%rax
jge    1265 <send_msg20+0x125>
lea    0xdb2(%rip),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg20>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r13d
mov    0x90(%rsp),%r11b
mov    0x88(%rsp),%r10b
mov    0x80(%rsp),%dil
mov    0x78(%rsp),%al
mov    0x70(%rsp),%bl
mov    0x68(%rsp),%bpl
mov    0x60(%rsp),%r14b
mov    0x58(%rsp),%r15b
mov    0x50(%rsp),%r12b
mov    %sil,(%rsp)
mov    %dl,0x1(%rsp)
mov    %cl,0x2(%rsp)
mov    %r8b,0x3(%rsp)
mov    %r9b,0x4(%rsp)
mov    %r12b,0x5(%rsp)
mov    %r15b,0x6(%rsp)
mov    %r14b,0x7(%rsp)
mov    %bpl,0x8(%rsp)
mov    %bl,0x9(%rsp)
mov    %al,0xa(%rsp)
mov    %dil,0xb(%rsp)
mov    %r10b,0xc(%rsp)
mov    %r11b,0xd(%rsp)
mov    0x98(%rsp),%al
mov    %al,0xe(%rsp)
mov    0xa0(%rsp),%al
mov    %al,0xf(%rsp)
mov    0xa8(%rsp),%al
mov    %al,0x10(%rsp)
mov    0xb0(%rsp),%al
mov    %al,0x11(%rsp)
mov    0xb8(%rsp),%al
mov    %al,0x12(%rsp)
mov    %rsp,%rsi
mov    %r13d,%edi
mov    $0x13,%edx
call   1050 <send_report20@plt>
test   %rax,%rax
js     1221 <send_msg20+0xe1>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdd8(%rip),%rdi
call   1040 <perror@plt>
mov    %r13d,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"error sending to device\00"
define void @send_msg20(i32 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8 zeroext %8, i8 zeroext %9, i8 zeroext %10, i8 zeroext %11, i8 zeroext %12, i8 zeroext %13, i8 zeroext %14, i8 zeroext %15, i8 zeroext %16, i8 zeroext %17, i8 zeroext %18, i8 zeroext %19) {
%21 = alloca i32
%22 = alloca i8
%23 = alloca i8
%24 = alloca i8
%25 = alloca i8
%26 = alloca i8
%27 = alloca i8
%28 = alloca i8
%29 = alloca i8
%30 = alloca i8
%31 = alloca i8
%32 = alloca i8
%33 = alloca i8
%34 = alloca i8
%35 = alloca i8
%36 = alloca i8
%37 = alloca i8
%38 = alloca i8
%39 = alloca i8
%40 = alloca i8
%41 = alloca [19 x i8]
store i32 %0, i32* %21
store i8 %1, i8* %22
store i8 %2, i8* %23
store i8 %3, i8* %24
store i8 %4, i8* %25
store i8 %5, i8* %26
store i8 %6, i8* %27
store i8 %7, i8* %28
store i8 %8, i8* %29
store i8 %9, i8* %30
store i8 %10, i8* %31
store i8 %11, i8* %32
store i8 %12, i8* %33
store i8 %13, i8* %34
store i8 %14, i8* %35
store i8 %15, i8* %36
store i8 %16, i8* %37
store i8 %17, i8* %38
store i8 %18, i8* %39
store i8 %19, i8* %40
%42 = load i8, i8* %22
%43 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 0
store i8 %42, i8* %43
%44 = load i8, i8* %23
%45 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 1
store i8 %44, i8* %45
%46 = load i8, i8* %24
%47 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 2
store i8 %46, i8* %47
%48 = load i8, i8* %25
%49 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 3
store i8 %48, i8* %49
%50 = load i8, i8* %26
%51 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 4
store i8 %50, i8* %51
%52 = load i8, i8* %27
%53 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 5
store i8 %52, i8* %53
%54 = load i8, i8* %28
%55 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 6
store i8 %54, i8* %55
%56 = load i8, i8* %29
%57 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 7
store i8 %56, i8* %57
%58 = load i8, i8* %30
%59 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 8
store i8 %58, i8* %59
%60 = load i8, i8* %31
%61 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 9
store i8 %60, i8* %61
%62 = load i8, i8* %32
%63 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 10
store i8 %62, i8* %63
%64 = load i8, i8* %33
%65 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 11
store i8 %64, i8* %65
%66 = load i8, i8* %34
%67 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 12
store i8 %66, i8* %67
%68 = load i8, i8* %35
%69 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 13
store i8 %68, i8* %69
%70 = load i8, i8* %36
%71 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 14
store i8 %70, i8* %71
%72 = load i8, i8* %37
%73 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 15
store i8 %72, i8* %73
%74 = load i8, i8* %38
%75 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 16
store i8 %74, i8* %75
%76 = load i8, i8* %39
%77 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 17
store i8 %76, i8* %77
%78 = load i8, i8* %40
%79 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 18
store i8 %78, i8* %79
%80 = load i32, i32* %21
%81 = getelementptr inbounds [19 x i8], [19 x i8]* %41, i64 0, i64 0
%82 = call i64 @send_report20(i32 %80, i8* %81, i32 19)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %89
84: ; preds = %20
%85 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%86 = load i32, i32* %21
%87 = call i32 @close(i32 %86)
%88 = call i32 @exit(i32 1)
unreachable
89: ; preds = %20
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"error sending to device\00"
define void @send_msg20(i32 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8 zeroext %8, i8 zeroext %9, i8 zeroext %10, i8 zeroext %11, i8 zeroext %12, i8 zeroext %13, i8 zeroext %14, i8 zeroext %15, i8 zeroext %16, i8 zeroext %17, i8 zeroext %18, i8 zeroext %19) {
%21 = alloca [19 x i8]
%22 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 0
store i8 %1, i8* %22
%23 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 1
store i8 %2, i8* %23
%24 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 2
store i8 %3, i8* %24
%25 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 3
store i8 %4, i8* %25
%26 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 4
store i8 %5, i8* %26
%27 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 5
store i8 %6, i8* %27
%28 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 6
store i8 %7, i8* %28
%29 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 7
store i8 %8, i8* %29
%30 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 8
store i8 %9, i8* %30
%31 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 9
store i8 %10, i8* %31
%32 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 10
store i8 %11, i8* %32
%33 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 11
store i8 %12, i8* %33
%34 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 12
store i8 %13, i8* %34
%35 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 13
store i8 %14, i8* %35
%36 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 14
store i8 %15, i8* %36
%37 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 15
store i8 %16, i8* %37
%38 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 16
store i8 %17, i8* %38
%39 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 17
store i8 %18, i8* %39
%40 = getelementptr inbounds [19 x i8], [19 x i8]* %21, i64 0, i64 18
store i8 %19, i8* %40
%41 = call i64 @send_report20(i32 %0, i8* %22, i32 19)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %20
%44 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%45 = call i32 @close(i32 %0)
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %20
ret void
}