#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*/ printf(char *, char);
void check_char(unsigned char x, signed char y) {
  printf("%c", y);
  printf("%hhu", x);
  printf("%hhi", y);
  printf("%hhi", x);
  printf("%c", x);
  printf("%hhu", y);
}


x86 assembly (clang, -O0):
<check_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    0xed5(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_char>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xedd(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl %bpl,%ebp
lea    0xecd(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xec1(%rip),%r12
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [5 x i8] c"%hhu\00"
@.str.2 = [5 x i8] c"%hhi\00"
define void @check_char(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %7)
%9 = load i8, i8* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %9)
%11 = load i8, i8* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %11)
%13 = load i8, i8* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = load i8, i8* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [5 x i8] c"%hhu\00"
@.str.2 = [5 x i8] c"%hhi\00"
define void @check_char(i8 zeroext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 signext %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %1)
ret void
}