#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 *, ...);
int /*<<< orphan*/ putchar(char);
int main() {
  int i = 0;
  int a[3] = {8};
  int x[2][3] = {1, 2, 3, 4, 5};
  printf("%x", -1);
  int y = 20;
  while (y--)
    ;
  printf("%d\n", y);
  char str[] = "abcdefg";
  while (str[i] != '\0') {
    putchar(str[i]);
    i++;
    if (i % 4 == 0)
      break;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x14,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x34(%rbp)
cmp    $0x0,%eax
je     119e <main+0x7e>
jmp    1185 <main+0x65>
mov    -0x34(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xe79(%rip),%rax
mov    %rax,-0x3c(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x3c(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1201 <main+0xe1>
movslq -0x8(%rbp),%rax
movsbl -0x3c(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11fc <main+0xdc>
jmp    1201 <main+0xe1>
jmp    11ba <main+0x9a>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%3 = tail call i32 @putchar(i8 signext 97)
%4 = tail call i32 @putchar(i8 signext 98)
%5 = tail call i32 @putchar(i8 signext 99)
%6 = tail call i32 @putchar(i8 signext 100)
%7 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret i32 0
}