#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 */
unsigned int get_track_length(short);
void cd_track_length(short tracknum, unsigned char *min, unsigned char *sec,
                     unsigned char *frame) {
  unsigned int value;
  value = get_track_length(tracknum);
  value -= 150;
  *frame = value % 75;
  value -= *frame;
  value /= 75;
  *sec = value % 60;
  value -= *sec;
  value /= 60;
  *min = value;
}


x86 assembly (clang, -O0):
<cd_track_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <get_track_length@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x96,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4b,%ecx
xor    %edx,%edx
div    %ecx
mov    %dl,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4b,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %dl,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_track_length>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r14
call   1030 <get_track_length@plt>
mov    %eax,%ecx
add    $0xffffff6a,%ecx
imul   $0x1b4e81b5,%rcx,%rdx
shr    $0x23,%rdx
imul   $0x4b,%edx,%esi
neg    %esi
add    %esi,%eax
add    $0xffffff6a,%eax
mov    %al,(%rbx)
mov    $0x88888889,%eax
imul   %rdx,%rax
shr    $0x25,%rax
imul   $0x3c,%eax,%eax
sub    %eax,%edx
mov    %dl,(%r15)
mov    $0xe90452d5,%eax
imul   %rcx,%rax
shr    $0x2c,%rax
mov    %al,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @cd_track_length(i16 signext %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i16 %0, i16* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i16, i16* %5
%11 = call i32 @get_track_length(i16 signext %10)
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = sub i32 %12, 150
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = urem i32 %14, 75
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %8
store i8 %16, i8* %17
%18 = load i8*, i8** %8
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i32, i32* %9
%22 = sub i32 %21, %20
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = udiv i32 %23, 75
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = urem i32 %25, 60
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %7
store i8 %27, i8* %28
%29 = load i8*, i8** %7
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i32, i32* %9
%33 = sub i32 %32, %31
store i32 %33, i32* %9
%34 = load i32, i32* %9
%35 = udiv i32 %34, 60
store i32 %35, i32* %9
%36 = load i32, i32* %9
%37 = trunc i32 %36 to i8
%38 = load i8*, i8** %6
store i8 %37, i8* %38
ret void
}

LLVM IR (-O2):
define void @cd_track_length(i16 signext %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = tail call i32 @get_track_length(i16 signext %0)
%6 = add i32 %5, -150
%7 = urem i32 %6, 75
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = udiv i32 %6, 75
%10 = urem i32 %9, 60
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = udiv i32 %6, 4500
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
ret void
}