#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
main() {
  int hours, minutes, seconds, target, abit, vbit;
  printf("Film-Spielzeit angeben [h:m:s]: ");
  scanf("%d:%d:%d", &hours, &minutes, &seconds);
  seconds = hours * 3600 + minutes * 60 + seconds;
  printf("Zielgröße in MB: ");
  scanf("%d", &target);
  printf("Audio-Bitrate (kbits): ");
  scanf("%d", &abit);
  vbit = (target * 1024 * 8 - seconds * abit) / seconds;
  printf("Videobitrate: %d kbit/s\n", vbit);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
imul   $0xe10,-0x4(%rbp),%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
shl    $0xa,%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
sub    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
imul   $0xe10,0x1c(%rsp),%eax
imul   $0x3c,0x18(%rsp),%ecx
add    %eax,%ecx
add    %ecx,0xc(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaf(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
shl    $0xd,%eax
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%edx
imul   %ecx,%edx
sub    %edx,%eax
cltd
idiv   %ecx
lea    0xe94(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Film-Spielzeit angeben [h:m:s]: \00"
@.str.1 = [9 x i8] c"%d:%d:%d\00"
@.str.2 = [20 x i8] c"Zielgr\C3\B6\C3\9Fe in MB: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"Audio-Bitrate (kbits): \00"
@.str.5 = [25 x i8] c"Videobitrate: %d kbit/s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 3600
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 60
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 1024
%22 = mul nsw i32 %21, 8
%23 = load i32, i32* %3
%24 = load i32, i32* %5
%25 = mul nsw i32 %23, %24
%26 = sub nsw i32 %22, %25
%27 = load i32, i32* %3
%28 = sdiv i32 %26, %27
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Film-Spielzeit angeben [h:m:s]: \00"
@.str.1 = [9 x i8] c"%d:%d:%d\00"
@.str.2 = [20 x i8] c"Zielgr\C3\B6\C3\9Fe in MB: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"Audio-Bitrate (kbits): \00"
@.str.5 = [25 x i8] c"Videobitrate: %d kbit/s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%13 = load i32, i32* %1
%14 = mul nsw i32 %13, 3600
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 60
%17 = add nsw i32 %16, %14
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
store i32 %19, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%24 = load i32, i32* %4
%25 = shl nsw i32 %24, 13
%26 = load i32, i32* %3
%27 = load i32, i32* %5
%28 = mul nsw i32 %27, %26
%29 = sub nsw i32 %25, %28
%30 = sdiv i32 %29, %26
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %30)
ret i32 0
}