#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*/ putchar(char const);
void put_int(unsigned int v) {
  static const char hexchars[] = "0123456789abcdef";
  putchar(hexchars[(v >> 28) & 0xf]);
  putchar(hexchars[(v >> 24) & 0xf]);
  putchar(hexchars[(v >> 20) & 0xf]);
  putchar(hexchars[(v >> 16) & 0xf]);
  putchar(hexchars[(v >> 12) & 0xf]);
  putchar(hexchars[(v >> 8) & 0xf]);
  putchar(hexchars[(v >> 4) & 0xf]);
  putchar(hexchars[(v >> 0) & 0xf]);
}


x86 assembly (clang, -O0):
<put_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1c,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xed1(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xeb4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x14,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe97(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe7a(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0xc,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe5d(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe40(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe23(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xe06(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    %edi,%r14d
mov    %r14,%rax
shr    $0x1c,%rax
lea    0xed8(%rip),%r15
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x18,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x14,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0xc,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x8,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <putchar@plt>
shr    $0x4,%ebx
and    $0xf,%ebx
movsbl (%rbx,%r15,1),%edi
call   1030 <putchar@plt>
and    $0xf,%r14d
movsbl (%r14,%r15,1),%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@put_int.hexchars = internal constant [17 x i8] c"0123456789abcdef\00"
define void @put_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 28
%5 = and i32 %4, 15
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = call i32 @putchar(i8 signext %8)
%10 = load i32, i32* %2
%11 = lshr i32 %10, 24
%12 = and i32 %11, 15
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @putchar(i8 signext %15)
%17 = load i32, i32* %2
%18 = lshr i32 %17, 20
%19 = and i32 %18, 15
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @putchar(i8 signext %22)
%24 = load i32, i32* %2
%25 = lshr i32 %24, 16
%26 = and i32 %25, 15
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = call i32 @putchar(i8 signext %29)
%31 = load i32, i32* %2
%32 = lshr i32 %31, 12
%33 = and i32 %32, 15
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = call i32 @putchar(i8 signext %36)
%38 = load i32, i32* %2
%39 = lshr i32 %38, 8
%40 = and i32 %39, 15
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = call i32 @putchar(i8 signext %43)
%45 = load i32, i32* %2
%46 = lshr i32 %45, 4
%47 = and i32 %46, 15
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = call i32 @putchar(i8 signext %50)
%52 = load i32, i32* %2
%53 = lshr i32 %52, 0
%54 = and i32 %53, 15
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = call i32 @putchar(i8 signext %57)
ret void
}

LLVM IR (-O2):
@put_int.hexchars = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define void @put_int(i32 %0) {
%2 = lshr i32 %0, 28
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @putchar(i8 signext %5)
%7 = lshr i32 %0, 24
%8 = and i32 %7, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putchar(i8 signext %11)
%13 = lshr i32 %0, 20
%14 = and i32 %13, 15
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = tail call i32 @putchar(i8 signext %17)
%19 = lshr i32 %0, 16
%20 = and i32 %19, 15
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = tail call i32 @putchar(i8 signext %23)
%25 = lshr i32 %0, 12
%26 = and i32 %25, 15
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = tail call i32 @putchar(i8 signext %29)
%31 = lshr i32 %0, 8
%32 = and i32 %31, 15
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = tail call i32 @putchar(i8 signext %35)
%37 = lshr i32 %0, 4
%38 = and i32 %37, 15
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = tail call i32 @putchar(i8 signext %41)
%43 = and i32 %0, 15
%44 = zext i32 %43 to i64
%45 = getelementptr inbounds [17 x i8], [17 x i8]* @put_int.hexchars, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = tail call i32 @putchar(i8 signext %46)
ret void
}