#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 */
struct stat {
  int st_dev;
  int st_ino;
  int st_mode;
  int st_nlink;
  int st_uid;
  int st_gid;
  int st_rdev;
  int st_size;
  int st_blksize;
  int st_blocks;
  int st_atime;
  int st_mtime;
  int st_ctime;
};

/* Variables and functions */
int lstat(char *, struct stat *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct stat st;
  int res = lstat("lzocomp.cc", &st);
  if (res != 0) {
    printf("Error %d\n", res);
    return 1;
  }
  printf("st_dev  = %lX\n", st.st_dev);
  printf("st_ino  = %lX\n", st.st_ino);
  printf("st_mode = %o\n", st.st_mode);
  printf("st_nlink = %lu\n", st.st_nlink);
  printf("st_uid   = %d\n", st.st_uid);
  printf("st_gid   = %d\n", st.st_gid);
  printf("st_rdev  = %lu\n", st.st_rdev);
  printf("st_size  = %lu\n", st.st_size);
  printf("st_blksize = %lu\n", st.st_blksize);
  printf("st_blocks  = %lu\n", st.st_blocks);
  printf("st_atime   = %lX\n", st.st_atime);
  printf("st_mtime   = %lX\n", st.st_mtime);
  printf("st_ctime   = %lX\n", st.st_ctime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <lstat@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1167 <main+0x47>
mov    -0x3c(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1231 <main+0x111>
mov    -0x38(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <lstat@plt>
test   %eax,%eax
je     114f <main+0x2f>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x38,%rsp
ret
mov    (%rsp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [11 x i8] c"lzocomp.cc\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [15 x i8] c"st_dev = %lX\0A\00"
@.str.3 = [15 x i8] c"st_ino = %lX\0A\00"
@.str.4 = [14 x i8] c"st_mode = %o\0A\00"
@.str.5 = [16 x i8] c"st_nlink = %lu\0A\00"
@.str.6 = [15 x i8] c"st_uid = %d\0A\00"
@.str.7 = [15 x i8] c"st_gid = %d\0A\00"
@.str.8 = [16 x i8] c"st_rdev = %lu\0A\00"
@.str.9 = [16 x i8] c"st_size = %lu\0A\00"
@.str.10 = [18 x i8] c"st_blksize = %lu\0A\00"
@.str.11 = [18 x i8] c"st_blocks = %lu\0A\00"
@.str.12 = [18 x i8] c"st_atime = %lX\0A\00"
@.str.13 = [18 x i8] c"st_mtime = %lX\0A\00"
@.str.14 = [18 x i8] c"st_ctime = %lX\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @lstat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i32 1, i32* %1
br label %50
10: ; preds = %0
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 3
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 4
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 5
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 6
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 7
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 8
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 9
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 10
%42 = load i32, i32* %41
%43 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 11
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 12
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %48)
store i32 0, i32* %1
br label %50
50: ; preds = %10, %7
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [11 x i8] c"lzocomp.cc\00"
@.str.1 = [10 x i8] c"Error %d\0A\00"
@.str.2 = [15 x i8] c"st_dev = %lX\0A\00"
@.str.3 = [15 x i8] c"st_ino = %lX\0A\00"
@.str.4 = [14 x i8] c"st_mode = %o\0A\00"
@.str.5 = [16 x i8] c"st_nlink = %lu\0A\00"
@.str.6 = [15 x i8] c"st_uid = %d\0A\00"
@.str.7 = [15 x i8] c"st_gid = %d\0A\00"
@.str.8 = [16 x i8] c"st_rdev = %lu\0A\00"
@.str.9 = [16 x i8] c"st_size = %lu\0A\00"
@.str.10 = [18 x i8] c"st_blksize = %lu\0A\00"
@.str.11 = [18 x i8] c"st_blocks = %lu\0A\00"
@.str.12 = [18 x i8] c"st_atime = %lX\0A\00"
@.str.13 = [18 x i8] c"st_mtime = %lX\0A\00"
@.str.14 = [18 x i8] c"st_ctime = %lX\0A\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @lstat(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %47
7: ; preds = %0
%8 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 2
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 3
%18 = load i32, i32* %17
%19 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 4
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 5
%24 = load i32, i32* %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 6
%27 = load i32, i32* %26
%28 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 7
%30 = load i32, i32* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 8
%33 = load i32, i32* %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 9
%36 = load i32, i32* %35
%37 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 10
%39 = load i32, i32* %38
%40 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 11
%42 = load i32, i32* %41
%43 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 12
%45 = load i32, i32* %44
%46 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %7, %5
%48 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %48
}