#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);
int /*<<< orphan*/ puts(char *);
int main() {
  int total, fine, speeding;
  puts("Speeding tickets\n");
  speeding = 85 - 55;
  fine = speeding * 15;
  total = total + fine;
  printf("For going 85 in a 55 zone your ticket is $%d\n", fine);
  speeding = 95 - 55;
  fine = speeding * 15;
  total = total + fine;
  printf("For going 95 in a 55 zone your ticket is $%d\n", fine);
  speeding = 100 - 55;
  fine = speeding * 15;
  total = total + fine;
  printf("For going 100 in a 55 zone your ticket is $%d\n", fine);
  printf("\nTotal in fines %d", total);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1e,-0x10(%rbp)
imul   $0xf,-0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x28,-0x10(%rbp)
imul   $0xf,-0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
movl   $0x2d,-0x10(%rbp)
imul   $0xf,-0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xee6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
mov    $0x1c2,%esi
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x258,%esi
call   1040 <printf@plt>
lea    0xf18(%rip),%rdi
mov    $0x2a3,%esi
call   1040 <printf@plt>
lea    0xf36(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Speeding tickets\0A\00"
@.str.1 = [46 x i8] c"For going 85 in a 55 zone your ticket is $%d\0A\00"
@.str.2 = [46 x i8] c"For going 95 in a 55 zone your ticket is $%d\0A\00"
@.str.3 = [47 x i8] c"For going 100 in a 55 zone your ticket is $%d\0A\00"
@.str.4 = [19 x i8] c"\0ATotal in fines %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 30, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 15
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 40, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 15
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 45, i32* %4
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 15
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = add nsw i32 %22, %23
store i32 %24, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Speeding tickets\0A\00"
@.str.1 = [46 x i8] c"For going 85 in a 55 zone your ticket is $%d\0A\00"
@.str.2 = [46 x i8] c"For going 95 in a 55 zone your ticket is $%d\0A\00"
@.str.3 = [47 x i8] c"For going 100 in a 55 zone your ticket is $%d\0A\00"
@.str.4 = [19 x i8] c"\0ATotal in fines %d\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 450)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 600)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i32 675)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 undef)
ret i32 0
}