#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 strlen(char *);
void printVar() {
  int ia;
  static int ib;
  printf("ia = %d\n", ia);
  printf("ib = %d\n", ib);
  char cha;
  static char chb;
  printf("cha = %c, %d\n", cha, cha);
  printf("chb = %c, %d\n", chb, chb);
  char stra[2];
  static char strb[2];
  printf("stra = %s, %d\n", stra, strlen(stra));
  printf("strb = %s, %d\n", strb, strlen(strb));
}


x86 assembly (clang, -O0):
<printVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2ef5(%rip),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl 0x2ece(%rip),%esi
movsbl 0x2ec7(%rip),%edx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x2e8e(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
lea    0xe84(%rip),%rdi
lea    0x2e79(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVar>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2ea3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@printVar.ib = internal global i32 0
@.str = [9 x i8] c"ia = %d\0A\00"
@.str.1 = [9 x i8] c"ib = %d\0A\00"
@printVar.chb = internal global i8 0
@.str.2 = [14 x i8] c"cha = %c, %d\0A\00"
@.str.3 = [14 x i8] c"chb = %c, %d\0A\00"
@printVar.strb = internal global [2 x i8] zeroinitializer
@.str.4 = [15 x i8] c"stra = %s, %d\0A\00"
@.str.5 = [15 x i8] c"strb = %s, %d\0A\00"
define void @printVar() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [2 x i8]
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @printVar.ib
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i8, i8* @printVar.chb
%14 = sext i8 %13 to i32
%15 = load i8, i8* @printVar.chb
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %16)
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %18, i32 %20)
%22 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @printVar.strb, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @printVar.strb, i64 0, i64 0), i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ia = %d\0A\00"
@.str.1 = [9 x i8] c"ib = %d\0A\00"
@.str.2 = [14 x i8] c"cha = %c, %d\0A\00"
@.str.3 = [14 x i8] c"chb = %c, %d\0A\00"
@printVar.strb = internal global [2 x i8] zeroinitializer
@.str.4 = [15 x i8] c"stra = %s, %d\0A\00"
@.str.5 = [15 x i8] c"strb = %s, %d\0A\00"
define void @printVar() {
%1 = alloca [2 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 0)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @printVar.strb, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @printVar.strb, i64 0, i64 0), i32 %9)
ret void
}