#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*/ err_quit(char *, char, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
void pr_feature(char *feature, char fmt, long value) {
  switch (fmt) {
  case 'n':
    printf("%s is defined\n", feature);
    break;
  case 'd':
    printf("%s is defined: %d\n", feature, (int)value);
    break;
  case 'l':
    printf("%s is defined: %ldL\n", feature, (long)value);
    break;
  default:
    err_quit("Unknown format: %c for feature test macro: %s\n", fmt, feature);
  }
}


x86 assembly (clang, -O0):
<pr_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x64,%eax
je     1184 <pr_feature+0x64>
jmp    114b <pr_feature+0x2b>
mov    -0x1c(%rbp),%eax
sub    $0x6c,%eax
je     11a1 <pr_feature+0x81>
jmp    115c <pr_feature+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
jne    11bc <pr_feature+0x9c>
jmp    116d <pr_feature+0x4d>
mov    -0x8(%rbp),%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <pr_feature+0xb2>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <pr_feature+0xb2>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <pr_feature+0xb2>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rdx
lea    0xe6d(%rip),%rdi
movsbl %al,%esi
call   1040 <err_quit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_feature>:
mov    %rdi,%rax
cmp    $0x64,%esi
je     1143 <pr_feature+0x23>
cmp    $0x6c,%esi
je     1154 <pr_feature+0x34>
cmp    $0x6e,%esi
jne    1165 <pr_feature+0x45>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>
movsbl %sil,%esi
lea    0xec7(%rip),%rdi
mov    %rax,%rdx
jmp    1040 <err_quit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s is defined\0A\00"
@.str.1 = [19 x i8] c"%s is defined: %d\0A\00"
@.str.2 = [21 x i8] c"%s is defined: %ldL\0A\00"
@.str.3 = [47 x i8] c"Unknown format: %c for feature test macro: %s\0A\00"
define void @pr_feature(i8* %0, i8 signext %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i64
store i8* %0, i8** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %21 [
i32 110, label %9
i32 100, label %12
i32 108, label %17
]
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %25
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i64, i64* %6
%15 = trunc i64 %14 to i32
%16 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15)
br label %25
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = load i64, i64* %6
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %18, i64 %19)
br label %25
21: ; preds = %3
%22 = load i8, i8* %5
%23 = load i8*, i8** %4
%24 = call i32 @err_quit(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8 signext %22, i8* %23)
br label %25
25: ; preds = %21, %17, %12, %9
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s is defined\0A\00"
@.str.1 = [19 x i8] c"%s is defined: %d\0A\00"
@.str.2 = [21 x i8] c"%s is defined: %ldL\0A\00"
@.str.3 = [47 x i8] c"Unknown format: %c for feature test macro: %s\0A\00"
define void @pr_feature(i8* %0, i8 signext %1, i64 %2) {
%4 = sext i8 %1 to i32
switch i32 %4, label %12 [
i32 110, label %5
i32 100, label %7
i32 108, label %10
]
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %14
7: ; preds = %3
%8 = trunc i64 %2 to i32
%9 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %8)
br label %14
10: ; preds = %3
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %0, i64 %2)
br label %14
12: ; preds = %3
%13 = tail call i32 @err_quit(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8 signext %1, i8* %0)
br label %14
14: ; preds = %12, %10, %7, %5
ret void
}