#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 hx2262_send(char *, int);
uint8_t hx2262_elroab440_send(char *code, bool state, uint8_t repeat) {
  uint8_t i;
  char buf[12];
  for (i = 0; i < 10; i++) {
    if (code[i] == '0') {
      buf[i] = 'f';
    } else if (code[i] == '1') {
      buf[i] = '0';
    } else {
      return 1;
    }
  }
  if (!state) {
    buf[10] = '0';
    buf[11] = '0';
  } else {
    buf[10] = '0';
    buf[11] = 'f';
  }
  return hx2262_send(buf, repeat);
}


x86 assembly (clang, -O0):
<hx2262_elroab440_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    119d <hx2262_elroab440_send+0x8d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    1156 <hx2262_elroab440_send+0x46>
movslq -0x1c(%rbp),%rax
movb   $0x66,-0x28(%rbp,%rax,1)
jmp    118a <hx2262_elroab440_send+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    1179 <hx2262_elroab440_send+0x69>
movslq -0x1c(%rbp),%rax
movb   $0x30,-0x28(%rbp,%rax,1)
jmp    1185 <hx2262_elroab440_send+0x75>
movl   $0x1,-0x4(%rbp)
jmp    11cb <hx2262_elroab440_send+0xbb>
jmp    118a <hx2262_elroab440_send+0x7a>
jmp    118f <hx2262_elroab440_send+0x7f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <hx2262_elroab440_send+0x19>
cmpl   $0x0,-0x14(%rbp)
jne    11b4 <hx2262_elroab440_send+0xa4>
movb   $0x30,-0x1e(%rbp)
movb   $0x30,-0x1d(%rbp)
jmp    11bc <hx2262_elroab440_send+0xac>
movb   $0x30,-0x1e(%rbp)
movb   $0x66,-0x1d(%rbp)
lea    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <hx2262_send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hx2262_elroab440_send>:
sub    $0x18,%rsp
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x30,%cl
je     112d <hx2262_elroab440_send+0x1d>
cmp    $0x31,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x30,%cl
jmp    112f <hx2262_elroab440_send+0x1f>
mov    $0x66,%cl
mov    %cl,0xc(%rsp)
mov    0x1(%rdi),%cl
mov    $0x30,%r8b
mov    $0x30,%r9b
cmp    $0x31,%cl
je     114d <hx2262_elroab440_send+0x3d>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r9b
mov    %r9b,0xd(%rsp)
mov    0x2(%rdi),%cl
cmp    $0x31,%cl
je     1166 <hx2262_elroab440_send+0x56>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r8b
mov    %r8b,0xe(%rsp)
mov    0x3(%rdi),%cl
mov    $0x30,%r8b
mov    $0x30,%r9b
cmp    $0x31,%cl
je     1185 <hx2262_elroab440_send+0x75>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r9b
mov    %r9b,0xf(%rsp)
mov    0x4(%rdi),%cl
cmp    $0x31,%cl
je     119e <hx2262_elroab440_send+0x8e>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r8b
mov    %r8b,0x10(%rsp)
mov    0x5(%rdi),%cl
mov    $0x30,%r8b
mov    $0x30,%r9b
cmp    $0x31,%cl
je     11bd <hx2262_elroab440_send+0xad>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r9b
mov    %r9b,0x11(%rsp)
mov    0x6(%rdi),%cl
cmp    $0x31,%cl
je     11d2 <hx2262_elroab440_send+0xc2>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r8b
mov    %r8b,0x12(%rsp)
mov    0x7(%rdi),%cl
mov    $0x30,%r8b
mov    $0x30,%r9b
cmp    $0x31,%cl
je     11ed <hx2262_elroab440_send+0xdd>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r9b
mov    %r9b,0x13(%rsp)
mov    0x8(%rdi),%cl
cmp    $0x31,%cl
je     1202 <hx2262_elroab440_send+0xf2>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%r8b
mov    %r8b,0x14(%rsp)
mov    0x9(%rdi),%cl
cmp    $0x31,%cl
je     1218 <hx2262_elroab440_send+0x108>
cmp    $0x30,%cl
jne    1242 <hx2262_elroab440_send+0x132>
mov    $0x66,%al
jmp    121a <hx2262_elroab440_send+0x10a>
mov    $0x30,%al
mov    %al,0x15(%rsp)
test   %esi,%esi
mov    $0x30,%eax
mov    $0x66,%ecx
cmove  %eax,%ecx
movb   $0x30,0x16(%rsp)
mov    %cl,0x17(%rsp)
lea    0xc(%rsp),%rdi
mov    %edx,%esi
call   1030 <hx2262_send@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @hx2262_elroab440_send(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [12 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %40, %3
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %43
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 48
br i1 %20, label %21, label %25
21: ; preds = %13
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 %23
store i8 102, i8* %24
br label %39
25: ; preds = %13
%26 = load i8*, i8** %5
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 49
br i1 %32, label %33, label %37
33: ; preds = %25
%34 = load i32, i32* %8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 %35
store i8 48, i8* %36
br label %38
37: ; preds = %25
store i32 1, i32* %4
br label %56
38: ; preds = %33
br label %39
39: ; preds = %38, %21
br label %40
40: ; preds = %39
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %10
43: ; preds = %10
%44 = load i32, i32* %6
%45 = icmp ne i32 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 10
store i8 48, i8* %47
%48 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 11
store i8 48, i8* %48
br label %52
49: ; preds = %43
%50 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 10
store i8 48, i8* %50
%51 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 11
store i8 102, i8* %51
br label %52
52: ; preds = %49, %46
%53 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%54 = load i32, i32* %7
%55 = call i32 @hx2262_send(i8* %53, i32 %54)
store i32 %55, i32* %4
br label %56
56: ; preds = %52, %37
%57 = load i32, i32* %4
ret i32 %57
}

LLVM IR (-O2):
define i32 @hx2262_elroab440_send(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%6 = load i8, i8* %0
switch i8 %6, label %69 [
i8 48, label %8
i8 49, label %7
]
7: ; preds = %3
br label %8
8: ; preds = %3, %7
%9 = phi i8 [ 48, %7 ], [ 102, %3 ]
store i8 %9, i8* %5
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
switch i8 %11, label %69 [
i8 48, label %12
i8 49, label %13
]
12: ; preds = %8
br label %13
13: ; preds = %8, %12
%14 = phi i8 [ 102, %12 ], [ 48, %8 ]
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 1
store i8 %14, i8* %15
%16 = getelementptr inbounds i8, i8* %0, i64 2
%17 = load i8, i8* %16
switch i8 %17, label %69 [
i8 48, label %18
i8 49, label %19
]
18: ; preds = %13
br label %19
19: ; preds = %13, %18
%20 = phi i8 [ 102, %18 ], [ 48, %13 ]
%21 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 2
store i8 %20, i8* %21
%22 = getelementptr inbounds i8, i8* %0, i64 3
%23 = load i8, i8* %22
switch i8 %23, label %69 [
i8 48, label %24
i8 49, label %25
]
24: ; preds = %19
br label %25
25: ; preds = %19, %24
%26 = phi i8 [ 102, %24 ], [ 48, %19 ]
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 3
store i8 %26, i8* %27
%28 = getelementptr inbounds i8, i8* %0, i64 4
%29 = load i8, i8* %28
switch i8 %29, label %69 [
i8 48, label %30
i8 49, label %31
]
30: ; preds = %25
br label %31
31: ; preds = %25, %30
%32 = phi i8 [ 102, %30 ], [ 48, %25 ]
%33 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 4
store i8 %32, i8* %33
%34 = getelementptr inbounds i8, i8* %0, i64 5
%35 = load i8, i8* %34
switch i8 %35, label %69 [
i8 48, label %36
i8 49, label %37
]
36: ; preds = %31
br label %37
37: ; preds = %31, %36
%38 = phi i8 [ 102, %36 ], [ 48, %31 ]
%39 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 5
store i8 %38, i8* %39
%40 = getelementptr inbounds i8, i8* %0, i64 6
%41 = load i8, i8* %40
switch i8 %41, label %69 [
i8 48, label %42
i8 49, label %43
]
42: ; preds = %37
br label %43
43: ; preds = %37, %42
%44 = phi i8 [ 102, %42 ], [ 48, %37 ]
%45 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 6
store i8 %44, i8* %45
%46 = getelementptr inbounds i8, i8* %0, i64 7
%47 = load i8, i8* %46
switch i8 %47, label %69 [
i8 48, label %48
i8 49, label %49
]
48: ; preds = %43
br label %49
49: ; preds = %43, %48
%50 = phi i8 [ 102, %48 ], [ 48, %43 ]
%51 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 7
store i8 %50, i8* %51
%52 = getelementptr inbounds i8, i8* %0, i64 8
%53 = load i8, i8* %52
switch i8 %53, label %69 [
i8 48, label %54
i8 49, label %55
]
54: ; preds = %49
br label %55
55: ; preds = %49, %54
%56 = phi i8 [ 102, %54 ], [ 48, %49 ]
%57 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 8
store i8 %56, i8* %57
%58 = getelementptr inbounds i8, i8* %0, i64 9
%59 = load i8, i8* %58
switch i8 %59, label %69 [
i8 48, label %60
i8 49, label %61
]
60: ; preds = %55
br label %61
61: ; preds = %55, %60
%62 = phi i8 [ 102, %60 ], [ 48, %55 ]
%63 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 9
store i8 %62, i8* %63
%64 = icmp eq i32 %1, 0
%65 = select i1 %64, i8 48, i8 102
%66 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 10
store i8 48, i8* %66
%67 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 11
store i8 %65, i8* %67
%68 = call i32 @hx2262_send(i8* %5, i32 %2)
br label %69
69: ; preds = %3, %8, %13, %19, %25, %31, %37, %43, %49, %55, %61
%70 = phi i32 [ %68, %61 ], [ 1, %55 ], [ 1, %49 ], [ 1, %43 ], [ 1, %37 ], [ 1, %31 ], [ 1, %25 ], [ 1, %19 ], [ 1, %13 ], [ 1, %8 ], [ 1, %3 ]
ret i32 %70
}