#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*/ gds_swap2bytes(unsigned char *);
int /*<<< orphan*/ gds_write_float(int, float);
int /*<<< orphan*/ write(int, int *, int);
void gds_write_mag(int fd, float mag) {
  static int count, token;
  count = 12;
  gds_swap2bytes((unsigned char *)&count);
  write(fd, &count, 2);
  token = 0x1B05;
  gds_swap2bytes((unsigned char *)&token);
  write(fd, &token, 2);
  gds_write_float(fd, mag);
}


x86 assembly (clang, -O0):
<gds_write_mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movl   $0xc,0x2ef2(%rip)
lea    0x2eeb(%rip),%rdi
call   1040 <gds_swap2bytes@plt>
mov    -0x4(%rbp),%edi
lea    0x2edc(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
movl   $0x1b05,0x2ecc(%rip)
lea    0x2ec5(%rip),%rdi
call   1040 <gds_swap2bytes@plt>
mov    -0x4(%rbp),%edi
lea    0x2eb6(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1050 <gds_write_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gds_write_mag>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edi,%ebx
movl   $0xc,0x2ef6(%rip)
lea    0x2eef(%rip),%r14
mov    %r14,%rdi
call   1040 <gds_swap2bytes@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
movl   $0x1b05,0x2ed2(%rip)
lea    0x2ecb(%rip),%r14
mov    %r14,%rdi
call   1040 <gds_swap2bytes@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %ebx,%edi
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <gds_write_float@plt>

LLVM IR (-O0):
@gds_write_mag.count = internal global i32 0
@gds_write_mag.token = internal global i32 0
define void @gds_write_mag(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
store i32 12, i32* @gds_write_mag.count
%5 = call i32 @gds_swap2bytes(i8* bitcast (i32* @gds_write_mag.count to i8*))
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i32* @gds_write_mag.count, i32 2)
store i32 6917, i32* @gds_write_mag.token
%8 = call i32 @gds_swap2bytes(i8* bitcast (i32* @gds_write_mag.token to i8*))
%9 = load i32, i32* %3
%10 = call i32 @write(i32 %9, i32* @gds_write_mag.token, i32 2)
%11 = load i32, i32* %3
%12 = load float, float* %4
%13 = call i32 @gds_write_float(i32 %11, float %12)
ret void
}

LLVM IR (-O2):
@gds_write_mag.count = internal global i32 0
@gds_write_mag.token = internal global i32 0
define void @gds_write_mag(i32 %0, float %1) {
store i32 12, i32* @gds_write_mag.count
%3 = tail call i32 @gds_swap2bytes(i8* bitcast (i32* @gds_write_mag.count to i8*))
%4 = tail call i32 @write(i32 %0, i32* @gds_write_mag.count, i32 2)
store i32 6917, i32* @gds_write_mag.token
%5 = tail call i32 @gds_swap2bytes(i8* bitcast (i32* @gds_write_mag.token to i8*))
%6 = tail call i32 @write(i32 %0, i32* @gds_write_mag.token, i32 2)
%7 = tail call i32 @gds_write_float(i32 %0, float %1)
ret void
}