#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 timezone {
  int tz_minuteswest;
  int tz_dsttime;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  printf("tv{sec=%08ld, usec=%08ld}\n", tv.tv_sec, tv.tv_usec);
  printf("tz{tz_minuteswest = %08d, tz_dsttime = %08d}\n", tz.tz_minuteswest,
         tz.tz_dsttime);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <gettimeofday@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <gettimeofday@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32, i32 }
@.str = [27 x i8] c"tv{sec=%08ld, usec=%08ld}\0A\00"
@.str.1 = [46 x i8] c"tz{tz_minuteswest = %08d, tz_dsttime = %08d}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca %struct.timezone
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @gettimeofday(%struct.timeval* %6, %struct.timezone* %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = getelementptr inbounds %struct.timezone, %struct.timezone* %7, i32 0, i32 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.timezone, %struct.timezone* %7, i32 0, i32 1
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32, i32 }
@.str = [27 x i8] c"tv{sec=%08ld, usec=%08ld}\0A\00"
@.str.1 = [46 x i8] c"tz{tz_minuteswest = %08d, tz_dsttime = %08d}\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timezone
%5 = bitcast %struct.timeval* %3 to i8*
%6 = bitcast %struct.timezone* %4 to i8*
%7 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
%13 = getelementptr inbounds %struct.timezone, %struct.timezone* %4, i64 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timezone, %struct.timezone* %4, i64 0, i32 1
%16 = load i32, i32* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16)
ret i32 0
}