#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 temparg;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, char *, char *);
int sconv(char *, int /*<<< orphan*/, int);
char *sprint_binary(int);
int /*<<< orphan*/ strcpy(char *, char *);
void show_bases(char *line, int mode) {
  char buf[20];
  int temparg = sconv(line, 0, mode);
  strcpy(buf, sprint_binary((((temparg) >> 8) & 0xff)));
  printf("\n %17x x\n %17d d\n %17o o\n %s %s b\n\n", temparg, temparg, temparg,
         buf, sprint_binary(((temparg)&0xff)));
}


x86 assembly (clang, -O0):
<show_bases>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1050 <sconv@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1060 <sprint_binary@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%edi
and    $0xff,%edi
call   1060 <sprint_binary@plt>
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    %rax,%r9
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_bases>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%edx
xor    %esi,%esi
call   1050 <sconv@plt>
mov    %eax,%ebx
movzbl %bh,%edi
call   1060 <sprint_binary@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
movzbl %bl,%edi
call   1060 <sprint_binary@plt>
lea    0xe89(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
mov    %r14,%r8
mov    %rax,%r9
call   1040 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0A %17x x\0A %17d d\0A %17o o\0A %s %s b\0A\0A\00"
define void @show_bases(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sconv(i8* %7, i32 0, i32 %8)
store i32 %9, i32* %6
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* %6
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = call i8* @sprint_binary(i32 %13)
%15 = call i32 @strcpy(i8* %10, i8* %14)
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%20 = load i32, i32* %6
%21 = and i32 %20, 255
%22 = call i8* @sprint_binary(i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i8* %19, i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A %17x x\0A %17d d\0A %17o o\0A %s %s b\0A\0A\00"
define void @show_bases(i8* %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @sconv(i8* %0, i32 0, i32 %1)
%6 = lshr i32 %5, 8
%7 = and i32 %6, 255
%8 = tail call i8* @sprint_binary(i32 %7)
%9 = call i32 @strcpy(i8* %4, i8* %8)
%10 = and i32 %5, 255
%11 = call i8* @sprint_binary(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5, i32 %5, i8* %4, i8* %11)
ret void
}