#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 */
typedef unsigned long time_t;

/* Variables and functions */
time_t gm_time_t(unsigned long time, int tz) {
  int minutes;
  minutes = tz < 0 ? -tz : tz;
  minutes = (minutes / 100) * 60 + (minutes % 100);
  minutes = tz < 0 ? -minutes : minutes;
  return time + minutes * 60;
}


x86 assembly (clang, -O0):
<gm_time_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1122 <gm_time_t+0x22>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <gm_time_t+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1169 <gm_time_t+0x69>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    116f <gm_time_t+0x6f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3c,-0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gm_time_t>:
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
imul   $0x51eb851f,%rax,%rcx
shr    $0x25,%rcx
imul   $0x3c,%ecx,%edx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
add    %edx,%eax
mov    %eax,%ecx
neg    %ecx
test   %esi,%esi
cmovns %eax,%ecx
imul   $0x3c,%ecx,%eax
cltq
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @gm_time_t(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = sdiv i32 %15, 100
%17 = mul nsw i32 %16, 60
%18 = load i32, i32* %5
%19 = srem i32 %18, 100
%20 = add nsw i32 %17, %19
store i32 %20, i32* %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %13
%24 = load i32, i32* %5
%25 = sub nsw i32 0, %24
br label %28
26: ; preds = %13
%27 = load i32, i32* %5
br label %28
28: ; preds = %26, %23
%29 = phi i32 [ %25, %23 ], [ %27, %26 ]
store i32 %29, i32* %5
%30 = load i64, i64* %3
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, 60
%33 = sext i32 %32 to i64
%34 = add i64 %30, %33
ret i64 %34
}

LLVM IR (-O2):
define i64 @gm_time_t(i64 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = sub nsw i32 0, %1
%5 = select i1 %3, i32 %4, i32 %1
%6 = udiv i32 %5, 100
%7 = mul nuw nsw i32 %6, 60
%8 = urem i32 %5, 100
%9 = add nuw nsw i32 %7, %8
%10 = sub nsw i32 0, %9
%11 = select i1 %3, i32 %10, i32 %9
%12 = mul nsw i32 %11, 60
%13 = sext i32 %12 to i64
%14 = add i64 %13, %0
ret i64 %14
}