#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 */
struct printf_info {
  int dummy;
};
struct __printf_io {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __printf_flush(struct __printf_io *);
int __printf_out(struct __printf_io *, struct printf_info const *,
                 unsigned char *, int);
int __printf_render_chr(struct __printf_io *io, const struct printf_info *pi,
                        const void *const *arg) {
  int i;
  unsigned char c;
  i = *((int *)arg[0]);
  c = i;
  i = __printf_out(io, pi, &c, 1);
  __printf_flush(io);
  return (i);
}


x86 assembly (clang, -O0):
<__printf_render_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1d(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <__printf_out@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__printf_flush@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__printf_render_chr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdx),%rax
mov    (%rax),%al
mov    %al,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <__printf_out@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <__printf_flush@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.__printf_io = type { i32 }
%struct.printf_info = type { i32 }
define i32 @__printf_render_chr(%struct.__printf_io* %0, %struct.printf_info* %1, i8** %2) {
%4 = alloca %struct.__printf_io*
%5 = alloca %struct.printf_info*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8
store %struct.__printf_io* %0, %struct.__printf_io** %4
store %struct.printf_info* %1, %struct.printf_info** %5
store i8** %2, i8*** %6
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load %struct.__printf_io*, %struct.__printf_io** %4
%17 = load %struct.printf_info*, %struct.printf_info** %5
%18 = call i32 @__printf_out(%struct.__printf_io* %16, %struct.printf_info* %17, i8* %8, i32 1)
store i32 %18, i32* %7
%19 = load %struct.__printf_io*, %struct.__printf_io** %4
%20 = call i32 @__printf_flush(%struct.__printf_io* %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
%struct.__printf_io = type { i32 }
%struct.printf_info = type { i32 }
define i32 @__printf_render_chr(%struct.__printf_io* %0, %struct.printf_info* %1, i8** nocapture %2) {
%4 = alloca i8
%5 = bitcast i8** %2 to i32**
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = call i32 @__printf_out(%struct.__printf_io* %0, %struct.printf_info* %1, i8* %4, i32 1)
%10 = call i32 @__printf_flush(%struct.__printf_io* %0)
ret i32 %9
}