#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 watts = 0, lumens = 0;
  printf("Please input brightness in watts: ");
  scanf(" %d", &watts);
  switch (watts) {
  case 100:
    lumens = 1675;
    break;
  case 75:
    lumens = 1000;
    break;
  case 60:
    lumens = 880;
    break;
  case 40:
    lumens = 500;
    break;
  case 25:
    lumens = 215;
    break;
  case 15:
    lumens = 125;
    break;
  default:
    printf("Y'all done fucked up now! ");
  }
  printf("When W: %d then lumens: %d\n", watts, lumens);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xf,%eax
je     1200 <main+0xe0>
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%eax
sub    $0x19,%eax
je     11f4 <main+0xd4>
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%eax
sub    $0x28,%eax
je     11e8 <main+0xc8>
jmp    1191 <main+0x71>
mov    -0x10(%rbp),%eax
sub    $0x3c,%eax
je     11dc <main+0xbc>
jmp    11a2 <main+0x82>
mov    -0x10(%rbp),%eax
sub    $0x4b,%eax
je     11d0 <main+0xb0>
jmp    11b3 <main+0x93>
mov    -0x10(%rbp),%eax
sub    $0x64,%eax
jne    120c <main+0xec>
jmp    11c4 <main+0xa4>
movl   $0x68b,-0xc(%rbp)
jmp    121a <main+0xfa>
movl   $0x3e8,-0xc(%rbp)
jmp    121a <main+0xfa>
movl   $0x370,-0xc(%rbp)
jmp    121a <main+0xfa>
movl   $0x1f4,-0xc(%rbp)
jmp    121a <main+0xfa>
movl   $0xd7,-0xc(%rbp)
jmp    121a <main+0xfa>
movl   $0x7d,-0xc(%rbp)
jmp    121a <main+0xfa>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x3b,%esi
jg     116b <main+0x4b>
cmp    $0xf,%esi
je     1181 <main+0x61>
cmp    $0x19,%esi
je     1188 <main+0x68>
cmp    $0x28,%esi
jne    119d <main+0x7d>
mov    $0x1f4,%ebx
jmp    11b1 <main+0x91>
cmp    $0x3c,%esi
je     118f <main+0x6f>
cmp    $0x64,%esi
je     1196 <main+0x76>
cmp    $0x4b,%esi
jne    119d <main+0x7d>
mov    $0x3e8,%ebx
jmp    11b1 <main+0x91>
mov    $0x7d,%ebx
jmp    11b1 <main+0x91>
mov    $0xd7,%ebx
jmp    11b1 <main+0x91>
mov    $0x370,%ebx
jmp    11b1 <main+0x91>
mov    $0x68b,%ebx
jmp    11b1 <main+0x91>
lea    0xe83(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe8a(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Please input brightness in watts: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [27 x i8] c"Y'all done fucked up now! \00"
@.str.3 = [28 x i8] c"When W: %d then lumens: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %13 [
i32 100, label %7
i32 75, label %8
i32 60, label %9
i32 40, label %10
i32 25, label %11
i32 15, label %12
]
7: ; preds = %0
store i32 1675, i32* %3
br label %15
8: ; preds = %0
store i32 1000, i32* %3
br label %15
9: ; preds = %0
store i32 880, i32* %3
br label %15
10: ; preds = %0
store i32 500, i32* %3
br label %15
11: ; preds = %0
store i32 215, i32* %3
br label %15
12: ; preds = %0
store i32 125, i32* %3
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %12, %11, %10, %9, %8, %7
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Please input brightness in watts: \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [27 x i8] c"Y'all done fucked up now! \00"
@.str.3 = [28 x i8] c"When W: %d then lumens: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %11 [
i32 100, label %14
i32 75, label %6
i32 60, label %7
i32 40, label %8
i32 25, label %9
i32 15, label %10
]
6: ; preds = %0
br label %14
7: ; preds = %0
br label %14
8: ; preds = %0
br label %14
9: ; preds = %0
br label %14
10: ; preds = %0
br label %14
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %1
br label %14
14: ; preds = %0, %11, %10, %9, %8, %7, %6
%15 = phi i32 [ %13, %11 ], [ %5, %10 ], [ %5, %9 ], [ %5, %8 ], [ %5, %7 ], [ %5, %6 ], [ %5, %0 ]
%16 = phi i32 [ 0, %11 ], [ 125, %10 ], [ 215, %9 ], [ 500, %8 ], [ 880, %7 ], [ 1000, %6 ], [ 1675, %0 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16)
ret i32 0
}