#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 = -1;
  printf("Enter watts: ");
  scanf("%d", &watts);
  switch (watts) {
  case 15:
    lumens = 125;
    break;
  case 25:
    lumens = 215;
    break;
  case 40:
    lumens = 500;
    break;
  case 60:
    lumens = 880;
    break;
  case 75:
    lumens = 1000;
    break;
  case 100:
    lumens = 1675;
    break;
  default:
    lumens = -1;
  }
  printf("Lumens: %d\n", 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   $0xffffffff,-0xc(%rbp)
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xf,%eax
je     11c4 <main+0xa4>
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%eax
sub    $0x19,%eax
je     11d0 <main+0xb0>
jmp    1180 <main+0x60>
mov    -0x10(%rbp),%eax
sub    $0x28,%eax
je     11dc <main+0xbc>
jmp    1191 <main+0x71>
mov    -0x10(%rbp),%eax
sub    $0x3c,%eax
je     11e8 <main+0xc8>
jmp    11a2 <main+0x82>
mov    -0x10(%rbp),%eax
sub    $0x4b,%eax
je     11f4 <main+0xd4>
jmp    11b3 <main+0x93>
mov    -0x10(%rbp),%eax
sub    $0x64,%eax
je     1200 <main+0xe0>
jmp    120c <main+0xec>
movl   $0x7d,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0xd7,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0x1f4,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0x370,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0x3e8,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0x68b,-0xc(%rbp)
jmp    1213 <main+0xf3>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xdf4(%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
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3b,%eax
jg     1167 <main+0x47>
cmp    $0xf,%eax
je     117d <main+0x5d>
cmp    $0x19,%eax
je     1184 <main+0x64>
cmp    $0x28,%eax
jne    1199 <main+0x79>
mov    $0x1f4,%esi
jmp    119e <main+0x7e>
cmp    $0x3c,%eax
je     118b <main+0x6b>
cmp    $0x4b,%eax
je     1192 <main+0x72>
cmp    $0x64,%eax
jne    1199 <main+0x79>
mov    $0x68b,%esi
jmp    119e <main+0x7e>
mov    $0x7d,%esi
jmp    119e <main+0x7e>
mov    $0xd7,%esi
jmp    119e <main+0x7e>
mov    $0x370,%esi
jmp    119e <main+0x7e>
mov    $0x3e8,%esi
jmp    119e <main+0x7e>
mov    $0xffffffff,%esi
lea    0xe6c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter watts: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"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 -1, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 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
switch i32 %6, label %13 [
i32 15, label %7
i32 25, label %8
i32 40, label %9
i32 60, label %10
i32 75, label %11
i32 100, label %12
]
7: ; preds = %0
store i32 125, i32* %3
br label %14
8: ; preds = %0
store i32 215, i32* %3
br label %14
9: ; preds = %0
store i32 500, i32* %3
br label %14
10: ; preds = %0
store i32 880, i32* %3
br label %14
11: ; preds = %0
store i32 1000, i32* %3
br label %14
12: ; preds = %0
store i32 1675, i32* %3
br label %14
13: ; preds = %0
store i32 -1, i32* %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter watts: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"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 ([14 x i8], [14 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
switch i32 %5, label %11 [
i32 15, label %12
i32 25, label %6
i32 40, label %7
i32 60, label %8
i32 75, label %9
i32 100, label %10
]
6: ; preds = %0
br label %12
7: ; preds = %0
br label %12
8: ; preds = %0
br label %12
9: ; preds = %0
br label %12
10: ; preds = %0
br label %12
11: ; preds = %0
br label %12
12: ; preds = %0, %11, %10, %9, %8, %7, %6
%13 = phi i32 [ -1, %11 ], [ 1675, %10 ], [ 1000, %9 ], [ 880, %8 ], [ 500, %7 ], [ 215, %6 ], [ 125, %0 ]
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}