#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 *);
int /*<<< orphan*/ utoa(char *, unsigned int, char);
int main(int argc, char *argv[]) {
  unsigned int u;
  char str[128];
  u = 0xffffffff;
  utoa(str, u, 'u');
  printf("%s\n", str);
  utoa(str, u, 'o');
  printf("%s\n", str);
  utoa(str, u, 'x');
  printf("%s\n", str);
  utoa(str, u, 'X');
  printf("%s\n", str);
  u = 0x6789abcd;
  utoa(str, u, 'u');
  printf("%s\n", str);
  utoa(str, u, 'o');
  printf("%s\n", str);
  utoa(str, u, 'x');
  printf("%s\n", str);
  utoa(str, u, 'X');
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x75,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x6f,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x78,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x58,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
movl   $0x6789abcd,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x75,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x6f,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x78,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdad(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x58,%edx
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xd86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x75,%edx
call   1040 <utoa@plt>
lea    0xeba(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x6f,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x78,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x58,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6789abcd,%esi
mov    $0x75,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6789abcd,%esi
mov    $0x6f,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6789abcd,%esi
mov    $0x78,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6789abcd,%esi
mov    $0x58,%edx
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @utoa(i8* %8, i32 %9, i8 signext 117)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %6
%15 = call i32 @utoa(i8* %13, i32 %14, i8 signext 111)
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%19 = load i32, i32* %6
%20 = call i32 @utoa(i8* %18, i32 %19, i8 signext 120)
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%24 = load i32, i32* %6
%25 = call i32 @utoa(i8* %23, i32 %24, i8 signext 88)
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 1737075661, i32* %6
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%29 = load i32, i32* %6
%30 = call i32 @utoa(i8* %28, i32 %29, i8 signext 117)
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%34 = load i32, i32* %6
%35 = call i32 @utoa(i8* %33, i32 %34, i8 signext 111)
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%39 = load i32, i32* %6
%40 = call i32 @utoa(i8* %38, i32 %39, i8 signext 120)
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %41)
%43 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%44 = load i32, i32* %6
%45 = call i32 @utoa(i8* %43, i32 %44, i8 signext 88)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @utoa(i8* %4, i32 -1, i8 signext 117)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @utoa(i8* %4, i32 -1, i8 signext 111)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%9 = call i32 @utoa(i8* %4, i32 -1, i8 signext 120)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i32 @utoa(i8* %4, i32 -1, i8 signext 88)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%13 = call i32 @utoa(i8* %4, i32 1737075661, i8 signext 117)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%15 = call i32 @utoa(i8* %4, i32 1737075661, i8 signext 111)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%17 = call i32 @utoa(i8* %4, i32 1737075661, i8 signext 120)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%19 = call i32 @utoa(i8* %4, i32 1737075661, i8 signext 88)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}