#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*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_number(int);
int /*<<< orphan*/ output_with_tab(char *);
void gen_multiply(int type, int size) {
  switch (type) {
  case (2 << 2):
  case ((2 << 2) + 1):
    output_line("mul r1 2");
    break;
  case 2:
    output_with_tab("mul r1 ");
    output_number(size);
    newline();
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<gen_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     1187 <gen_multiply+0x47>
jmp    1162 <gen_multiply+0x22>
mov    -0xc(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x1,%eax
ja     11a7 <gen_multiply+0x67>
jmp    1176 <gen_multiply+0x36>
lea    0xe83(%rip),%rdi
call   1060 <output_line@plt>
jmp    11ac <gen_multiply+0x6c>
lea    0xe7b(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    -0x8(%rbp),%edi
call   1050 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
jmp    11ac <gen_multiply+0x6c>
jmp    11ac <gen_multiply+0x6c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_multiply>:
lea    -0x8(%rdi),%eax
cmp    $0x2,%eax
jae    1154 <gen_multiply+0x14>
lea    0xeb1(%rip),%rdi
jmp    1060 <output_line@plt>
cmp    $0x2,%edi
jne    1177 <gen_multiply+0x37>
push   %rbx
mov    %esi,%ebx
lea    0xea6(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    %ebx,%edi
call   1050 <output_number@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mul r1 2\00"
@.str.1 = [8 x i8] c"mul r1 \00"
define void @gen_multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %13 [
i32 8, label %6
i32 9, label %6
i32 2, label %8
]
6: ; preds = %2, %2
%7 = call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %14
8: ; preds = %2
%9 = call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 @output_number(i32 %10)
%12 = call i32 (...) @newline()
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %8, %6
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mul r1 2\00"
@.str.1 = [8 x i8] c"mul r1 \00"
define void @gen_multiply(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 8, label %3
i32 9, label %3
i32 2, label %5
]
3: ; preds = %2, %2
%4 = tail call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %2
%6 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @output_number(i32 %1)
%8 = tail call i32 (...) @newline()
br label %9
9: ; preds = %2, %5, %3
ret void
}