#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*/ hamming(char, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int /*<<< orphan*/ string_of_byte(char *, char);
void print_test(char in) {
  char out[2];
  char buff[3][10];
  hamming(in, out);
  string_of_byte(buff[0], in);
  string_of_byte(buff[1], out[0]);
  string_of_byte(buff[2], out[1]);
  printf("in = %s out = %s %s\n", buff[0], buff[1], buff[2]);
}


x86 assembly (clang, -O0):
<print_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
lea    -0x3(%rbp),%rsi
movsbl %al,%edi
call   1040 <hamming@plt>
lea    -0x30(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1050 <string_of_byte@plt>
lea    -0x30(%rbp),%rdi
add    $0xa,%rdi
movsbl -0x3(%rbp),%esi
call   1050 <string_of_byte@plt>
lea    -0x30(%rbp),%rdi
add    $0x14,%rdi
movsbl -0x2(%rbp),%esi
call   1050 <string_of_byte@plt>
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0xa,%rdx
lea    -0x30(%rbp),%rcx
add    $0x14,%rcx
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_test>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %edi,%ebx
lea    0xe(%rsp),%rsi
call   1040 <hamming@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <string_of_byte@plt>
lea    0x1a(%rsp),%r15
movsbl 0xe(%rsp),%esi
mov    %r15,%rdi
call   1050 <string_of_byte@plt>
lea    0x24(%rsp),%rbx
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1050 <string_of_byte@plt>
lea    0xe81(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"in = %s out = %s %s\0A\00"
define void @print_test(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
%4 = alloca [3 x [10 x i8]]
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%7 = call i32 @hamming(i8 signext %5, i8* %6)
%8 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %2
%11 = call i32 @string_of_byte(i8* %9, i8 signext %10)
%12 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 1
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%15 = load i8, i8* %14
%16 = call i32 @string_of_byte(i8* %13, i8 signext %15)
%17 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 2
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %17, i64 0, i64 0
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%20 = load i8, i8* %19
%21 = call i32 @string_of_byte(i8* %18, i8 signext %20)
%22 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 0
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %22, i64 0, i64 0
%24 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 1
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %24, i64 0, i64 0
%26 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %4, i64 0, i64 2
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %25, i8* %27)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"in = %s out = %s %s\0A\00"
define void @print_test(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = alloca [3 x [10 x i8]]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 0, i64 0
%6 = call i32 @hamming(i8 signext %0, i8* %4)
%7 = call i32 @string_of_byte(i8* %5, i8 signext %0)
%8 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 1, i64 0
%9 = load i8, i8* %4
%10 = call i32 @string_of_byte(i8* %8, i8 signext %9)
%11 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 2, i64 0
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%13 = load i8, i8* %12
%14 = call i32 @string_of_byte(i8* %11, i8 signext %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8, i8* %11)
ret void
}