#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 */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pprz_tmtc_send(struct demod_state *, unsigned char *, int,
                                  int);
void pprz_status(struct demod_state *s) {
  unsigned char data[2];
  data[0] = 0x01;
  pprz_tmtc_send(s, data, 1, 2);
  data[0] = 0x00;
  data[1] = 0x04;
  pprz_tmtc_send(s, data, 2, 4);
  data[0] = 0x00;
  pprz_tmtc_send(s, data, 1, 3);
  return;
}


x86 assembly (clang, -O0):
<pprz_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x1,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <pprz_tmtc_send@plt>
movb   $0x0,-0xa(%rbp)
movb   $0x4,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1030 <pprz_tmtc_send@plt>
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <pprz_tmtc_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pprz_status>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x1,0x6(%rsp)
lea    0x6(%rsp),%r14
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <pprz_tmtc_send@plt>
movw   $0x400,0x6(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1030 <pprz_tmtc_send@plt>
movb   $0x0,0x6(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <pprz_tmtc_send@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @pprz_status(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
%3 = alloca [2 x i8]
store %struct.demod_state* %0, %struct.demod_state** %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 1, i8* %4
%5 = load %struct.demod_state*, %struct.demod_state** %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%7 = call i32 @pprz_tmtc_send(%struct.demod_state* %5, i8* %6, i32 1, i32 2)
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 0, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 4, i8* %9
%10 = load %struct.demod_state*, %struct.demod_state** %2
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = call i32 @pprz_tmtc_send(%struct.demod_state* %10, i8* %11, i32 2, i32 4)
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 0, i8* %13
%14 = load %struct.demod_state*, %struct.demod_state** %2
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%16 = call i32 @pprz_tmtc_send(%struct.demod_state* %14, i8* %15, i32 1, i32 3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @pprz_status(%struct.demod_state* %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 1, i8* %3
%4 = call i32 @pprz_tmtc_send(%struct.demod_state* %0, i8* %3, i32 1, i32 2)
store i8 0, i8* %3
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 4, i8* %5
%6 = call i32 @pprz_tmtc_send(%struct.demod_state* %0, i8* %3, i32 2, i32 4)
store i8 0, i8* %3
%7 = call i32 @pprz_tmtc_send(%struct.demod_state* %0, i8* %3, i32 1, i32 3)
ret void
}