#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 *);
int main(void) {
  int hour, tot_salary;
  printf("Enter working hours of an employee: ");
  scanf("%d", &hour);
  if (hour <= 8)
    tot_salary = hour * 100;
  else
    tot_salary = 8 * 100 + (hour - 8) * 120;
  printf("\nThe total salary of an employee is %d", tot_salary);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x8,-0x8(%rbp)
jg     1163 <main+0x43>
imul   $0x64,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <main+0x54>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
imul   $0x78,%eax,%eax
add    $0x320,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0x64,%eax,%ecx
imul   $0x78,%eax,%esi
add    $0xffffff60,%esi
cmp    $0x9,%eax
cmovl  %ecx,%esi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter working hours of an employee: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [39 x i8] c"\0AThe total salary of an employee is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 8
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 100
store i32 %10, i32* %3
br label %16
11: ; preds = %0
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 8
%14 = mul nsw i32 %13, 120
%15 = add nsw i32 800, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Enter working hours of an employee: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [39 x i8] c"\0AThe total salary of an employee is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 9
%7 = mul nsw i32 %5, 100
%8 = mul i32 %5, 120
%9 = add i32 %8, -160
%10 = select i1 %6, i32 %7, i32 %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}