#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 */
scalar_t__ strcmp(char const *, char *);
int convert_units_from_um(double *value, const char *to_units) {
  if (0 == strcmp(to_units, "um")) {
    return 0;
  } else if (0 == strcmp(to_units, "nm")) {
    *value *= 1e3;
  } else if (0 == strcmp(to_units, "m")) {
    *value *= 1e-6;
  } else if (0 == strcmp(to_units, "cm")) {
    *value *= 1e-4;
  } else if (0 == strcmp(to_units, "mm")) {
    *value *= 1e-3;
  } else if (0 == strcmp(to_units, "eV")) {
    *value = 1.2398412230660532 / *value;
  } else if (0 == strcmp(to_units, "J")) {
    *value = 1.9864455003959036e-19 / *value;
  } else if (0 == strcmp(to_units, "THz")) {
    *value = 299.792458 / *value;
  } else if (0 == strcmp(to_units, "GHz")) {
    *value = 299792.458 / *value;
  } else if (0 == strcmp(to_units, "Hz")) {
    *value = 2.99792458e14 / *value;
  } else if (0 == strcmp(to_units, "rad/s")) {
    *value = 1.8836515673088532e15 / *value;
  } else {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<convert_units_from_um>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xf25(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114a <convert_units_from_um+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    13cd <convert_units_from_um+0x2bd>
mov    -0x18(%rbp),%rdi
lea    0xefe(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1181 <convert_units_from_um+0x71>
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13c1 <convert_units_from_um+0x2b1>
mov    -0x18(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11b8 <convert_units_from_um+0xa8>
mov    -0x10(%rbp),%rax
movsd  0xe95(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13bc <convert_units_from_um+0x2ac>
mov    -0x18(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ef <convert_units_from_um+0xdf>
mov    -0x10(%rbp),%rax
movsd  0xe56(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13b7 <convert_units_from_um+0x2a7>
mov    -0x18(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1226 <convert_units_from_um+0x116>
mov    -0x10(%rbp),%rax
movsd  0xe17(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13b2 <convert_units_from_um+0x2a2>
mov    -0x18(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1261 <convert_units_from_um+0x151>
mov    -0x10(%rbp),%rax
movsd  0xdd8(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13ad <convert_units_from_um+0x29d>
mov    -0x18(%rbp),%rdi
lea    0xdf3(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    129c <convert_units_from_um+0x18c>
mov    -0x10(%rbp),%rax
movsd  0xd95(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13a8 <convert_units_from_um+0x298>
mov    -0x18(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    12d7 <convert_units_from_um+0x1c7>
mov    -0x10(%rbp),%rax
movsd  0xd52(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13a3 <convert_units_from_um+0x293>
mov    -0x18(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1312 <convert_units_from_um+0x202>
mov    -0x10(%rbp),%rax
movsd  0xd0f(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    139e <convert_units_from_um+0x28e>
mov    -0x18(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    134d <convert_units_from_um+0x23d>
mov    -0x10(%rbp),%rax
movsd  0xccc(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1399 <convert_units_from_um+0x289>
mov    -0x18(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1388 <convert_units_from_um+0x278>
mov    -0x10(%rbp),%rax
movsd  0xc89(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1394 <convert_units_from_um+0x284>
movl   $0x2,-0x4(%rbp)
jmp    13cd <convert_units_from_um+0x2bd>
jmp    1399 <convert_units_from_um+0x289>
jmp    139e <convert_units_from_um+0x28e>
jmp    13a3 <convert_units_from_um+0x293>
jmp    13a8 <convert_units_from_um+0x298>
jmp    13ad <convert_units_from_um+0x29d>
jmp    13b2 <convert_units_from_um+0x2a2>
jmp    13b7 <convert_units_from_um+0x2a7>
jmp    13bc <convert_units_from_um+0x2ac>
jmp    13c1 <convert_units_from_um+0x2b1>
jmp    13c6 <convert_units_from_um+0x2b6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_units_from_um>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xf2f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     12b1 <convert_units_from_um+0x1a1>
lea    0xf15(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1239 <convert_units_from_um+0x129>
lea    0xf01(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1248 <convert_units_from_um+0x138>
lea    0xee8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1257 <convert_units_from_um+0x147>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1266 <convert_units_from_um+0x156>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1275 <convert_units_from_um+0x165>
lea    0xea9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     127f <convert_units_from_um+0x16f>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1289 <convert_units_from_um+0x179>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1293 <convert_units_from_um+0x183>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     129d <convert_units_from_um+0x18d>
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
jne    12b1 <convert_units_from_um+0x1a1>
movsd  0xdc9(%rip),%xmm0
jmp    12a5 <convert_units_from_um+0x195>
movsd  (%r14),%xmm0
mulsd  0xe02(%rip),%xmm0
jmp    12aa <convert_units_from_um+0x19a>
movsd  (%r14),%xmm0
mulsd  0xdeb(%rip),%xmm0
jmp    12aa <convert_units_from_um+0x19a>
movsd  (%r14),%xmm0
mulsd  0xdd4(%rip),%xmm0
jmp    12aa <convert_units_from_um+0x19a>
movsd  (%r14),%xmm0
mulsd  0xdbd(%rip),%xmm0
jmp    12aa <convert_units_from_um+0x19a>
movsd  0xdab(%rip),%xmm0
jmp    12a5 <convert_units_from_um+0x195>
movsd  0xd99(%rip),%xmm0
jmp    12a5 <convert_units_from_um+0x195>
movsd  0xd87(%rip),%xmm0
jmp    12a5 <convert_units_from_um+0x195>
movsd  0xd75(%rip),%xmm0
jmp    12a5 <convert_units_from_um+0x195>
movsd  0xd63(%rip),%xmm0
divsd  (%r14),%xmm0
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"um\00"
@.str.1 = [3 x i8] c"nm\00"
@.str.2 = [2 x i8] c"m\00"
@.str.3 = [3 x i8] c"cm\00"
@.str.4 = [3 x i8] c"mm\00"
@.str.5 = [3 x i8] c"eV\00"
@.str.6 = [2 x i8] c"J\00"
@.str.7 = [4 x i8] c"THz\00"
@.str.8 = [4 x i8] c"GHz\00"
@.str.9 = [3 x i8] c"Hz\00"
@.str.10 = [6 x i8] c"rad/s\00"
define i32 @convert_units_from_um(double* %0, i8* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i8*
store double* %0, double** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %108
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 0, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = fmul double %16, 1.000000e+03
store double %17, double* %15
br label %106
18: ; preds = %10
%19 = load i8*, i8** %5
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 0, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load double*, double** %4
%24 = load double, double* %23
%25 = fmul double %24, 0x3EB0C6F7A0B5ED8D
store double %25, double* %23
br label %105
26: ; preds = %18
%27 = load i8*, i8** %5
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 0, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load double*, double** %4
%32 = load double, double* %31
%33 = fmul double %32, 1.000000e-04
store double %33, double* %31
br label %104
34: ; preds = %26
%35 = load i8*, i8** %5
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i64 0, %36
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = load double*, double** %4
%40 = load double, double* %39
%41 = fmul double %40, 1.000000e-03
store double %41, double* %39
br label %103
42: ; preds = %34
%43 = load i8*, i8** %5
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 0, %44
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = load double*, double** %4
%48 = load double, double* %47
%49 = fdiv double 0x3FF3D663C014D249, %48
%50 = load double*, double** %4
store double %49, double* %50
br label %102
51: ; preds = %42
%52 = load i8*, i8** %5
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i64 0, %53
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = load double*, double** %4
%57 = load double, double* %56
%58 = fdiv double 0x3C0D50943428E06B, %57
%59 = load double*, double** %4
store double %58, double* %59
br label %101
60: ; preds = %51
%61 = load i8*, i8** %5
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%63 = icmp eq i64 0, %62
br i1 %63, label %64, label %69
64: ; preds = %60
%65 = load double*, double** %4
%66 = load double, double* %65
%67 = fdiv double 0x4072BCADE8709742, %66
%68 = load double*, double** %4
store double %67, double* %68
br label %100
69: ; preds = %60
%70 = load i8*, i8** %5
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%72 = icmp eq i64 0, %71
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = load double*, double** %4
%75 = load double, double* %74
%76 = fdiv double 0x41124C41D4FDF3B6, %75
%77 = load double*, double** %4
store double %76, double* %77
br label %99
78: ; preds = %69
%79 = load i8*, i8** %5
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%81 = icmp eq i64 0, %80
br i1 %81, label %82, label %87
82: ; preds = %78
%83 = load double*, double** %4
%84 = load double, double* %83
%85 = fdiv double 0x42F10A8DEF726800, %84
%86 = load double*, double** %4
store double %85, double* %86
br label %98
87: ; preds = %78
%88 = load i8*, i8** %5
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%90 = icmp eq i64 0, %89
br i1 %90, label %91, label %96
91: ; preds = %87
%92 = load double*, double** %4
%93 = load double, double* %92
%94 = fdiv double 0x431AC4AF3A3340D5, %93
%95 = load double*, double** %4
store double %94, double* %95
br label %97
96: ; preds = %87
store i32 2, i32* %3
br label %108
97: ; preds = %91
br label %98
98: ; preds = %97, %82
br label %99
99: ; preds = %98, %73
br label %100
100: ; preds = %99, %64
br label %101
101: ; preds = %100, %55
br label %102
102: ; preds = %101, %46
br label %103
103: ; preds = %102, %38
br label %104
104: ; preds = %103, %30
br label %105
105: ; preds = %104, %22
br label %106
106: ; preds = %105, %14
br label %107
107: ; preds = %106
store i32 0, i32* %3
br label %108
108: ; preds = %107, %96, %9
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
@.str = [3 x i8] c"um\00"
@.str.1 = [3 x i8] c"nm\00"
@.str.2 = [2 x i8] c"m\00"
@.str.3 = [3 x i8] c"cm\00"
@.str.4 = [3 x i8] c"mm\00"
@.str.5 = [3 x i8] c"eV\00"
@.str.6 = [2 x i8] c"J\00"
@.str.7 = [4 x i8] c"THz\00"
@.str.8 = [4 x i8] c"GHz\00"
@.str.9 = [3 x i8] c"Hz\00"
@.str.10 = [6 x i8] c"rad/s\00"
define i32 @convert_units_from_um(double* nocapture %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %67, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load double, double* %0
%10 = fmul double %9, 1.000000e+03
br label %65
11: ; preds = %5
%12 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load double, double* %0
%16 = fmul double %15, 0x3EB0C6F7A0B5ED8D
br label %65
17: ; preds = %11
%18 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load double, double* %0
%22 = fmul double %21, 1.000000e-04
br label %65
23: ; preds = %17
%24 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load double, double* %0
%28 = fmul double %27, 1.000000e-03
br label %65
29: ; preds = %23
%30 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load double, double* %0
%34 = fdiv double 0x3FF3D663C014D249, %33
br label %65
35: ; preds = %29
%36 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load double, double* %0
%40 = fdiv double 0x3C0D50943428E06B, %39
br label %65
41: ; preds = %35
%42 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load double, double* %0
%46 = fdiv double 0x4072BCADE8709742, %45
br label %65
47: ; preds = %41
%48 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load double, double* %0
%52 = fdiv double 0x41124C41D4FDF3B6, %51
br label %65
53: ; preds = %47
%54 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load double, double* %0
%58 = fdiv double 0x42F10A8DEF726800, %57
br label %65
59: ; preds = %53
%60 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load double, double* %0
%64 = fdiv double 0x431AC4AF3A3340D5, %63
br label %65
65: ; preds = %8, %20, %32, %44, %56, %62, %50, %38, %26, %14
%66 = phi double [ %16, %14 ], [ %28, %26 ], [ %40, %38 ], [ %52, %50 ], [ %64, %62 ], [ %58, %56 ], [ %46, %44 ], [ %34, %32 ], [ %22, %20 ], [ %10, %8 ]
store double %66, double* %0
br label %67
67: ; preds = %65, %59, %2
%68 = phi i32 [ 0, %2 ], [ 2, %59 ], [ 0, %65 ]
ret i32 %68
}