#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;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ addChecksum(char *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ sprintf(char *, char *, float, char, float);
void gen_nmea0183_VWR(uint8_t *b, uint32_t *len, float awa, char d, float aws) {
  char s[255];
  bzero(s, 255);
  sprintf(s, "$GPVWR,%2.1f,%c,%2.1f,N,,M,,K", awa, d, aws);
  addChecksum(s, b, len);
}


x86 assembly (clang, -O0):
<gen_nmea0183_VWR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movss  %xmm1,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
mov    $0xff,%esi
call   1040 <bzero@plt>
lea    -0x120(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
mov    -0x15(%rbp),%al
movss  -0x1c(%rbp),%xmm1
lea    0xe82(%rip),%rsi
movsbl %al,%edx
call   1050 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <addChecksum@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_nmea0183_VWR>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x118,%rsp
movss  %xmm1,0xc(%rsp)
mov    %edx,%ebx
movss  %xmm0,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    $0xff,%esi
call   1040 <bzero@plt>
lea    0xe95(%rip),%rsi
mov    %r12,%rdi
movss  0x8(%rsp),%xmm0
mov    %ebx,%edx
movss  0xc(%rsp),%xmm1
call   1050 <sprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <addChecksum@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"$GPVWR,%2.1f,%c,%2.1f,N,,M,,K\00"
define void @gen_nmea0183_VWR(i32* %0, i32* %1, float %2, i8 signext %3, float %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca float
%9 = alloca i8
%10 = alloca float
%11 = alloca [255 x i8]
store i32* %0, i32** %6
store i32* %1, i32** %7
store float %2, float* %8
store i8 %3, i8* %9
store float %4, float* %10
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%13 = call i32 @bzero(i8* %12, i32 255)
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%15 = load float, float* %8
%16 = load i8, i8* %9
%17 = load float, float* %10
%18 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %15, i8 signext %16, float %17)
%19 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%20 = load i32*, i32** %6
%21 = load i32*, i32** %7
%22 = call i32 @addChecksum(i8* %19, i32* %20, i32* %21)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"$GPVWR,%2.1f,%c,%2.1f,N,,M,,K\00"
define void @gen_nmea0183_VWR(i32* %0, i32* %1, float %2, i8 signext %3, float %4) {
%6 = alloca [255 x i8]
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%8 = call i32 @bzero(i8* %7, i32 255)
%9 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %2, i8 signext %3, float %4)
%10 = call i32 @addChecksum(i8* %7, i32* %0, i32* %1)
ret void
}