#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ schar_put(char, int /*<<< orphan*/ *);
void std_schar_put(const void *restrict self, const char *restrict format,
                   FILE *restrict stream) {
  (void)format;
  signed char number;
  if (!self)
    fputs("<"
          "signed char"
          " "
          "(NULL)"
          ">",
          stream);
  else {
    fputs("<"
          "signed char"
          " ",
          stream);
    number = *(const signed char *)self;
    if (number < 0) {
      fputc('-', stream);
      number = (signed char)-number;
    }
    schar_put(number, stream);
    fputc('>', stream);
  }
}


x86 assembly (clang, -O0):
<std_schar_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1164 <std_schar_put+0x34>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <fputs@plt>
jmp    11c0 <std_schar_put+0x90>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jge    11a3 <std_schar_put+0x73>
mov    -0x18(%rbp),%rsi
mov    $0x2d,%edi
call   1040 <fputc@plt>
movsbl -0x19(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1050 <schar_put@plt>
mov    -0x18(%rbp),%rsi
mov    $0x3e,%edi
call   1040 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_schar_put>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %rdi,%rdi
je     118c <std_schar_put+0x5c>
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
mov    (%rbx),%bl
test   %bl,%bl
jns    116d <std_schar_put+0x3d>
mov    $0x2d,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
neg    %bl
movsbl %bl,%edi
mov    %r14,%rsi
call   1040 <schar_put@plt>
mov    $0x3e,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>
lea    0xe6d(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"<signed char (NULL)>\00"
@.str.1 = [14 x i8] c"<signed char \00"
define void @std_schar_put(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32*, i32** %6
%13 = call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %12)
br label %35
14: ; preds = %3
%15 = load i32*, i32** %6
%16 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = sext i8 %19 to i32
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %14
%23 = load i32*, i32** %6
%24 = call i32 @fputc(i8 signext 45, i32* %23)
%25 = load i8, i8* %7
%26 = sext i8 %25 to i32
%27 = sub nsw i32 0, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
br label %29
29: ; preds = %22, %14
%30 = load i8, i8* %7
%31 = load i32*, i32** %6
%32 = call i32 @schar_put(i8 signext %30, i32* %31)
%33 = load i32*, i32** %6
%34 = call i32 @fputc(i8 signext 62, i32* %33)
br label %35
35: ; preds = %29, %11
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"<signed char (NULL)>\00"
@.str.1 = [14 x i8] c"<signed char \00"
define void @std_schar_put(i8* noalias %0, i8* noalias nocapture readnone %1, i32* noalias %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 20, i64 1, i32* %2)
br label %18
7: ; preds = %3
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 13, i64 1, i32* %2)
%9 = load i8, i8* %0
%10 = icmp slt i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = tail call i32 @fputc(i8 signext 45, i32* %2)
%13 = sub i8 0, %9
br label %14
14: ; preds = %11, %7
%15 = phi i8 [ %13, %11 ], [ %9, %7 ]
%16 = tail call i32 @schar_put(i8 signext %15, i32* %2)
%17 = tail call i32 @fputc(i8 signext 62, i32* %2)
br label %18
18: ; preds = %14, %5
ret void
}