#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 *, ...);
void print_char(int flags, int i, int twist) {
  if (flags & 0x40)
    printf("id(%d %d %d)", flags, i, twist);
  else if (flags & 0x20)
    printf("id(%d %d)", flags, i);
  else {
    if (flags & 0x04)
      printf("o");
    else if (flags & 0x8)
      printf("x");
    else if (flags & 0x10)
      printf("*");
    else if (flags & (0x01 | 0x02) && (i > 0))
      printf("%d", i);
    else
      printf("i");
  }
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     114c <print_char+0x3c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <print_char+0x120>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1174 <print_char+0x64>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <print_char+0x11b>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1196 <print_char+0x86>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1226 <print_char+0x116>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11b8 <print_char+0xa8>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1221 <print_char+0x111>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11da <print_char+0xca>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121c <print_char+0x10c>
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1209 <print_char+0xf9>
cmpl   $0x0,-0x8(%rbp)
jle    1209 <print_char+0xf9>
mov    -0x8(%rbp),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1217 <print_char+0x107>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121c <print_char+0x10c>
jmp    1221 <print_char+0x111>
jmp    1226 <print_char+0x116>
jmp    122b <print_char+0x11b>
jmp    1230 <print_char+0x120>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
test   $0x40,%sil
jne    115e <print_char+0x3e>
test   $0x20,%sil
jne    116c <print_char+0x4c>
test   $0x4,%sil
jne    117a <print_char+0x5a>
test   $0x8,%sil
jne    1184 <print_char+0x64>
test   $0x10,%sil
jne    118e <print_char+0x6e>
test   $0x3,%sil
je     1198 <print_char+0x78>
test   %edx,%edx
jle    1198 <print_char+0x78>
lea    0xec2(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
mov    $0x6f,%edi
jmp    1030 <putchar@plt>
mov    $0x78,%edi
jmp    1030 <putchar@plt>
mov    $0x2a,%edi
jmp    1030 <putchar@plt>
mov    $0x69,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"id(%d %d %d)\00"
@.str.1 = [10 x i8] c"id(%d %d)\00"
@.str.2 = [2 x i8] c"o\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [2 x i8] c"i\00"
define void @print_char(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 64
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
br label %58
15: ; preds = %3
%16 = load i32, i32* %4
%17 = and i32 %16, 32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
br label %57
23: ; preds = %15
%24 = load i32, i32* %4
%25 = and i32 %24, 4
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %56
29: ; preds = %23
%30 = load i32, i32* %4
%31 = and i32 %30, 8
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %55
35: ; preds = %29
%36 = load i32, i32* %4
%37 = and i32 %36, 16
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %54
41: ; preds = %35
%42 = load i32, i32* %4
%43 = and i32 %42, 3
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i32, i32* %5
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32, i32* %5
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %53
51: ; preds = %45, %41
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
br label %54
54: ; preds = %53, %39
br label %55
55: ; preds = %54, %33
br label %56
56: ; preds = %55, %27
br label %57
57: ; preds = %56, %19
br label %58
58: ; preds = %57, %10
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"id(%d %d %d)\00"
@.str.1 = [10 x i8] c"id(%d %d)\00"
@.str.5 = [3 x i8] c"%d\00"
define void @print_char(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 64
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %37
8: ; preds = %3
%9 = and i32 %0, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %37
13: ; preds = %8
%14 = and i32 %0, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @putchar(i32 111)
br label %37
18: ; preds = %13
%19 = and i32 %0, 8
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = tail call i32 @putchar(i32 120)
br label %37
23: ; preds = %18
%24 = and i32 %0, 16
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 @putchar(i32 42)
br label %37
28: ; preds = %23
%29 = and i32 %0, 3
%30 = icmp ne i32 %29, 0
%31 = icmp sgt i32 %1, 0
%32 = and i1 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %1)
br label %37
35: ; preds = %28
%36 = tail call i32 @putchar(i32 105)
br label %37
37: ; preds = %11, %21, %33, %35, %26, %16, %6
ret void
}