xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cgau7(double *, int, double *, double *, int, int);
void cgau7_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau7(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau7_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau7@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau7_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau7@plt>

LLVM IR (-O0):
define void @cgau7_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @cgau7(double* %11, i32 %12, double* %13, double* %17, i32 %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @cgau7_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau7(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
int cvmx_coremask_core_to_node(int core) {
  return (core >> (7)) & ((1 << (2)) - 1);
}


x86 assembly (clang, -O0):
<cvmx_coremask_core_to_node>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_coremask_core_to_node>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @cvmx_coremask_core_to_node(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
%5 = and i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @cvmx_coremask_core_to_node(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SOUND_init();
void MUSIC_init() { SOUND_init(); }


x86 assembly (clang, -O0):
<MUSIC_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SOUND_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MUSIC_init>:
xor    %eax,%eax
jmp    1030 <SOUND_init@plt>

LLVM IR (-O0):
define void @MUSIC_init() {
%1 = call i32 (...) @SOUND_init()
ret void
}

LLVM IR (-O2):
define void @MUSIC_init() {
%1 = tail call i32 (...) @SOUND_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char const *, int /*<<< orphan*/);
int journal_open_read(const char *filepath) { return open(filepath, O_RDONLY); }


x86 assembly (clang, -O0):
<journal_open_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<journal_open_read>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @journal_open_read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @journal_open_read(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *);
void afunc(void) {
  static int level = 0;
  auto int stack_var;
  if (++level == 3)
    return;
  printf("\tStack level %d: address of stack_var: %p\n", level, &stack_var);
  afunc();
}


x86 assembly (clang, -O0):
<afunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f06(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efd(%rip)
cmp    $0x3,%eax
jne    1145 <afunc+0x25>
jmp    1160 <afunc+0x40>
mov    0x2ee9(%rip),%esi
lea    0xeae(%rip),%rdi
lea    -0x4(%rbp),%rdx
call   1040 <printf@plt>
call   1030 <afunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afunc>:
push   %rax
mov    0x2f0d(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f04(%rip)
cmp    $0x3,%esi
je     114b <afunc+0x2b>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1040 <printf@plt>
call   1030 <afunc@plt>
pop    %rax
ret

LLVM IR (-O0):
@afunc.level = internal global i32 0
@.str = [43 x i8] c"\09Stack level %d: address of stack_var: %p\0A\00"
define void @afunc() {
%1 = alloca i32
%2 = load i32, i32* @afunc.level
%3 = add nsw i32 %2, 1
store i32 %3, i32* @afunc.level
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = load i32, i32* @afunc.level
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %1)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@afunc.level = internal unnamed_addr global i32 0
@.str = [43 x i8] c"\09Stack level %d: address of stack_var: %p\0A\00"
define void @afunc() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @afunc.level
%4 = add nsw i32 %3, 1
store i32 %4, i32* @afunc.level
%5 = icmp eq i32 %4, 3
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4, i32* %1)
br label %8
8: ; preds = %0, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_bill() {
  puts("bill [<guest name>]\n"
       "Prepares and displays the bill for the guest. Prompts for guest name\n"
       "if not provided as parameter.");
}


x86 assembly (clang, -O0):
<help_bill>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_bill>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [119 x i8] c"bill [<guest name>]\0APrepares and displays the bill for the guest. Prompts for guest name\0Aif not provided as parameter.\00"
define void @help_bill() {
%1 = call i32 @puts(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [119 x i8] c"bill [<guest name>]\0APrepares and displays the bill for the guest. Prompts for guest name\0Aif not provided as parameter.\00"
define void @help_bill() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int open_fifo(char *filename) {
  int fifo_fd;
  if ((fifo_fd = open(filename, O_RDONLY)) < 0) {
    return -1;
  }
  return fifo_fd;
}


x86 assembly (clang, -O0):
<open_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1146 <open_fifo+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <open_fifo+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fifo>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @open_fifo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @open_fifo(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Type definitions */
struct can_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct can_frame *, int /*<<< orphan*/, int);
void sdo_clear_frame(struct can_frame *frame) {
  memset(frame, 0, sizeof(*frame));
}


x86 assembly (clang, -O0):
<sdo_clear_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_clear_frame>:
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.can_frame = type { i32 }
define void @sdo_clear_frame(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = call i32 @memset(%struct.can_frame* %3, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32 }
define void @sdo_clear_frame(%struct.can_frame* %0) {
%2 = tail call i32 @memset(%struct.can_frame* %0, i32 0, i32 4)
ret void
}
int longjump(int v) {
  int *ebp = getebp();
  printf("CPU's ebp: %x\n", ebp);
  printf("Function's retPC: %x, Function's oldFP: %x\n", ebp, ebp + 1);
  return v;
}


x86 assembly (clang, -O0):
<longjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getebp@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longjump>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <getebp@plt>
movslq %eax,%rbx
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbx),%rdx
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"CPU's ebp: %x\0A\00"
@.str.1 = [44 x i8] c"Function's retPC: %x, Function's oldFP: %x\0A\00"
define i32 @longjump(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32 (...) @getebp()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32* %9, i32* %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"CPU's ebp: %x\0A\00"
@.str.1 = [44 x i8] c"Function's retPC: %x, Function's oldFP: %x\0A\00"
define i32 @longjump(i32 returned %0) {
%2 = tail call i32 (...) @getebp()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %6)
ret i32 %0
}
void *_testfunc_c_p_p(int *argcp, char **argv) { return argv[(*argcp) - 1]; }


x86 assembly (clang, -O0):
<_testfunc_c_p_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_testfunc_c_p_p>:
movslq (%rdi),%rax
mov    -0x8(%rsi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @_testfunc_c_p_p(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %5, i64 %9
%11 = load i8*, i8** %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @_testfunc_c_p_p(i32* nocapture %0, i8** nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %1, i64 %5
%7 = load i8*, i8** %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int main(void) {
  int i, j;
  i = 0;
  while (1) {
    __CRAB_assert(i >= 0);
    j = 0;
    while (j < 10) {
      j++;
    }
    i = i + 11 - j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1156 <main+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x2e>
mov    -0x8(%rbp),%eax
add    $0xb,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
shr    $0x1f,%edi
call   1030 <__CRAB_assert@plt>
add    $0xffffffff,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %0, %15
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__CRAB_assert(i32 %7)
store i32 0, i32* %3
br label %9
9: ; preds = %12, %4
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %9
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 11
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @__CRAB_assert(i32 %4)
%6 = add i32 %2, 1
br label %1
}
unsigned long I2CMasterErr(unsigned long ulBase) {
  unsigned long ulErr;
  ;
  ulErr = (*((volatile unsigned long *)(ulBase + 0x00000004)));
  if (ulErr & 0x00000001) {
    return (0);
  }
  if (ulErr & (0x00000002 | 0x00000010)) {
    return (ulErr & (0x00000010 | 0x00000008 | 0x00000004));
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2CMasterErr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1133 <I2CMasterErr+0x33>
movq   $0x0,-0x8(%rbp)
jmp    115e <I2CMasterErr+0x5e>
mov    -0x18(%rbp),%rax
and    $0x12,%rax
cmp    $0x0,%rax
je     1156 <I2CMasterErr+0x56>
mov    -0x18(%rbp),%rax
and    $0x1c,%rax
mov    %rax,-0x8(%rbp)
jmp    115e <I2CMasterErr+0x5e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterErr>:
mov    0x4(%rdi),%rcx
mov    %ecx,%eax
and    $0x12,%eax
mov    %ecx,%edx
and    $0x1c,%edx
test   %rax,%rax
cmove  %rax,%rdx
xor    %eax,%eax
test   $0x1,%cl
cmove  %rdx,%rax
ret

LLVM IR (-O0):
define i64 @I2CMasterErr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 4
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = and i64 %9, 1
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i64 0, i64* %2
br label %21
13: ; preds = %1
%14 = load i64, i64* %4
%15 = and i64 %14, 18
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i64, i64* %4
%19 = and i64 %18, 28
store i64 %19, i64* %2
br label %21
20: ; preds = %13
store i64 0, i64* %2
br label %21
21: ; preds = %20, %17, %12
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @I2CMasterErr(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = and i64 %4, 18
%8 = icmp eq i64 %7, 0
%9 = or i1 %6, %8
%10 = and i64 %4, 28
%11 = select i1 %9, i64 0, i64 %10
ret i64 %11
}
__attribute__((no_sanitize("implicit-integer-truncation"))) unsigned char
blacklist_3(unsigned int src) {
  return src;
}


x86 assembly (clang, -O0):
<blacklist_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blacklist_3>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @blacklist_3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @blacklist_3(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
int isOpeningBracket(char ch) {
  if (ch == '{' || ch == '[' || ch == '(')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isOpeningBracket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
je     1131 <isOpeningBracket+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x5b,%eax
je     1131 <isOpeningBracket+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
jne    113d <isOpeningBracket+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isOpeningBracket+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOpeningBracket>:
mov    $0x1,%eax
cmp    $0x28,%dil
je     1119 <isOpeningBracket+0x19>
cmp    $0x5b,%dil
je     1119 <isOpeningBracket+0x19>
cmp    $0x7b,%dil
je     1119 <isOpeningBracket+0x19>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isOpeningBracket(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 123
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 91
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 40
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isOpeningBracket(i8 signext %0) {
switch i8 %0, label %2 [
i8 123, label %3
i8 91, label %3
i8 40, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
double SIM_power_gatecap(double, double);
double SIM_array_pre_cap(double width, double length) {
  return SIM_power_gatecap(width, length);
}


x86 assembly (clang, -O0):
<SIM_array_pre_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <SIM_power_gatecap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_pre_cap>:
jmp    1030 <SIM_power_gatecap@plt>

LLVM IR (-O0):
define double @SIM_array_pre_cap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @SIM_power_gatecap(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @SIM_array_pre_cap(double %0, double %1) {
%3 = tail call double @SIM_power_gatecap(double %0, double %1)
ret double %3
}
int unlink(char *path) {}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
ret

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @unlink(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write(int, void *, int);
void *thrfunc(void *arg) {
  int i;
  fprintf(stderr, "Starting thread %d\n", *(int *)arg);
  for (i = 1; i <= 10000; i++)
    write(2, arg, 1);
  return NULL;
}


x86 assembly (clang, -O0):
<thrfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jg     117c <thrfunc+0x5c>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <thrfunc+0x2e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrfunc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2710,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebp
jne    1150 <thrfunc+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Starting thread %d\0A\00"
define i8* @thrfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 1, i32* %3
br label %9
9: ; preds = %15, %1
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 10000
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = call i32 @write(i32 2, i8* %13, i32 1)
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %9
18: ; preds = %9
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Starting thread %d\0A\00"
define noalias i8* @thrfunc(i8* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %1, %6
%7 = phi i32 [ 1, %1 ], [ %9, %6 ]
%8 = tail call i32 @write(i32 2, i8* %0, i32 1)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 10001
br i1 %10, label %11, label %6
11: ; preds = %6
ret i8* null
}
double best_fit_ratio(double a_width, double a_height, double b_width,
                      double b_height) {
  if (a_width / a_height < b_width / b_height) {
    return b_height / a_height;
  } else {
    return b_width / a_width;
  }
}


x86 assembly (clang, -O0):
<best_fit_ratio>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <best_fit_ratio+0x4a>
movsd  -0x28(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <best_fit_ratio+0x59>
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<best_fit_ratio>:
movapd %xmm0,%xmm4
unpcklpd %xmm2,%xmm4
movapd %xmm1,%xmm5
unpcklpd %xmm3,%xmm5
divpd  %xmm5,%xmm4
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
ucomisd %xmm4,%xmm5
jbe    112b <best_fit_ratio+0x2b>
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
ret
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @best_fit_ratio(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %6
%11 = load double, double* %7
%12 = fdiv double %10, %11
%13 = load double, double* %8
%14 = load double, double* %9
%15 = fdiv double %13, %14
%16 = fcmp olt double %12, %15
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load double, double* %9
%19 = load double, double* %7
%20 = fdiv double %18, %19
store double %20, double* %5
br label %25
21: ; preds = %4
%22 = load double, double* %8
%23 = load double, double* %6
%24 = fdiv double %22, %23
store double %24, double* %5
br label %25
25: ; preds = %21, %17
%26 = load double, double* %5
ret double %26
}

LLVM IR (-O2):
define double @best_fit_ratio(double %0, double %1, double %2, double %3) {
%5 = insertelement <2 x double> poison, double %0, i64 0
%6 = insertelement <2 x double> %5, double %2, i64 1
%7 = insertelement <2 x double> poison, double %1, i64 0
%8 = insertelement <2 x double> %7, double %3, i64 1
%9 = fdiv <2 x double> %6, %8
%10 = extractelement <2 x double> %9, i64 0
%11 = extractelement <2 x double> %9, i64 1
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = fdiv double %3, %1
br label %17
15: ; preds = %4
%16 = fdiv double %2, %0
br label %17
17: ; preds = %15, %13
%18 = phi double [ %14, %13 ], [ %16, %15 ]
ret double %18
}
/* Variables and functions */
int /*<<< orphan*/ luaL_nonnullarg(int);
int /*<<< orphan*/ lua_pushobject(int /*<<< orphan*/);
int /*<<< orphan*/ lua_rawsettable();
void rawsettable(void) {
  lua_pushobject(luaL_nonnullarg(1));
  lua_pushobject(luaL_nonnullarg(2));
  lua_pushobject(luaL_nonnullarg(3));
  lua_rawsettable();
}


x86 assembly (clang, -O0):
<rawsettable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x2,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x3,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x0,%al
call   1030 <lua_rawsettable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rawsettable>:
push   %rax
mov    $0x1,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x2,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
mov    $0x3,%edi
call   1040 <luaL_nonnullarg@plt>
mov    %eax,%edi
call   1050 <lua_pushobject@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lua_rawsettable@plt>

LLVM IR (-O0):
define void @rawsettable() {
%1 = call i32 @luaL_nonnullarg(i32 1)
%2 = call i32 @lua_pushobject(i32 %1)
%3 = call i32 @luaL_nonnullarg(i32 2)
%4 = call i32 @lua_pushobject(i32 %3)
%5 = call i32 @luaL_nonnullarg(i32 3)
%6 = call i32 @lua_pushobject(i32 %5)
%7 = call i32 (...) @lua_rawsettable()
ret void
}

LLVM IR (-O2):
define void @rawsettable() {
%1 = tail call i32 @luaL_nonnullarg(i32 1)
%2 = tail call i32 @lua_pushobject(i32 %1)
%3 = tail call i32 @luaL_nonnullarg(i32 2)
%4 = tail call i32 @lua_pushobject(i32 %3)
%5 = tail call i32 @luaL_nonnullarg(i32 3)
%6 = tail call i32 @lua_pushobject(i32 %5)
%7 = tail call i32 (...) @lua_rawsettable()
ret void
}
int fun_3_in_release_so(int x, int y, int z) { return 20 + x + y + z; }


x86 assembly (clang, -O0):
<fun_3_in_release_so>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_3_in_release_so>:
add    %esi,%edi
lea    (%rdx,%rdi,1),%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_3_in_release_so(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = add nsw i32 20, %7
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fun_3_in_release_so(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 20
%5 = add nsw i32 %4, %1
%6 = add nsw i32 %5, %2
ret i32 %6
}
int test_imm_44uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x44,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_44uint64_midword_mem>:
testb  $0x44,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_44uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 68
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_44uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4456448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ StartCfgTool(char *);
void SPUabout(void) { StartCfgTool("ABOUT"); }


x86 assembly (clang, -O0):
<SPUabout>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <StartCfgTool@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPUabout>:
lea    0xee9(%rip),%rdi
jmp    1030 <StartCfgTool@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ABOUT\00"
define void @SPUabout() {
%1 = call i32 @StartCfgTool(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ABOUT\00"
define void @SPUabout() {
%1 = tail call i32 @StartCfgTool(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void clr_sleep_mode(void) {}


x86 assembly (clang, -O0):
<clr_sleep_mode>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_sleep_mode>:
ret

LLVM IR (-O0):
define void @clr_sleep_mode() {
ret void
}

LLVM IR (-O2):
define void @clr_sleep_mode() {
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int pegasus_gettimeofday(struct timeval *tv) { return gettimeofday(tv, NULL); }


x86 assembly (clang, -O0):
<pegasus_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pegasus_gettimeofday>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @pegasus_gettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @pegasus_gettimeofday(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret i32 %2
}
int test_imm_A1int16_mem(short *val) {
  return ((*val) & (-0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A1int16_mem>:
movzwl (%rdi),%eax
test   $0xff5f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A1int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -161
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_A1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -161
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool checkFirstSquareBracket(const char character) {
  return (character == '[') ? true : false;
}


x86 assembly (clang, -O0):
<checkFirstSquareBracket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x5b,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFirstSquareBracket>:
xor    %eax,%eax
cmp    $0x5b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @checkFirstSquareBracket(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 91
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @checkFirstSquareBracket(i8 signext %0) {
%2 = icmp eq i8 %0, 91
%3 = zext i1 %2 to i32
ret i32 %3
}
const char *ls_costN_nm9_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm9_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm9_name_in+0x27>
jmp    1117 <ls_costN_nm9_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm9_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm9_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm9_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
void delete_red_strip(int rows, int cols, char grid[rows][cols], int row,
                      int col, int filled) {
  int i;
  for (i = col; i < col + filled; i++) {
    grid[row][i] = '.';
  }
}


x86 assembly (clang, -O0):
<delete_red_strip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    1160 <delete_red_strip+0x60>
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movb   $0x2e,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1126 <delete_red_strip+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_red_strip>:
test   %r9d,%r9d
jle    1152 <delete_red_strip+0x42>
push   %rax
add    %r8d,%r9d
mov    %esi,%eax
movslq %ecx,%rcx
imul   %rax,%rcx
movslq %r8d,%rax
add    %rax,%rcx
add    %rcx,%rdx
lea    0x1(%rax),%ecx
cmp    %ecx,%r9d
cmovle %ecx,%r9d
not    %eax
add    %r9d,%eax
add    $0x1,%rax
mov    %rdx,%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @delete_red_strip(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = load i32, i32* %8
%17 = zext i32 %16 to i64
%18 = load i32, i32* %11
store i32 %18, i32* %13
br label %19
19: ; preds = %34, %6
%20 = load i32, i32* %13
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %37
25: ; preds = %19
%26 = load i8*, i8** %9
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = mul nsw i64 %28, %17
%30 = getelementptr inbounds i8, i8* %26, i64 %29
%31 = load i32, i32* %13
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 46, i8* %33
br label %34
34: ; preds = %25
%35 = load i32, i32* %13
%36 = add nsw i32 %35, 1
store i32 %36, i32* %13
br label %19
37: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @delete_red_strip(i32 %0, i32 %1, i8* nocapture writeonly %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %22
8: ; preds = %6
%9 = add i32 %5, %4
%10 = zext i32 %1 to i64
%11 = sext i32 %3 to i64
%12 = mul nsw i64 %11, %10
%13 = sext i32 %4 to i64
%14 = add nsw i64 %12, %13
%15 = getelementptr i8, i8* %2, i64 %14
%16 = add i32 %4, 1
%17 = call i32 @llvm.smax.i32(i32 %9, i32 %16)
%18 = xor i32 %4, -1
%19 = add i32 %17, %18
%20 = zext i32 %19 to i64
%21 = add nuw nsw i64 %20, 1
br label %22
22: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void smallAdjustmentGE(unsigned a) {
  char *b = ((void *)0);
  if (a + 2 >= 1)
    b = malloc(1);
  if (a == (0x7fffffff * 2U + 1U) - 1)
    return;
  else if (a < (0x7fffffff * 2U + 1U) - 1 || a == (0x7fffffff * 2U + 1U))
    free(b);
  return;
}


x86 assembly (clang, -O0):
<smallAdjustmentGE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jb     1150 <smallAdjustmentGE+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
jne    115f <smallAdjustmentGE+0x3f>
jmp    1186 <smallAdjustmentGE+0x66>
cmpl   $0xfffffffe,-0x4(%rbp)
jb     1173 <smallAdjustmentGE+0x53>
cmpl   $0xffffffff,-0x4(%rbp)
jne    117c <smallAdjustmentGE+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1181 <smallAdjustmentGE+0x61>
jmp    1186 <smallAdjustmentGE+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallAdjustmentGE>:
cmp    $0xfffffffe,%edi
jne    1126 <smallAdjustmentGE+0x6>
ret
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @smallAdjustmentGE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = add i32 %4, 2
%6 = icmp uge i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, -2
br i1 %11, label %12, label %13
12: ; preds = %9
br label %24
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp ult i32 %14, -2
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %16, %13
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23, %12
ret void
}

LLVM IR (-O2):
define void @smallAdjustmentGE(i32 %0) {
%2 = icmp eq i32 %0, -2
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
int eval_mul(int a1, int a2) { return a1 * a2; }


x86 assembly (clang, -O0):
<eval_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @eval_mul(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
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @eval_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t inw(uint16_t addr) {
  uint16_t val;
  __asm__ __volatile__("inw %%dx,%%ax" : "=a"(val) : "d"(addr));
  return val;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%ax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %rdi,%rdx
in     (%dx),%ax
ret

LLVM IR (-O0):
define i8* @inw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "inw %dx,%ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inw(i8* %0) {
%2 = tail call i8* asm sideeffect "inw %dx,%ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ tb_change_cell(int /*<<< orphan*/, int /*<<< orphan*/, char,
                                  int /*<<< orphan*/, int);
int /*<<< orphan*/ tb_clear();
int /*<<< orphan*/ tb_present();
void draw() {
  tb_clear();
  tb_change_cell(0, 0, 'A', 0, 1);
  tb_present();
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tb_clear@plt>
xor    %ecx,%ecx
mov    $0x41,%edx
mov    $0x1,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
call   1050 <tb_change_cell@plt>
mov    $0x0,%al
call   1030 <tb_present@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rax
xor    %eax,%eax
call   1040 <tb_clear@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x41,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1050 <tb_change_cell@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tb_present@plt>

LLVM IR (-O0):
define void @draw() {
%1 = call i32 (...) @tb_clear()
%2 = call i32 @tb_change_cell(i32 0, i32 0, i8 signext 65, i32 0, i32 1)
%3 = call i32 (...) @tb_present()
ret void
}

LLVM IR (-O2):
define void @draw() {
%1 = tail call i32 (...) @tb_clear()
%2 = tail call i32 @tb_change_cell(i32 0, i32 0, i8 signext 65, i32 0, i32 1)
%3 = tail call i32 (...) @tb_present()
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
scalar_t__ strlen(char const *);
bool endsWith(const char *string, const char *suffix) {
  string += strlen(string) - strlen(suffix);
  return strcmp(string, suffix) == 0;
}


x86 assembly (clang, -O0):
<endsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %rax,%rbx
add    %r15,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @endsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %6, %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 %9
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @endsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = sub nsw i64 %3, %4
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i64 @strcmp(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void foo_2_1_1_2_1_1_2_1_2() {}


x86 assembly (clang, -O0):
<foo_2_1_1_2_1_1_2_1_2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_2_1_1_2_1_1_2_1_2>:
ret

LLVM IR (-O0):
define void @foo_2_1_1_2_1_1_2_1_2() {
ret void
}

LLVM IR (-O2):
define void @foo_2_1_1_2_1_1_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int err(const char *msg) {
  fprintf(stderr, "error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define i32 @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define i32 @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}