#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 dump(int n, const char **x, const char **w) {
  int i;
  for (i = 0; i < (n + 1) / 2; i++) {
    printf("\t{ \"gl%d_%d_x\", \"GL%d_%d_X\", \"%s\" },\n", n, i, n, i, x[i],
           w[i]);
    printf("\t{ \"gl%d_%d_w\", \"GL%d_%d_W\", \"%s\" },\n", n, i, n, i, w[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    11b7 <dump+0xa7>
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rdi
mov    (%rax,%rdi,8),%r9
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
lea    0xe89(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rdi
mov    (%rax,%rdi,8),%r9
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <dump+0x1a>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1193 <dump+0x73>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x1(%rbx),%r12d
shr    %r12d
lea    0xee1(%rip),%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%r9
mov    (%r15,%rbp,8),%rax
mov    %rax,(%rsp)
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbp,8),%r9
mov    %r13,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1150 <dump+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\09{ \22gl%d_%d_x\22, \22GL%d_%d_X\22, \22%s\22 },\0A\00"
@.str.1 = [38 x i8] c"\09{ \22gl%d_%d_w\22, \22GL%d_%d_W\22, \22%s\22 },\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dump(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 0, i32* %7
br label %8
8: ; preds = %40, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %11, 2
%13 = icmp slt i32 %9, %12
br i1 %13, label %14, label %43
14: ; preds = %8
%15 = load i32, i32* %4
%16 = load i32, i32* %7
%17 = load i32, i32* %4
%18 = load i32, i32* %7
%19 = load i8**, i8*** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %6
%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 i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i8* %23, i8* %28)
%30 = load i32, i32* %4
%31 = load i32, i32* %7
%32 = load i32, i32* %4
%33 = load i32, i32* %7
%34 = load i8**, i8*** %6
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31, i32 %32, i32 %33, i8* %38)
br label %40
40: ; preds = %14
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %8
43: ; preds = %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\09{ \22gl%d_%d_x\22, \22GL%d_%d_X\22, \22%s\22 },\0A\00"
@.str.1 = [38 x i8] c"\09{ \22gl%d_%d_w\22, \22GL%d_%d_W\22, \22%s\22 },\0A\00"
define void @dump(i32 %0, i8** nocapture %1, i8** nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = add nuw nsw i32 %0, 1
%7 = lshr i32 %6, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %19, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %2, i64 %10
%14 = load i8*, i8** %13
%15 = trunc i64 %10 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %15, i32 %0, i32 %15, i8* %12, i8* %14)
%17 = load i8*, i8** %13
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %15, i32 %0, i32 %15, i8* %17)
%19 = add nuw nsw i64 %10, 1
%20 = icmp eq i64 %19, %8
br i1 %20, label %21, label %9
21: ; preds = %9, %3
%22 = tail call i32 @putchar(i32 10)
ret void
}