#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 *escape(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("{");
  char *k = NULL;
  for (int i = 1; i < argc; ++i) {
    if (k == NULL) {
      k = argv[i];
      continue;
    }
    printf("\"%s\": \"%s\",", k, escape(argv[i]));
    k = NULL;
  }
  printf("}");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c3 <main+0xa3>
cmpq   $0x0,-0x18(%rbp)
jne    117f <main+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    11b5 <main+0x95>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <escape@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <main+0x33>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebx
mov    $0x7b,%edi
call   1030 <putchar@plt>
cmp    $0x2,%ebx
jl     119e <main+0x6e>
mov    %ebx,%r12d
mov    $0x1,%ebx
lea    0xea4(%rip),%r14
xor    %r13d,%r13d
jmp    117c <main+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %rdi,%r13
cmp    %rbx,%r12
je     119e <main+0x6e>
mov    (%r15,%rbx,8),%rdi
test   %r13,%r13
je     1170 <main+0x40>
call   1050 <escape@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
jmp    1170 <main+0x40>
mov    $0x7d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str.1 = [12 x i8] c"\22%s\22: \22%s\22,\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @putchar(i32 123)
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %18, %2
%8 = tail call i32 @putchar(i32 125)
ret i32 0
9: ; preds = %5, %18
%10 = phi i64 [ 1, %5 ], [ %20, %18 ]
%11 = phi i8* [ null, %5 ], [ %19, %18 ]
%12 = icmp eq i8* %11, null
%13 = getelementptr inbounds i8*, i8** %1, i64 %10
%14 = load i8*, i8** %13
br i1 %12, label %18, label %15
15: ; preds = %9
%16 = tail call i8* @escape(i8* %14)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %16)
br label %18
18: ; preds = %9, %15
%19 = phi i8* [ null, %15 ], [ %14, %9 ]
%20 = add nuw nsw i64 %10, 1
%21 = icmp eq i64 %20, %6
br i1 %21, label %7, label %9
}