#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 */

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void settz(register char *b, register int tz) {
  if (tz == 0) {
    strcpy(b + 24, "GMT");
    return;
  }
  if (tz < 0) {
    b[24] = '+';
    tz = -tz;
  } else
    b[24] = '-';
  b[25] = tz / 60 / 10 + '0';
  b[26] = tz / 60 % 10 + '0';
  tz %= 60;
  b[27] = tz / 10 + '0';
  b[28] = tz % 10 + '0';
}


x86 assembly (clang, -O0):
<settz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <settz+0x32>
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
lea    0xec8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11e3 <settz+0xd3>
cmpl   $0x0,-0xc(%rbp)
jge    1161 <settz+0x51>
mov    -0x8(%rbp),%rax
movb   $0x2b,0x18(%rax)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <settz+0x59>
mov    -0x8(%rbp),%rax
movb   $0x2d,0x18(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x19(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1a(%rax)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1b(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<settz>:
test   %esi,%esi
je     1184 <settz+0x74>
setns  %cl
add    %cl,%cl
add    $0x2b,%cl
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
mov    %cl,0x18(%rdi)
imul   $0x1b4e81b5,%rax,%rcx
shr    $0x26,%rcx
add    $0x30,%cl
mov    %cl,0x19(%rdi)
mov    $0x88888889,%ecx
imul   %rax,%rcx
shr    $0x25,%rcx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x3c,%ecx,%esi
sub    %edx,%ecx
or     $0x30,%cl
mov    %cl,0x1a(%rdi)
sub    %esi,%eax
imul   $0xcd,%eax,%ecx
movzwl %cx,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
or     $0x30,%dl
mov    %dl,0x1b(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     $0x30,%al
mov    %al,0x1c(%rdi)
ret
add    $0x18,%rdi
lea    0xe71(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"GMT\00"
define void @settz(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 24
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %51
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 24
store i8 43, i8* %16
%17 = load i32, i32* %4
%18 = sub nsw i32 0, %17
store i32 %18, i32* %4
br label %22
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 24
store i8 45, i8* %21
br label %22
22: ; preds = %19, %14
%23 = load i32, i32* %4
%24 = sdiv i32 %23, 60
%25 = sdiv i32 %24, 10
%26 = add nsw i32 %25, 48
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 25
store i8 %27, i8* %29
%30 = load i32, i32* %4
%31 = sdiv i32 %30, 60
%32 = srem i32 %31, 10
%33 = add nsw i32 %32, 48
%34 = trunc i32 %33 to i8
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 26
store i8 %34, i8* %36
%37 = load i32, i32* %4
%38 = srem i32 %37, 60
store i32 %38, i32* %4
%39 = load i32, i32* %4
%40 = sdiv i32 %39, 10
%41 = add nsw i32 %40, 48
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i64 27
store i8 %42, i8* %44
%45 = load i32, i32* %4
%46 = srem i32 %45, 10
%47 = add nsw i32 %46, 48
%48 = trunc i32 %47 to i8
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i64 28
store i8 %48, i8* %50
br label %51
51: ; preds = %22, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"GMT\00"
define void @settz(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %0, i64 24
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %30
7: ; preds = %2
%8 = icmp slt i32 %1, 0
%9 = sub nsw i32 0, %1
%10 = select i1 %8, i8 43, i8 45
%11 = select i1 %8, i32 %9, i32 %1
%12 = getelementptr inbounds i8, i8* %0, i64 24
store i8 %10, i8* %12
%13 = udiv i32 %11, 60
%14 = udiv i32 %11, 600
%15 = trunc i32 %14 to i8
%16 = add i8 %15, 48
%17 = getelementptr inbounds i8, i8* %0, i64 25
store i8 %16, i8* %17
%18 = urem i32 %13, 10
%19 = trunc i32 %18 to i8
%20 = or i8 %19, 48
%21 = getelementptr inbounds i8, i8* %0, i64 26
store i8 %20, i8* %21
%22 = urem i32 %11, 60
%23 = trunc i32 %22 to i8
%24 = udiv i8 %23, 10
%25 = or i8 %24, 48
%26 = getelementptr inbounds i8, i8* %0, i64 27
store i8 %25, i8* %26
%27 = urem i8 %23, 10
%28 = or i8 %27, 48
%29 = getelementptr inbounds i8, i8* %0, i64 28
store i8 %28, i8* %29
br label %30
30: ; preds = %7, %4
ret void
}