#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_bit(int);
int lsb_first(int);
int *malloc(int);
int /*<<< orphan*/ printf(char *);
void Airton(uint8_t power, uint8_t mode, uint8_t temperature,
            uint8_t flowControl) {
  uint8_t *raw = malloc(14 * sizeof(uint8_t));
  raw[13] = lsb_first(0x15 + power + mode + temperature + flowControl);
  raw[0] = 0xC4;
  raw[1] = 0xD3;
  raw[2] = 0x64;
  raw[3] = 0x80;
  raw[4] = 0x00;
  raw[5] = lsb_first(power);
  raw[6] = lsb_first(mode);
  raw[7] = lsb_first(temperature);
  raw[8] = lsb_first(flowControl);
  raw[9] = 0x00;
  raw[10] = 0x00;
  raw[11] = 0x00;
  raw[12] = 0x00;
  for (int i = 0; i <= 13; i++) {
    get_bit(raw[i]);
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<Airton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x38,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0x15,%edi
add    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
add    -0x10(%rbp),%edi
call   1060 <lsb_first@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x34(%rax)
mov    -0x18(%rbp),%rax
movl   $0xc4,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xd3,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x64,0x8(%rax)
mov    -0x18(%rbp),%rax
movl   $0x80,0xc(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x4(%rbp),%edi
call   1060 <lsb_first@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%edi
call   1060 <lsb_first@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%edi
call   1060 <lsb_first@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x10(%rbp),%edi
call   1060 <lsb_first@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x24(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x28(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x2c(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x30(%rax)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xd,-0x1c(%rbp)
jg     1260 <Airton+0x120>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <get_bit@plt>
lea    0xdb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    122c <Airton+0xec>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Airton>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%r13d
mov    %edi,%ebp
mov    $0x38,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0x0(%rbp,%r13,1),%eax
add    %r12d,%eax
lea    (%r15,%rax,1),%edi
add    $0x15,%edi
call   1060 <lsb_first@plt>
mov    %eax,%r14d
movaps 0xe7f(%rip),%xmm0
movups %xmm0,(%rbx)
movl   $0x0,0x10(%rbx)
mov    %ebp,%edi
call   1060 <lsb_first@plt>
mov    %eax,0x14(%rbx)
mov    %r13d,%edi
call   1060 <lsb_first@plt>
mov    %eax,0x18(%rbx)
mov    %r12d,%edi
call   1060 <lsb_first@plt>
mov    %eax,0x1c(%rbx)
mov    %r15d,%edi
call   1060 <lsb_first@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x1c(%rbx),%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r14d,%edi
call   1050 <get_bit@plt>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @Airton(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = call i32* @malloc(i32 56)
store i32* %11, i32** %9
%12 = load i32, i32* %5
%13 = add nsw i32 21, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
%20 = call i32 @lsb_first(i32 %19)
%21 = load i32*, i32** %9
%22 = getelementptr inbounds i32, i32* %21, i64 13
store i32 %20, i32* %22
%23 = load i32*, i32** %9
%24 = getelementptr inbounds i32, i32* %23, i64 0
store i32 196, i32* %24
%25 = load i32*, i32** %9
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 211, i32* %26
%27 = load i32*, i32** %9
%28 = getelementptr inbounds i32, i32* %27, i64 2
store i32 100, i32* %28
%29 = load i32*, i32** %9
%30 = getelementptr inbounds i32, i32* %29, i64 3
store i32 128, i32* %30
%31 = load i32*, i32** %9
%32 = getelementptr inbounds i32, i32* %31, i64 4
store i32 0, i32* %32
%33 = load i32, i32* %5
%34 = call i32 @lsb_first(i32 %33)
%35 = load i32*, i32** %9
%36 = getelementptr inbounds i32, i32* %35, i64 5
store i32 %34, i32* %36
%37 = load i32, i32* %6
%38 = call i32 @lsb_first(i32 %37)
%39 = load i32*, i32** %9
%40 = getelementptr inbounds i32, i32* %39, i64 6
store i32 %38, i32* %40
%41 = load i32, i32* %7
%42 = call i32 @lsb_first(i32 %41)
%43 = load i32*, i32** %9
%44 = getelementptr inbounds i32, i32* %43, i64 7
store i32 %42, i32* %44
%45 = load i32, i32* %8
%46 = call i32 @lsb_first(i32 %45)
%47 = load i32*, i32** %9
%48 = getelementptr inbounds i32, i32* %47, i64 8
store i32 %46, i32* %48
%49 = load i32*, i32** %9
%50 = getelementptr inbounds i32, i32* %49, i64 9
store i32 0, i32* %50
%51 = load i32*, i32** %9
%52 = getelementptr inbounds i32, i32* %51, i64 10
store i32 0, i32* %52
%53 = load i32*, i32** %9
%54 = getelementptr inbounds i32, i32* %53, i64 11
store i32 0, i32* %54
%55 = load i32*, i32** %9
%56 = getelementptr inbounds i32, i32* %55, i64 12
store i32 0, i32* %56
store i32 0, i32* %10
br label %57
57: ; preds = %68, %4
%58 = load i32, i32* %10
%59 = icmp sle i32 %58, 13
br i1 %59, label %60, label %71
60: ; preds = %57
%61 = load i32*, i32** %9
%62 = load i32, i32* %10
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
%65 = load i32, i32* %64
%66 = call i32 @get_bit(i32 %65)
%67 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %68
68: ; preds = %60
%69 = load i32, i32* %10
%70 = add nsw i32 %69, 1
store i32 %70, i32* %10
br label %57
71: ; preds = %57
ret void
}

LLVM IR (-O2):
define void @Airton(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @malloc(i32 56)
%6 = add nsw i32 %0, 21
%7 = add nsw i32 %6, %1
%8 = add nsw i32 %7, %2
%9 = add nsw i32 %8, %3
%10 = tail call i32 @lsb_first(i32 %9)
%11 = getelementptr inbounds i32, i32* %5, i64 1
%12 = getelementptr inbounds i32, i32* %5, i64 2
%13 = getelementptr inbounds i32, i32* %5, i64 3
%14 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 196, i32 211, i32 100, i32 128>, <4 x i32>* %14
%15 = getelementptr inbounds i32, i32* %5, i64 4
store i32 0, i32* %15
%16 = tail call i32 @lsb_first(i32 %0)
%17 = getelementptr inbounds i32, i32* %5, i64 5
store i32 %16, i32* %17
%18 = tail call i32 @lsb_first(i32 %1)
%19 = getelementptr inbounds i32, i32* %5, i64 6
store i32 %18, i32* %19
%20 = tail call i32 @lsb_first(i32 %2)
%21 = getelementptr inbounds i32, i32* %5, i64 7
store i32 %20, i32* %21
%22 = tail call i32 @lsb_first(i32 %3)
%23 = load i32, i32* %5
%24 = tail call i32 @get_bit(i32 %23)
%25 = tail call i32 @putchar(i32 32)
%26 = load i32, i32* %11
%27 = tail call i32 @get_bit(i32 %26)
%28 = tail call i32 @putchar(i32 32)
%29 = load i32, i32* %12
%30 = tail call i32 @get_bit(i32 %29)
%31 = tail call i32 @putchar(i32 32)
%32 = load i32, i32* %13
%33 = tail call i32 @get_bit(i32 %32)
%34 = tail call i32 @putchar(i32 32)
%35 = load i32, i32* %15
%36 = tail call i32 @get_bit(i32 %35)
%37 = tail call i32 @putchar(i32 32)
%38 = load i32, i32* %17
%39 = tail call i32 @get_bit(i32 %38)
%40 = tail call i32 @putchar(i32 32)
%41 = load i32, i32* %19
%42 = tail call i32 @get_bit(i32 %41)
%43 = tail call i32 @putchar(i32 32)
%44 = load i32, i32* %21
%45 = tail call i32 @get_bit(i32 %44)
%46 = tail call i32 @putchar(i32 32)
%47 = tail call i32 @get_bit(i32 %22)
%48 = tail call i32 @putchar(i32 32)
%49 = tail call i32 @get_bit(i32 0)
%50 = tail call i32 @putchar(i32 32)
%51 = tail call i32 @get_bit(i32 0)
%52 = tail call i32 @putchar(i32 32)
%53 = tail call i32 @get_bit(i32 0)
%54 = tail call i32 @putchar(i32 32)
%55 = tail call i32 @get_bit(i32 0)
%56 = tail call i32 @putchar(i32 32)
%57 = tail call i32 @get_bit(i32 %10)
%58 = tail call i32 @putchar(i32 32)
ret void
}