xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vobb(int);
int main(int argc, const char *argv[]) {
  printf("In main\n");
  vobb(argc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <vobb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1030 <vobb@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"In main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @vobb(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"In main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @vobb(i32 %0)
ret i32 0
}
void my_qc_kernel_hal_dummy_function(void) {}


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

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

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

LLVM IR (-O2):
define void @my_qc_kernel_hal_dummy_function() {
ret void
}
void ProjectOverlay(const float localTextureAxis[2], char *lump) {
  const void *d = &localTextureAxis;
  int size = sizeof(float) * 8;
  __builtin_memcpy(&lump[0], d, size);
}


x86 assembly (clang, -O0):
<ProjectOverlay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x20,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProjectOverlay>:
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ProjectOverlay(float* %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to float**
store float* %0, float** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_add_byte(char);
int /*<<< orphan*/ term_add_bytes(char *, int);
int /*<<< orphan*/ term_add_uint(unsigned int);
void ecma48_move_cursor(unsigned int x, unsigned int y) {
  term_add_bytes("\033[", (sizeof(""
                                  "\033["
                                  "") -
                           1));
  term_add_uint(y + 1);
  if (x != 0) {
    term_add_byte(';');
    term_add_uint(x + 1);
  }
  term_add_byte('H');
}


x86 assembly (clang, -O0):
<ecma48_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x2,%esi
call   1030 <term_add_bytes@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1050 <term_add_uint@plt>
cmpl   $0x0,-0x4(%rbp)
je     1179 <ecma48_move_cursor+0x49>
mov    $0x3b,%edi
call   1040 <term_add_byte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1050 <term_add_uint@plt>
mov    $0x48,%edi
call   1040 <term_add_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecma48_move_cursor>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xec2(%rip),%rdi
mov    $0x2,%esi
call   1030 <term_add_bytes@plt>
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <term_add_uint@plt>
test   %ebx,%ebx
je     116a <ecma48_move_cursor+0x3a>
mov    $0x3b,%edi
call   1040 <term_add_byte@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1050 <term_add_uint@plt>
mov    $0x48,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <term_add_byte@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1B[\00"
define void @ecma48_move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @term_add_bytes(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = load i32, i32* %4
%7 = add i32 %6, 1
%8 = call i32 @term_add_uint(i32 %7)
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = call i32 @term_add_byte(i8 signext 59)
%13 = load i32, i32* %3
%14 = add i32 %13, 1
%15 = call i32 @term_add_uint(i32 %14)
br label %16
16: ; preds = %11, %2
%17 = call i32 @term_add_byte(i8 signext 72)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B[\00"
define void @ecma48_move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @term_add_bytes(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = add i32 %1, 1
%5 = tail call i32 @term_add_uint(i32 %4)
%6 = icmp eq i32 %0, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @term_add_byte(i8 signext 59)
%9 = add i32 %0, 1
%10 = tail call i32 @term_add_uint(i32 %9)
br label %11
11: ; preds = %7, %2
%12 = tail call i32 @term_add_byte(i8 signext 72)
ret void
}
/* Variables and functions */
int EACCES;
int EAGAIN;
int EROFS;
char Platform_Inaccessible(int e) {
  char _o_result;
  _o_result = (e == EACCES || e == EROFS) || e == EAGAIN;
  return _o_result;
}


x86 assembly (clang, -O0):
<Platform_Inaccessible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ecd(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x6(%rbp)
je     1147 <Platform_Inaccessible+0x47>
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ebe(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x6(%rbp)
je     1147 <Platform_Inaccessible+0x47>
mov    -0x4(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_Inaccessible>:
mov    0x2ed9(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ed5(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
mov    0x2ea7(%rip),%rax
cmp    %edi,(%rax)
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
@EACCES = global i32 0
@EROFS = global i32 0
@EAGAIN = global i32 0
define signext i8 @Platform_Inaccessible(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @EACCES
%6 = icmp eq i32 %4, %5
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* @EROFS
%10 = icmp eq i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* @EAGAIN
%14 = icmp eq i32 %12, %13
br label %15
15: ; preds = %11, %7, %1
%16 = phi i1 [ true, %7 ], [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
@EACCES = global i32 0
@EROFS = global i32 0
@EAGAIN = global i32 0
define signext i8 @Platform_Inaccessible(i32 %0) {
%2 = load i32, i32* @EACCES
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @EROFS
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @EAGAIN
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/ *);
int getgroups(int count, gid_t list[]) { return syscall(205, count, list); }


x86 assembly (clang, -O0):
<getgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0xcd,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgroups>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xcd,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getgroups(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 = call i32 @syscall(i32 205, i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @getgroups(i32 %0, i32* %1) {
%3 = tail call i32 @syscall(i32 205, i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Dcreate(void *loc_id, const char *name, void *dtype_id, void *space_id,
                void *lcpl_id, void *dcpl_id, void *dapl_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Dclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Dcreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Dcreate>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Dclose\00"
define i8* @H5Dcreate(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%16 = call i8* @__coverity_alloc__(i32 10)
store i8* %16, i8** %15
%17 = load i8*, i8** %15
%18 = call i32 @__coverity_mark_as_afm_allocated__(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %15
ret i8* %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Dclose\00"
define i8* @H5Dcreate(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6) {
%8 = tail call i8* @__coverity_alloc__(i32 10)
%9 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int bar(int ip[]) { return ip[0]; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int test_imm_9Buint16_mem(unsigned short *val) {
  return ((*val) & (0x9B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Buint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 155
%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_9Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 155
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ run(char *, char const *, char const *);
void move(const char *source_path, const char *target_path) {
  run("mv \"%s\" \"%s\"", source_path, target_path);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <run@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <run@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"mv \22%s\22 \22%s\22\00"
define void @move(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 = load i8*, i8** %4
%7 = call i32 @run(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"mv \22%s\22 \22%s\22\00"
define void @move(i8* %0, i8* %1) {
%3 = tail call i32 @run(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
char *copy_bytes_2(char *dst, char *src) {
  dst[0] = src[1];
  dst[1] = src[0];
  return dst + 2;
}


x86 assembly (clang, -O0):
<copy_bytes_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_bytes_2>:
mov    0x1(%rsi),%al
mov    %al,(%rdi)
mov    (%rsi),%al
mov    %al,0x1(%rdi)
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @copy_bytes_2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
ret i8* %16
}

LLVM IR (-O2):
define i8* @copy_bytes_2(i8* writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = load i8, i8* %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %7
}
/* Variables and functions */
char tolower(unsigned char);
char *strlwr(char *in) {
  char *p;
  for (p = in; *p; p++)
    *p = tolower((unsigned char)*p);
  return in;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %14, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @tolower(i8 zeroext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
br label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %5
17: ; preds = %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
void g_hash_table_lookup_extended() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_lookup_extended() {
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int, int);
void my_isr(int n) {
  printf("in isr pid=%d ppid=%d signal#=%d\n", getpid(), getppid(), n);
}


x86 assembly (clang, -O0):
<my_isr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeb4(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"in isr pid=%d ppid=%d signal#=%d\0A\00"
define void @my_isr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 (...) @getppid()
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"in isr pid=%d ppid=%d signal#=%d\0A\00"
define void @my_isr(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %0)
ret void
}
char rot(char c) {
  if ((c < 'a' + 13 && c >= 'a') || (c < 'A' + 13 && c >= 'A')) {
    c = c + 13;
  } else if ((c >= 'a' + 13 && c <= 'z') || (c >= 'A' + 13 && c <= 'Z')) {
    c = c - 13;
  }
  return c;
}


x86 assembly (clang, -O0):
<rot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x6e,%eax
jge    1124 <rot+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jge    113e <rot+0x3e>
movsbl -0x1(%rbp),%eax
cmp    $0x4e,%eax
jge    114d <rot+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     114d <rot+0x4d>
movsbl -0x1(%rbp),%eax
add    $0xd,%eax
mov    %al,-0x1(%rbp)
jmp    1190 <rot+0x90>
movsbl -0x1(%rbp),%eax
cmp    $0x6e,%eax
jl     1167 <rot+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jle    1181 <rot+0x81>
movsbl -0x1(%rbp),%eax
cmp    $0x4e,%eax
jl     118b <rot+0x8b>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     118b <rot+0x8b>
movsbl -0x1(%rbp),%eax
sub    $0xd,%eax
mov    %al,-0x1(%rbp)
jmp    1190 <rot+0x90>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot>:
mov    %edi,%eax
mov    %eax,%ecx
and    $0xdf,%cl
lea    -0x41(%rcx),%edx
cmp    $0xc,%dl
ja     1112 <rot+0x12>
add    $0xd,%al
ret
add    $0xb2,%cl
lea    -0xd(%rax),%edx
cmp    $0xd,%cl
movzbl %al,%ecx
movzbl %dl,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @rot(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 110
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 97
br i1 %9, label %18, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %12, 78
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 65
br i1 %17, label %18, label %23
18: ; preds = %14, %6
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = add nsw i32 %20, 13
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %45
23: ; preds = %14, %10
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 110
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 122
br i1 %30, label %39, label %31
31: ; preds = %27, %23
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp sge i32 %33, 78
br i1 %34, label %35, label %44
35: ; preds = %31
%36 = load i8, i8* %2
%37 = sext i8 %36 to i32
%38 = icmp sle i32 %37, 90
br i1 %38, label %39, label %44
39: ; preds = %35, %27
%40 = load i8, i8* %2
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, 13
%43 = trunc i32 %42 to i8
store i8 %43, i8* %2
br label %44
44: ; preds = %39, %35, %31
br label %45
45: ; preds = %44, %18
%46 = load i8, i8* %2
ret i8 %46
}

LLVM IR (-O2):
define signext i8 @rot(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 13
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nuw nsw i8 %0, 13
br label %12
7: ; preds = %1
%8 = add i8 %2, -78
%9 = icmp ult i8 %8, 13
%10 = add i8 %0, -13
%11 = select i1 %9, i8 %10, i8 %0
br label %12
12: ; preds = %7, %5
%13 = phi i8 [ %6, %5 ], [ %11, %7 ]
ret i8 %13
}
/* Variables and functions */
char *calloc(int, int);
int make_packet(char *, char *, int *);
int socket_connect(char *, int);
int main(int argc, char *argv[]) {
  int i;
  int packet_len;
  int sock;
  int body_len;
  char *packet = calloc(sizeof(char), 1024 * 1024);
  char *f_name = '/etc/snmp';
  sock = socket_connect("104.20.209.21", 80);
  packet_len = make_packet(packet, f_name, &body_len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x100000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x736e6d70,%eax
mov    %rax,-0x30(%rbp)
lea    0xe97(%rip),%rdi
mov    $0x50,%esi
call   1050 <socket_connect@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <make_packet@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x100000,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xeb2(%rip),%rdi
mov    $0x50,%esi
call   1050 <socket_connect@plt>
lea    0xc(%rsp),%rdx
mov    $0x736e6d70,%esi
mov    %rbx,%rdi
call   1030 <make_packet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"104.20.209.21\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i8* @calloc(i32 1, i32 1048576)
store i8* %12, i8** %10
store i8* inttoptr (i64 1936616816 to i8*), i8** %11
%13 = call i32 @socket_connect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 80)
store i32 %13, i32* %8
%14 = load i8*, i8** %10
%15 = load i8*, i8** %11
%16 = call i32 @make_packet(i8* %14, i8* %15, i32* %9)
store i32 %16, i32* %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"104.20.209.21\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call dereferenceable_or_null(1048576) i8* @calloc(i32 1, i32 1048576)
%6 = tail call i32 @socket_connect(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 80)
%7 = call i32 @make_packet(i8* %5, i8* inttoptr (i64 1936616816 to i8*), i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ do_log(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tidy_pid();
void exit_handler(int sig) {
  tidy_pid();
  do_log(LOG_ERR, "caught signal %d - exiting", sig);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tidy_pid@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1040 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <tidy_pid@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    %ebx,%edx
call   1040 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"caught signal %d - exiting\00"
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tidy_pid()
%4 = load i32, i32* @LOG_ERR
%5 = load i32, i32* %2
%6 = call i32 @do_log(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [27 x i8] c"caught signal %d - exiting\00"
define void @exit_handler(i32 %0) {
%2 = tail call i32 (...) @tidy_pid()
%3 = load i32, i32* @LOG_ERR
%4 = tail call i32 @do_log(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int xstrcmp(char *, char *);
int strpcmp(const void *a, const void *b) {
  return xstrcmp(*(char **)a, *(char **)b);
}


x86 assembly (clang, -O0):
<strpcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <xstrcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <xstrcmp@plt>

LLVM IR (-O0):
define i32 @strpcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @xstrcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strpcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @xstrcmp(i8* %4, i8* %6)
ret i32 %7
}
void Interrupt_USBI0(void) {}


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

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

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

LLVM IR (-O2):
define void @Interrupt_USBI0() {
ret void
}
/* Variables and functions */
bool executeQuit(void) { return false; }


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

x86 assembly (clang, -O2):
<executeQuit>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @executeQuit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @executeQuit() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  return _mm_cmpeq_epi8(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_cmpeq_epi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cmpeq_epi8@plt>

LLVM IR (-O0):
define i32 @test(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 = call i32 @_mm_cmpeq_epi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
void multiply(unsigned int a, unsigned int b) {
  unsigned int total = 0;
  total = a * b;
  printf("%d * %d = %d\n", a, b, total);
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mov    %esi,%edx
mov    %edi,%esi
mov    %edx,%ecx
imul   %edi,%ecx
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @multiply(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
double UINT_MAX;
double uint_to_double(unsigned int big_int) {
  return (double)big_int / UINT_MAX;
}


x86 assembly (clang, -O0):
<uint_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    0x2ed2(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_to_double>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mov    0x2eda(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@UINT_MAX = global double 0.000000e+00
define double @uint_to_double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to double
%5 = load double, double* @UINT_MAX
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@UINT_MAX = global double 0.000000e+00
define double @uint_to_double(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = load double, double* @UINT_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ colle(int, int);
int main(void) {
  colle(10, 25);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x19,%esi
call   1030 <colle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x19,%esi
call   1030 <colle@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @colle(i32 10, i32 25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @colle(i32 10, i32 25)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_call() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_request_call_context_call>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_call>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_call() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_call() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
size_t packet_size_4gfsk_tx() { return (0x00 << 8) + 0x7C; }


x86 assembly (clang, -O0):
<packet_size_4gfsk_tx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_size_4gfsk_tx>:
mov    $0x7c,%eax
ret

LLVM IR (-O0):
define i64 @packet_size_4gfsk_tx() {
ret i64 124
}

LLVM IR (-O2):
define i64 @packet_size_4gfsk_tx() {
ret i64 124
}
int do_166() { return 166; }


x86 assembly (clang, -O0):
<do_166>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_166>:
mov    $0xa6,%eax
ret

LLVM IR (-O0):
define i32 @do_166() {
ret i32 166
}

LLVM IR (-O2):
define i32 @do_166() {
ret i32 166
}
/* Variables and functions */
unsigned int getBitAt(unsigned int, int);
int countBits(unsigned int bitmap, unsigned int bitValue) {
  int count = 0;
  for (int i = 0; i < 32; i++) {
    if (getBitAt(bitmap, i) == bitValue) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<countBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    1166 <countBits+0x56>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <getBitAt@plt>
cmp    -0x8(%rbp),%eax
jne    1153 <countBits+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <countBits+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <countBits+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBits>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <getBitAt@plt>
xor    %ecx,%ecx
cmp    %r14d,%eax
sete   %cl
add    %ecx,%ebp
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1130 <countBits+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countBits(i32 %0, i32 %1) {
br label %4
3: ; preds = %4
ret i32 %10
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %11, %4 ]
%6 = phi i32 [ 0, %2 ], [ %10, %4 ]
%7 = tail call i32 @getBitAt(i32 %0, i32 %5)
%8 = icmp eq i32 %7, %1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 32
br i1 %12, label %3, label %4
}
int test_imm_9Fint64_lowword_mem(long long *val) {
  return ((*val) & (0x9F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Fint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 159
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int os_perf_allstop();
int perf_allstop(void) { return (os_perf_allstop()); }


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

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

LLVM IR (-O0):
define i32 @perf_allstop() {
%1 = call i32 (...) @os_perf_allstop()
ret i32 %1
}

LLVM IR (-O2):
define i32 @perf_allstop() {
%1 = tail call i32 (...) @os_perf_allstop()
ret i32 %1
}
void drawPixel(int x, int y, int color) {
  *((volatile unsigned long *)(0xB8000000 + 0x008)) = (x << 16) | y;
  *((volatile unsigned long *)(0xB8000000 + 0x010)) = color;
  *((volatile unsigned long *)(0xB8000000 + 0x000)) |= 1;
  *((volatile unsigned long *)(0xB8000000 + 0x000)) &= ~1;
}


x86 assembly (clang, -O0):
<drawPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
movslq %eax,%rcx
mov    $0xb8000008,%eax
mov    %rcx,(%rax)
movslq -0xc(%rbp),%rcx
mov    $0xb8000010,%eax
mov    %rcx,(%rax)
mov    $0xb8000000,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0xb8000000,%eax
mov    %rcx,(%rax)
mov    $0xb8000000,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xb8000000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawPixel>:
shl    $0x10,%edi
or     %esi,%edi
movslq %edi,%rax
mov    $0xb8000000,%ecx
mov    %rax,0x8(%rcx)
movslq %edx,%rax
mov    %rax,0x10(%rcx)
orq    $0x1,(%rcx)
andq   $0xfffffffffffffffe,(%rcx)
ret

LLVM IR (-O0):
define void @drawPixel(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 = shl i32 %7, 16
%9 = load i32, i32* %5
%10 = or i32 %8, %9
%11 = sext i32 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 3087007752 to i64*)
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
store volatile i64 %13, i64* inttoptr (i64 3087007760 to i64*)
%14 = load volatile i64, i64* inttoptr (i64 3087007744 to i64*)
%15 = or i64 %14, 1
store volatile i64 %15, i64* inttoptr (i64 3087007744 to i64*)
%16 = load volatile i64, i64* inttoptr (i64 3087007744 to i64*)
%17 = and i64 %16, -2
store volatile i64 %17, i64* inttoptr (i64 3087007744 to i64*)
ret void
}

LLVM IR (-O2):
define void @drawPixel(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = or i32 %4, %1
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 3087007752 to i64*)
%7 = sext i32 %2 to i64
store volatile i64 %7, i64* inttoptr (i64 3087007760 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 3087007744 to i64*)
%9 = or i64 %8, 1
store volatile i64 %9, i64* inttoptr (i64 3087007744 to i64*)
%10 = load volatile i64, i64* inttoptr (i64 3087007744 to i64*)
%11 = and i64 %10, -2
store volatile i64 %11, i64* inttoptr (i64 3087007744 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fabss(int s, int d) {
  assem_debug("fabss d%d,s%d", d, s);
  output_w32(0xeeb00ac0 | ((d & 14) << 11) | ((d & 1) << 22) | ((s & 14) >> 1) |
             ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fabss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb00ac0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fabss>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
mov    %ebp,%ecx
shr    %ecx
and    $0x7,%ecx
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %ecx,%edi
or     %ebx,%edi
or     %eax,%edi
or     $0xeeb00ac0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fabss d%d,s%d\00"
define void @emit_fabss(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -290452800, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 14
%18 = ashr i32 %17, 1
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 1
%22 = shl i32 %21, 5
%23 = or i32 %19, %22
%24 = call i32 @output_w32(i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fabss d%d,s%d\00"
define void @emit_fabss(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = lshr i32 %0, 1
%9 = and i32 %8, 7
%10 = shl i32 %0, 5
%11 = and i32 %10, 32
%12 = or i32 %9, %11
%13 = or i32 %12, %7
%14 = or i32 %13, %5
%15 = or i32 %14, -290452800
%16 = tail call i32 @output_w32(i32 %15)
ret void
}
/* Variables and functions */
scalar_t__ worker_aux(void *);
void *worker(void *data) {
  while (worker_aux(data) == 0)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <worker_aux@plt>
cmp    $0x0,%rax
jne    1134 <worker+0x24>
jmp    111c <worker+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <worker_aux@plt>
test   %rax,%rax
je     1120 <worker+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @worker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = call i64 @worker_aux(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @worker(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @worker_aux(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret i8* null
}
void pwm_free(struct pwm_device *pwm) {}


x86 assembly (clang, -O0):
<pwm_free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pwm_device = type opaque
define void @pwm_free(%struct.pwm_device* %0) {
%2 = alloca %struct.pwm_device*
store %struct.pwm_device* %0, %struct.pwm_device** %2
ret void
}

LLVM IR (-O2):
%struct.pwm_device = type opaque
define void @pwm_free(%struct.pwm_device* nocapture %0) {
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int fill_http_version(char *line, int lineLen, char **versionPtr) {
  if (lineLen < 0) {
    return -1;
  }
  *versionPtr = calloc(1, lineLen + 1);
  memcpy(*versionPtr, line, lineLen);
  return lineLen;
}


x86 assembly (clang, -O0):
<fill_http_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1149 <fill_http_version+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <fill_http_version+0x5c>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_http_version>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1150 <fill_http_version+0x30>
mov    %rdx,%r15
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
jmp    1155 <fill_http_version+0x35>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @fill_http_version(i8* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %22
11: ; preds = %3
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = call i8* @calloc(i32 1, i32 %13)
%15 = load i8**, i8*** %7
store i8* %14, i8** %15
%16 = load i8**, i8*** %7
%17 = load i8*, i8** %16
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
%21 = load i32, i32* %6
store i32 %21, i32* %4
br label %22
22: ; preds = %11, %10
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @fill_http_version(i8* %0, i32 %1, i8** nocapture writeonly %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add nuw nsw i32 %1, 1
%7 = tail call i8* @calloc(i32 1, i32 %6)
store i8* %7, i8** %2
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %1)
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %1, %5 ], [ -1, %3 ]
ret i32 %10
}
void input_poll(struct host *base) {}


x86 assembly (clang, -O0):
<input_poll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.host = type opaque
define void @input_poll(%struct.host* %0) {
%2 = alloca %struct.host*
store %struct.host* %0, %struct.host** %2
ret void
}

LLVM IR (-O2):
%struct.host = type opaque
define void @input_poll(%struct.host* nocapture %0) {
ret void
}
void TM00_intr(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @TM00_intr() {
ret void
}