#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 */
typedef struct kk TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ aa;
struct kk {
  int a;
  char x;
};

/* Variables and functions */
TYPE_1__ *malloc(int);
int /*<<< orphan*/ memcpy(char *, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  struct kk {
    int a;
    char x;
  } * k;
  int l, m, n;
  unsigned int i = -1;
  k = malloc(2 * 4);
  int b = 20;
  k->a = 40;
  memcpy(&k->x, &b, 4);
  printf("%d\n", *((int *)&k->x));
  printf("sizeof()=%d\n", sizeof(long int));
  printf("\b\btesting backspace\n");
  printf("i=%d i>>2=%d\n", i, i >> 8);
  uint64_t aa[2];
  printf("%s sz = %d %09.04lf %09.04lf\n", "\033[32m", sizeof(aa), 9.3, 0.0);
  void *xx, *yy;
  uint32_t zz;
  zz = 222;
  yy = (void *)222;
  xx = yy + zz;
  printf("xx=%lu %u %u\n", xx, 4 - 6, 6 - 7);
  l = 10;
  n = l, m = l++;
  printf("n = %d m = %d l = %d\n", n, m, l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x20(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x14,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x28,(%rax)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
shr    $0x8,%edx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
lea    0xe80(%rip),%rsi
mov    $0x8,%edx
movsd  0xe1d(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0xde,-0x44(%rbp)
mov    $0xde,%eax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe45(%rip),%rdi
mov    $0xfffffffe,%edx
mov    $0xffffffff,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
movl   $0x14,0xc(%rsp)
movl   $0x28,(%rax)
lea    0x4(%rax),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    0x4(%rbx),%esi
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6b(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffff,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
lea    0xe78(%rip),%rsi
movsd  0xe2f(%rip),%xmm0
mov    $0x8,%edx
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe60(%rip),%rdi
mov    $0x1bc,%esi
mov    $0xfffffffe,%edx
mov    $0xffffffff,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.kk = type { i32, i8 }
%struct.kk.0 = type { i32, i8 }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"sizeof()=%d\0A\00"
@.str.2 = [21 x i8] c"\08\08testing backspace\0A\00"
@.str.3 = [14 x i8] c"i=%d i>>2=%d\0A\00"
@.str.4 = [30 x i8] c"%s sz = %d %09.04lf %09.04lf\0A\00"
@.str.5 = [6 x i8] c"\1B[32m\00"
@.str.6 = [14 x i8] c"xx=%lu %u %u\0A\00"
@.str.7 = [22 x i8] c"n = %d m = %d l = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.kk*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %6
%12 = call %struct.kk.0* @malloc(i32 8)
%13 = bitcast %struct.kk.0* %12 to %struct.kk*
store %struct.kk* %13, %struct.kk** %2
store i32 20, i32* %7
%14 = load %struct.kk*, %struct.kk** %2
%15 = getelementptr inbounds %struct.kk, %struct.kk* %14, i32 0, i32 0
store i32 40, i32* %15
%16 = load %struct.kk*, %struct.kk** %2
%17 = getelementptr inbounds %struct.kk, %struct.kk* %16, i32 0, i32 1
%18 = call i32 @memcpy(i8* %17, i32* %7, i32 4)
%19 = load %struct.kk*, %struct.kk** %2
%20 = getelementptr inbounds %struct.kk, %struct.kk* %19, i32 0, i32 1
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 8)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* %6
%27 = load i32, i32* %6
%28 = lshr i32 %27, 8
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 8, double 9.300000e+00, double 0.000000e+00)
store i32 222, i32* %11
store i8* inttoptr (i64 222 to i8*), i8** %10
%31 = load i8*, i8** %10
%32 = load i32, i32* %11
%33 = sext i32 %32 to i64
%34 = getelementptr i8, i8* %31, i64 %33
store i8* %34, i8** %9
%35 = load i8*, i8** %9
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %35, i32 -2, i32 -1)
store i32 10, i32* %3
%37 = load i32, i32* %3
store i32 %37, i32* %5
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
store i32 %38, i32* %4
%40 = load i32, i32* %5
%41 = load i32, i32* %4
%42 = load i32, i32* %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
ret i32 0
}

LLVM IR (-O2):
%struct.kk.0 = type { i32, i8 }
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"sizeof()=%d\0A\00"
@.str.3 = [14 x i8] c"i=%d i>>2=%d\0A\00"
@.str.4 = [30 x i8] c"%s sz = %d %09.04lf %09.04lf\0A\00"
@.str.5 = [6 x i8] c"\1B[32m\00"
@.str.6 = [14 x i8] c"xx=%lu %u %u\0A\00"
@.str.7 = [22 x i8] c"n = %d m = %d l = %d\0A\00"
@str = [20 x i8] c"\08\08testing backspace\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call %struct.kk.0* @malloc(i32 8)
%3 = bitcast i32* %1 to i8*
store i32 20, i32* %1
%4 = getelementptr %struct.kk.0, %struct.kk.0* %2, i64 0, i32 0
store i32 40, i32* %4
%5 = getelementptr inbounds %struct.kk.0, %struct.kk.0* %2, i64 0, i32 1
%6 = call i32 @memcpy(i8* %5, i32* %1, i32 4)
%7 = bitcast i8* %5 to i32*
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 8)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 -1, i32 16777215)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 8, double 9.300000e+00, double 0.000000e+00)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* inttoptr (i64 444 to i8*), i32 -2, i32 -1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 10, i32 10, i32 11)
ret i32 0
}