#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 *dupstr(char *);
int /*<<< orphan*/ free(char *const);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
char *strchr(char *, char);
void show_configuration(int argc, char **argv) {
  puts("[configuration]");
  printf("    SHOW_C_TYPES_VERSION = %s\n", "2021-08-01");
  if (argc > 1) {
    int i;
    for (i = 1; i < argc; i++) {
      char *ptr_equals = strchr(argv[i], '=');
      if (ptr_equals == NULL) {
        printf("    arg-%d = %s\n", i, argv[i]);
      } else {
        char *const arg = dupstr(argv[i]);
        char *key;
        char *value;
        ptr_equals = arg + (ptr_equals - argv[i]);
        *ptr_equals = '\0';
        key = arg;
        value = ptr_equals + 1;
        printf("    %s = %s\n", key, value);
        free(arg);
      }
    }
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<show_configuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8e(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1279 <show_configuration+0x119>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1274 <show_configuration+0x114>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11f4 <show_configuration+0x94>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1261 <show_configuration+0x101>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <dupstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rsi
mov    (%rdx,%rsi,8),%rdx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    1266 <show_configuration+0x106>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a1 <show_configuration+0x41>
jmp    1279 <show_configuration+0x119>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_configuration>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xe89(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8d(%rip),%rdi
lea    0xea5(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
cmp    $0x2,%ebx
jl     1217 <show_configuration+0xb7>
mov    %ebx,%r15d
mov    $0x1,%ebx
lea    0xea2(%rip),%r12
jmp    11ec <show_configuration+0x8c>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbp
mov    %r13,%rdi
call   1080 <dupstr@plt>
mov    %rax,%r13
sub    (%r14,%rbx,8),%rbp
movb   $0x0,(%rax,%rbp,1)
lea    (%rax,%rbp,1),%rdx
add    $0x1,%rdx
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     1217 <show_configuration+0xb7>
mov    (%r14,%rbx,8),%r13
mov    %r13,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
jne    11b0 <show_configuration+0x50>
lea    0xe31(%rip),%rdi
mov    %ebx,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    11e3 <show_configuration+0x83>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"[configuration]\00"
@.str.1 = [31 x i8] c" SHOW_C_TYPES_VERSION = %s\0A\00"
@.str.2 = [11 x i8] c"2021-08-01\00"
@.str.3 = [17 x i8] c" arg-%d = %s\0A\00"
@.str.4 = [13 x i8] c" %s = %s\0A\00"
define void @show_configuration(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %68
14: ; preds = %2
store i32 1, i32* %5
br label %15
15: ; preds = %64, %14
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %67
19: ; preds = %15
%20 = load i8**, i8*** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i8* @strchr(i8* %24, i8 signext 61)
store i8* %25, i8** %6
%26 = load i8*, i8** %6
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %36
28: ; preds = %19
%29 = load i32, i32* %5
%30 = load i8**, i8*** %4
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %29, i8* %34)
br label %63
36: ; preds = %19
%37 = load i8**, i8*** %4
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i8* @dupstr(i8* %41)
store i8* %42, i8** %7
%43 = load i8*, i8** %7
%44 = load i8*, i8** %6
%45 = load i8**, i8*** %4
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
%50 = ptrtoint i8* %44 to i64
%51 = ptrtoint i8* %49 to i64
%52 = sub i64 %50, %51
%53 = getelementptr inbounds i8, i8* %43, i64 %52
store i8* %53, i8** %6
%54 = load i8*, i8** %6
store i8 0, i8* %54
%55 = load i8*, i8** %7
store i8* %55, i8** %8
%56 = load i8*, i8** %6
%57 = getelementptr inbounds i8, i8* %56, i64 1
store i8* %57, i8** %9
%58 = load i8*, i8** %8
%59 = load i8*, i8** %9
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %58, i8* %59)
%61 = load i8*, i8** %7
%62 = call i32 @free(i8* %61)
br label %63
63: ; preds = %36, %28
br label %64
64: ; preds = %63
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 1
store i32 %66, i32* %5
br label %15
67: ; preds = %15
br label %68
68: ; preds = %67, %2
%69 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"[configuration]\00"
@.str.1 = [31 x i8] c" SHOW_C_TYPES_VERSION = %s\0A\00"
@.str.2 = [11 x i8] c"2021-08-01\00"
@.str.3 = [17 x i8] c" arg-%d = %s\0A\00"
@.str.4 = [13 x i8] c" %s = %s\0A\00"
define void @show_configuration(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %30
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %27
%9 = phi i64 [ 1, %6 ], [ %28, %27 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i8* @strchr(i8* dereferenceable(1) %11, i8 signext 61)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = trunc i64 %9 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %15, i8* %11)
br label %27
17: ; preds = %8
%18 = tail call i8* @dupstr(i8* %11)
%19 = load i8*, i8** %10
%20 = ptrtoint i8* %12 to i64
%21 = ptrtoint i8* %19 to i64
%22 = sub i64 %20, %21
%23 = getelementptr inbounds i8, i8* %18, i64 %22
store i8 0, i8* %23
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %18, i8* %24)
%26 = tail call i32 @free(i8* %18)
br label %27
27: ; preds = %17, %14
%28 = add nuw nsw i64 %9, 1
%29 = icmp eq i64 %28, %7
br i1 %29, label %30, label %8
30: ; preds = %27, %2
%31 = tail call i32 @putchar(i8 signext 10)
ret void
}