#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*/ CFG_MSG_RXM_RAW;
typedef int /*<<< orphan*/ CFG_MSG_NAV_TIMEUTC;
typedef int /*<<< orphan*/ CFG_MSG_NAV_TIMEGPS;
typedef int /*<<< orphan*/ CFG_MSG_NAV_SVINFO;
typedef int /*<<< orphan*/ CFG_MSG_NAV_STATUS;
typedef int /*<<< orphan*/ CFG_MSG_NAV_POSLLH;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int txMsg(char *, int, int, int);
int turnOnRaw(int fd) {
  char CFG_MSG_NAV_POSLLH[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x02,
                               0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  char CFG_MSG_NAV_TIMEGPS[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x20,
                                0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  char CFG_MSG_NAV_TIMEUTC[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x21,
                                0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  char CFG_MSG_NAV_STATUS[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x03,
                               0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  char CFG_MSG_NAV_SVINFO[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x01, 0x30,
                               0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  char CFG_MSG_RXM_RAW[] = {0xB5, 0x62, 0x06, 0x01, 0x08, 0x00, 0x02, 0x10,
                            0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
  int success = 0;
  if (!(success =
            txMsg(CFG_MSG_NAV_POSLLH, sizeof(CFG_MSG_NAV_POSLLH), fd, 10)))
    printf("couldn't turn on POSLLH: %d\n", success);
  if (!(success =
            txMsg(CFG_MSG_NAV_TIMEGPS, sizeof(CFG_MSG_NAV_TIMEGPS), fd, 10)))
    printf("couldn't turn on TIMEGPS: %d\n", success);
  if (!(success =
            txMsg(CFG_MSG_NAV_TIMEUTC, sizeof(CFG_MSG_NAV_TIMEUTC), fd, 10)))
    printf("couldn't turn on TIMEUTC: %d\n", success);
  if (!(success =
            txMsg(CFG_MSG_NAV_STATUS, sizeof(CFG_MSG_NAV_STATUS), fd, 10)))
    printf("couldn't turn on STATUS: %d\n", success);
  if (!(success =
            txMsg(CFG_MSG_NAV_SVINFO, sizeof(CFG_MSG_NAV_SVINFO), fd, 10)))
    printf("couldn't turn on SVINFO: %d\n", success);
  if (!(success = txMsg(CFG_MSG_RXM_RAW, sizeof(CFG_MSG_RXM_RAW), fd, 10)))
    printf("couldn't turn on RXM: %d\n", success);
  return success;
}


x86 assembly (clang, -O0):
<turnOnRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x74(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    11ea <turnOnRaw+0xca>
mov    -0x74(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    121b <turnOnRaw+0xfb>
mov    -0x74(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    124c <turnOnRaw+0x12c>
mov    -0x74(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    127d <turnOnRaw+0x15d>
mov    -0x74(%rbp),%esi
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    12ae <turnOnRaw+0x18e>
mov    -0x74(%rbp),%esi
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x10,%esi
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,-0x74(%rbp)
cmp    $0x0,%eax
jne    12df <turnOnRaw+0x1bf>
mov    -0x74(%rbp),%esi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnOnRaw>:
push   %rbx
sub    $0x60,%rsp
mov    %edi,%ebx
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x50(%rsp),%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
test   %eax,%eax
jne    1196 <turnOnRaw+0x76>
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x40(%rsp),%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
test   %eax,%eax
jne    11be <turnOnRaw+0x9e>
lea    0xec6(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
test   %eax,%eax
jne    11e6 <turnOnRaw+0xc6>
lea    0xebc(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
test   %eax,%eax
jne    120e <turnOnRaw+0xee>
lea    0xeb2(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
test   %eax,%eax
jne    1236 <turnOnRaw+0x116>
lea    0xea7(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    $0x10,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1040 <txMsg@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    125e <turnOnRaw+0x13e>
lea    0xe9c(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.turnOnRaw.CFG_MSG_NAV_POSLLH = [16 x i8] c"\B5b\06\01\08\00\01\02\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_TIMEGPS = [16 x i8] c"\B5b\06\01\08\00\01 \01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_TIMEUTC = [16 x i8] c"\B5b\06\01\08\00\01!\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_STATUS = [16 x i8] c"\B5b\06\01\08\00\01\03\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_SVINFO = [16 x i8] c"\B5b\06\01\08\00\010\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_RXM_RAW = [16 x i8] c"\B5b\06\01\08\00\02\10\01\01\01\01\01\01\00\00"
@.str = [29 x i8] c"couldn't turn on POSLLH: %d\0A\00"
@.str.1 = [30 x i8] c"couldn't turn on TIMEGPS: %d\0A\00"
@.str.2 = [30 x i8] c"couldn't turn on TIMEUTC: %d\0A\00"
@.str.3 = [29 x i8] c"couldn't turn on STATUS: %d\0A\00"
@.str.4 = [29 x i8] c"couldn't turn on SVINFO: %d\0A\00"
@.str.5 = [26 x i8] c"couldn't turn on RXM: %d\0A\00"
define i32 @turnOnRaw(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = alloca [16 x i8]
%9 = alloca i32
store i32 %0, i32* %2
%10 = bitcast [16 x i8]* %3 to i8*
%11 = bitcast [16 x i8]* %4 to i8*
%12 = bitcast [16 x i8]* %5 to i8*
%13 = bitcast [16 x i8]* %6 to i8*
%14 = bitcast [16 x i8]* %7 to i8*
%15 = bitcast [16 x i8]* %8 to i8*
store i32 0, i32* %9
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%17 = load i32, i32* %2
%18 = call i32 @txMsg(i8* %16, i32 16, i32 %17, i32 10)
store i32 %18, i32* %9
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %1
%21 = load i32, i32* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %1
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%25 = load i32, i32* %2
%26 = call i32 @txMsg(i8* %24, i32 16, i32 %25, i32 10)
store i32 %26, i32* %9
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %23
%29 = load i32, i32* %9
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %23
%32 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%33 = load i32, i32* %2
%34 = call i32 @txMsg(i8* %32, i32 16, i32 %33, i32 10)
store i32 %34, i32* %9
%35 = icmp ne i32 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %31
%37 = load i32, i32* %9
%38 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %31
%40 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%41 = load i32, i32* %2
%42 = call i32 @txMsg(i8* %40, i32 16, i32 %41, i32 10)
store i32 %42, i32* %9
%43 = icmp ne i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %39
%45 = load i32, i32* %9
%46 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %44, %39
%48 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%49 = load i32, i32* %2
%50 = call i32 @txMsg(i8* %48, i32 16, i32 %49, i32 10)
store i32 %50, i32* %9
%51 = icmp ne i32 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %47
%53 = load i32, i32* %9
%54 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %47
%56 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%57 = load i32, i32* %2
%58 = call i32 @txMsg(i8* %56, i32 16, i32 %57, i32 10)
store i32 %58, i32* %9
%59 = icmp ne i32 %58, 0
br i1 %59, label %63, label %60
60: ; preds = %55
%61 = load i32, i32* %9
%62 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %60, %55
%64 = load i32, i32* %9
ret i32 %64
}

LLVM IR (-O2):
@__const.turnOnRaw.CFG_MSG_NAV_POSLLH = [16 x i8] c"\B5b\06\01\08\00\01\02\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_TIMEGPS = [16 x i8] c"\B5b\06\01\08\00\01 \01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_TIMEUTC = [16 x i8] c"\B5b\06\01\08\00\01!\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_STATUS = [16 x i8] c"\B5b\06\01\08\00\01\03\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_NAV_SVINFO = [16 x i8] c"\B5b\06\01\08\00\010\01\01\01\01\01\01\00\00"
@__const.turnOnRaw.CFG_MSG_RXM_RAW = [16 x i8] c"\B5b\06\01\08\00\02\10\01\01\01\01\01\01\00\00"
@.str = [29 x i8] c"couldn't turn on POSLLH: %d\0A\00"
@.str.1 = [30 x i8] c"couldn't turn on TIMEGPS: %d\0A\00"
@.str.2 = [30 x i8] c"couldn't turn on TIMEUTC: %d\0A\00"
@.str.3 = [29 x i8] c"couldn't turn on STATUS: %d\0A\00"
@.str.4 = [29 x i8] c"couldn't turn on SVINFO: %d\0A\00"
@.str.5 = [26 x i8] c"couldn't turn on RXM: %d\0A\00"
define i32 @turnOnRaw(i32 %0) {
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%14 = call i32 @txMsg(i8* %8, i32 16, i32 %0, i32 10)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 0)
br label %18
18: ; preds = %16, %1
%19 = call i32 @txMsg(i8* %9, i32 16, i32 %0, i32 10)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %23
23: ; preds = %21, %18
%24 = call i32 @txMsg(i8* %10, i32 16, i32 %0, i32 10)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %28
28: ; preds = %26, %23
%29 = call i32 @txMsg(i8* %11, i32 16, i32 %0, i32 10)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %33
33: ; preds = %31, %28
%34 = call i32 @txMsg(i8* %12, i32 16, i32 %0, i32 10)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %38
38: ; preds = %36, %33
%39 = call i32 @txMsg(i8* %13, i32 16, i32 %0, i32 10)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 0)
br label %43
43: ; preds = %41, %38
ret i32 %39
}