#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 ts_tdt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ts_tdt_dump(struct ts_tdt *);
int /*<<< orphan*/ ts_tdt_free(struct ts_tdt **);
struct ts_tdt *ts_tot_alloc_init(int);
int /*<<< orphan*/ ts_tot_set_localtime_offset_sofia(struct ts_tdt *, int);
void ts_tot_test(void) {
  struct ts_tdt *tot;
  tot = ts_tot_alloc_init(1234567890);
  ts_tdt_dump(tot);
  ts_tdt_free(&tot);
  tot = ts_tot_alloc_init(1234567890);
  ts_tot_set_localtime_offset_sofia(tot, 1234567890);
  ts_tdt_dump(tot);
  ts_tdt_free(&tot);
  tot = ts_tot_alloc_init(1000000000);
  ts_tot_set_localtime_offset_sofia(tot, 1000000000);
  ts_tdt_dump(tot);
  ts_tdt_free(&tot);
}


x86 assembly (clang, -O0):
<ts_tot_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x499602d2,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ts_tdt_dump@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ts_tdt_free@plt>
mov    $0x499602d2,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x499602d2,%esi
call   1050 <ts_tot_set_localtime_offset_sofia@plt>
mov    -0x8(%rbp),%rdi
call   1060 <ts_tdt_dump@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ts_tdt_free@plt>
mov    $0x3b9aca00,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3b9aca00,%esi
call   1050 <ts_tot_set_localtime_offset_sofia@plt>
mov    -0x8(%rbp),%rdi
call   1060 <ts_tdt_dump@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ts_tdt_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_tot_test>:
push   %rbx
sub    $0x10,%rsp
mov    $0x499602d2,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1060 <ts_tdt_dump@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <ts_tdt_free@plt>
mov    $0x499602d2,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x499602d2,%esi
call   1050 <ts_tot_set_localtime_offset_sofia@plt>
mov    0x8(%rsp),%rdi
call   1060 <ts_tdt_dump@plt>
mov    %rbx,%rdi
call   1030 <ts_tdt_free@plt>
mov    $0x3b9aca00,%edi
call   1040 <ts_tot_alloc_init@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x3b9aca00,%esi
call   1050 <ts_tot_set_localtime_offset_sofia@plt>
mov    0x8(%rsp),%rdi
call   1060 <ts_tdt_dump@plt>
mov    %rbx,%rdi
call   1030 <ts_tdt_free@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ts_tdt = type { i32 }
define void @ts_tot_test() {
%1 = alloca %struct.ts_tdt*
%2 = call %struct.ts_tdt* @ts_tot_alloc_init(i32 1234567890)
store %struct.ts_tdt* %2, %struct.ts_tdt** %1
%3 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%4 = call i32 @ts_tdt_dump(%struct.ts_tdt* %3)
%5 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
%6 = call %struct.ts_tdt* @ts_tot_alloc_init(i32 1234567890)
store %struct.ts_tdt* %6, %struct.ts_tdt** %1
%7 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%8 = call i32 @ts_tot_set_localtime_offset_sofia(%struct.ts_tdt* %7, i32 1234567890)
%9 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%10 = call i32 @ts_tdt_dump(%struct.ts_tdt* %9)
%11 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
%12 = call %struct.ts_tdt* @ts_tot_alloc_init(i32 1000000000)
store %struct.ts_tdt* %12, %struct.ts_tdt** %1
%13 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%14 = call i32 @ts_tot_set_localtime_offset_sofia(%struct.ts_tdt* %13, i32 1000000000)
%15 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%16 = call i32 @ts_tdt_dump(%struct.ts_tdt* %15)
%17 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
ret void
}

LLVM IR (-O2):
%struct.ts_tdt = type { i32 }
define void @ts_tot_test() {
%1 = alloca %struct.ts_tdt*
%2 = bitcast %struct.ts_tdt** %1 to i8*
%3 = tail call %struct.ts_tdt* @ts_tot_alloc_init(i32 1234567890)
store %struct.ts_tdt* %3, %struct.ts_tdt** %1
%4 = tail call i32 @ts_tdt_dump(%struct.ts_tdt* %3)
%5 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
%6 = call %struct.ts_tdt* @ts_tot_alloc_init(i32 1234567890)
store %struct.ts_tdt* %6, %struct.ts_tdt** %1
%7 = call i32 @ts_tot_set_localtime_offset_sofia(%struct.ts_tdt* %6, i32 1234567890)
%8 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%9 = call i32 @ts_tdt_dump(%struct.ts_tdt* %8)
%10 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
%11 = call %struct.ts_tdt* @ts_tot_alloc_init(i32 1000000000)
store %struct.ts_tdt* %11, %struct.ts_tdt** %1
%12 = call i32 @ts_tot_set_localtime_offset_sofia(%struct.ts_tdt* %11, i32 1000000000)
%13 = load %struct.ts_tdt*, %struct.ts_tdt** %1
%14 = call i32 @ts_tdt_dump(%struct.ts_tdt* %13)
%15 = call i32 @ts_tdt_free(%struct.ts_tdt** %1)
ret void
}