#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 *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
size_t strcmpany(char *, char *);
scalar_t__ strpbrk(char *, char *);
main() {
  printf("hex dec\n");
  for (int i = 10; i < 100; i++) {
    char buf[2][4];
    snprintf(buf[0], sizeof buf[0], "%x", i);
    if (strpbrk(buf[0], "abcdef"))
      continue;
    snprintf(buf[1], sizeof buf[1], "%d", i);
    printf("%c %s %s\n", "-#"[strcmpany(buf[0], buf[1])], buf[0], buf[1]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1208 <main+0xc8>
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x4,%esi
lea    0xe88(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x10(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1060 <strpbrk@plt>
cmp    $0x0,%rax
je     11a5 <main+0x65>
jmp    11fa <main+0xba>
lea    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%ecx
mov    $0x4,%esi
lea    0xe57(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1050 <strcmpany@plt>
mov    %rax,%rcx
lea    0xe44(%rip),%rax
movsbl (%rax,%rcx,1),%esi
lea    -0x10(%rbp),%rdx
lea    -0x10(%rbp),%rcx
add    $0x4,%rcx
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%ebx
lea    0x4(%rsp),%r14
lea    0xe88(%rip),%r15
mov    %rsp,%r12
lea    0xe81(%rip),%r13
lea    0xe84(%rip),%rbp
jmp    1198 <main+0x48>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     11f8 <main+0xa8>
mov    %r12,%rdi
mov    $0x4,%esi
mov    %r15,%rdx
mov    %ebx,%ecx
call   1050 <snprintf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <strpbrk@plt>
test   %rax,%rax
jne    1190 <main+0x40>
mov    %r14,%rdi
mov    $0x4,%esi
lea    0xe41(%rip),%rdx
mov    %ebx,%ecx
call   1050 <snprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1060 <strcmpany@plt>
lea    0xe35(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
mov    %rbp,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"hex dec\0A\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [7 x i8] c"abcdef\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [10 x i8] c"%c %s %s\0A\00"
@.str.5 = [3 x i8] c"-#\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x [4 x i8]]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 10, i32* %2
br label %5
5: ; preds = %36, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %39
8: ; preds = %5
%9 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @snprintf(i8* %10, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 0
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 0
%15 = call i64 @strpbrk(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %8
br label %36
18: ; preds = %8
%19 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 1
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 0
%21 = load i32, i32* %2
%22 = call i32 @snprintf(i8* %20, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 0
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 0
%25 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 1
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 0
%27 = call i64 @strcmpany(i8* %24, i8* %26)
%28 = getelementptr inbounds [3 x i8], [3 x i8]* @.str.5, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 0
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %31, i64 0, i64 0
%33 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %3, i64 0, i64 1
%34 = getelementptr inbounds [4 x i8], [4 x i8]* %33, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %30, i8* %32, i8* %34)
br label %36
36: ; preds = %18, %17
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %5
39: ; preds = %5
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [7 x i8] c"abcdef\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [10 x i8] c"%c %s %s\0A\00"
@.str.5 = [3 x i8] c"-#\00"
@str = [8 x i8] c"hex dec\00"
define i32 @main() {
%1 = alloca [2 x [4 x i8]]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [2 x [4 x i8]], [2 x [4 x i8]]* %1, i64 0, i64 1, i64 0
br label %6
5: ; preds = %18
ret i32 0
6: ; preds = %0, %18
%7 = phi i32 [ 10, %0 ], [ %19, %18 ]
%8 = call i32 @snprintf(i8* %3, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i64 @strpbrk(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = call i32 @snprintf(i8* %4, i32 4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%13 = call i64 @strcmpany(i8* %3, i8* %4)
%14 = getelementptr inbounds [3 x i8], [3 x i8]* @.str.5, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %16, i8* %3, i8* %4)
br label %18
18: ; preds = %6, %11
%19 = add nuw nsw i32 %7, 1
%20 = icmp eq i32 %19, 100
br i1 %20, label %5, label %6
}