#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 */
char *gnu_get_libc_version();
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char const *);
int main(int argc, char *argv[]) {
  puts("#ifndef __CONFIG_DEF_H__");
  puts("#define __CONFIG_DEF_H__\n");
  const char *version = gnu_get_libc_version();
  if (version && strcmp("2.5", version) == 0) {
    puts("#define __LINUX_GLIBC25__");
    puts("#include <asm/unistd.h>\n");
  }
  puts("#endif /* __CONFIG_DEF_H__ */");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <gnu_get_libc_version@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a6 <main+0x76>
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a6 <main+0x76>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <gnu_get_libc_version@plt>
test   %rax,%rax
je     1181 <main+0x51>
lea    0xed7(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1181 <main+0x51>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"#ifndef __CONFIG_DEF_H__\00"
@.str.1 = [26 x i8] c"#define __CONFIG_DEF_H__\0A\00"
@.str.2 = [4 x i8] c"2.5\00"
@.str.3 = [26 x i8] c"#define __LINUX_GLIBC25__\00"
@.str.4 = [25 x i8] c"#include <asm/unistd.h>\0A\00"
@.str.5 = [30 x i8] c"#endif /* __CONFIG_DEF_H__ */\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i8* (...) @gnu_get_libc_version()
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %16, %12, %2
%20 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"#ifndef __CONFIG_DEF_H__\00"
@.str.1 = [26 x i8] c"#define __CONFIG_DEF_H__\0A\00"
@.str.2 = [4 x i8] c"2.5\00"
@.str.3 = [26 x i8] c"#define __LINUX_GLIBC25__\00"
@.str.4 = [25 x i8] c"#include <asm/unistd.h>\0A\00"
@.str.5 = [30 x i8] c"#endif /* __CONFIG_DEF_H__ */\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* (...) @gnu_get_libc_version()
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %10, %7, %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}