xunge/DecIR huggingface dataset:
int test_imm_9Fuint16_reg(unsigned short val) {
  return ((val) & (-0x9F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Fuint16_reg>:
test   $0xff61,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -159
%6 = icmp ne i32 %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_9Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -159
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_92() {
  Assert_real((isqrt(92) == 9),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              465, ("Integer square root of 92 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_92>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5c,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1d1,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_92>:
push   %rax
mov    $0x5c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1d1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 92 should be 9\00"
define void @t_sqrt_92() {
%1 = call i32 @isqrt(i32 92)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 92 should be 9\00"
define void @t_sqrt_92() {
%1 = tail call i32 @isqrt(i32 92)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 465, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct plugin_manager_struct {
  int dummy;
};

/* Variables and functions */
void *plugin_manager_init_and_or_create(struct plugin_manager_struct *,
                                        char const *, int, void *);
void *plugin_manager_create_instance(struct plugin_manager_struct *manager,
                                     const char *name, void *flags) {
  return plugin_manager_init_and_or_create(manager, name, 1, flags);
}


x86 assembly (clang, -O0):
<plugin_manager_create_instance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <plugin_manager_init_and_or_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_manager_create_instance>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <plugin_manager_init_and_or_create@plt>

LLVM IR (-O0):
%struct.plugin_manager_struct = type { i32 }
define i8* @plugin_manager_create_instance(%struct.plugin_manager_struct* %0, i8* %1, i8* %2) {
%4 = alloca %struct.plugin_manager_struct*
%5 = alloca i8*
%6 = alloca i8*
store %struct.plugin_manager_struct* %0, %struct.plugin_manager_struct** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.plugin_manager_struct*, %struct.plugin_manager_struct** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @plugin_manager_init_and_or_create(%struct.plugin_manager_struct* %7, i8* %8, i32 1, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.plugin_manager_struct = type { i32 }
define i8* @plugin_manager_create_instance(%struct.plugin_manager_struct* %0, i8* %1, i8* %2) {
%4 = tail call i8* @plugin_manager_init_and_or_create(%struct.plugin_manager_struct* %0, i8* %1, i32 1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("hello world \n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world \0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world \00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
testUnaryNot() { printf("!%d = %d\n", 10, !10); }


x86 assembly (clang, -O0):
<testUnaryNot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUnaryNot>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"!%d = %d\0A\00"
define i32 @testUnaryNot() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [10 x i8] c"!%d = %d\0A\00"
define i32 @testUnaryNot() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int set_non_blocking(int fd) {
  int nonb = 0;
  int res;
  res = fcntl(fd, F_GETFL, 0);
  if (-1 == res || fcntl(fd, F_SETFL, res | nonb) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<set_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
mov    $0xffffffff,%eax
cmp    -0x10(%rbp),%eax
je     1166 <set_non_blocking+0x56>
mov    -0x8(%rbp),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
or     -0xc(%rbp),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1172 <set_non_blocking+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1179 <set_non_blocking+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_non_blocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1147 <set_non_blocking+0x37>
mov    0x2ead(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFL
%8 = call i32 @fcntl(i32 %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 -1, %9
br i1 %10, label %19, label %11
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETFL
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = or i32 %14, %15
%17 = call i32 @fcntl(i32 %12, i32 %13, i32 %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %11, %1
store i32 0, i32* %2
br label %21
20: ; preds = %11
store i32 1, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_non_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %3)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int data) { printf("%d ", data); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
float tanf(float);
void nsvg__xformSetSkewX(float *t, float a) {
  t[0] = 1.0f;
  t[1] = 0.0f;
  t[2] = tanf(a);
  t[3] = 1.0f;
  t[4] = 0.0f;
  t[5] = 0.0f;
}


x86 assembly (clang, -O0):
<nsvg__xformSetSkewX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0xed3(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
call   1030 <tanf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xea4(%rip),%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__xformSetSkewX>:
push   %rbx
mov    %rdi,%rbx
movq   $0x3f800000,(%rdi)
call   1030 <tanf@plt>
movss  %xmm0,0x8(%rbx)
movq   $0x3f800000,0xc(%rbx)
3f
movl   $0x0,0x14(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @nsvg__xformSetSkewX(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
store float 1.000000e+00, float* %6
%7 = load float*, float** %3
%8 = getelementptr inbounds float, float* %7, i64 1
store float 0.000000e+00, float* %8
%9 = load float, float* %4
%10 = call float @tanf(float %9)
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 2
store float %10, float* %12
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 3
store float 1.000000e+00, float* %14
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 4
store float 0.000000e+00, float* %16
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 5
store float 0.000000e+00, float* %18
ret void
}

LLVM IR (-O2):
define void @nsvg__xformSetSkewX(float* nocapture writeonly %0, float %1) {
store float 1.000000e+00, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %3
%4 = tail call float @tanf(float %1)
%5 = getelementptr inbounds float, float* %0, i64 2
store float %4, float* %5
%6 = getelementptr inbounds float, float* %0, i64 3
store float 1.000000e+00, float* %6
%7 = getelementptr inbounds float, float* %0, i64 4
store float 0.000000e+00, float* %7
%8 = getelementptr inbounds float, float* %0, i64 5
store float 0.000000e+00, float* %8
ret void
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETCOLORSPACE_safe(const char *record) { return (core3_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSETCOLORSPACE_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETCOLORSPACE_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int dlg_button_count(const char **labels) {
  int result = 0;
  while (*labels++ != 0)
    ++result;
  return result;
}


x86 assembly (clang, -O0):
<dlg_button_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1136 <dlg_button_count+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <dlg_button_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlg_button_count>:
cmpq   $0x0,(%rdi)
je     111d <dlg_button_count+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <dlg_button_count+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dlg_button_count(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i32 1
store i8** %6, i8*** %2
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @dlg_button_count(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int main() {
  int x, y;
  asm goto("jc %l[error];" : : "r"(x), "r"(&y) : "memory" : error);
error:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
lea    -0xc(%rbp),%rcx
jb     1122 <main+0x22>
jmp    111d <main+0x1d>
jmp    1122 <main+0x22>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    -0x4(%rsp),%rax
jb     1107 <main+0x7>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
to label %5 [label %6]
5: ; preds = %0
br label %6
6: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
to label %3 [label %4]
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void af_free(void *p) { free(*(void **)p); }


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

x86 assembly (clang, -O2):
<af_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @af_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @af_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
size_t foo_len(const char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<foo_len>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @foo_len(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
int btshas_shxops_CheckRegGpr(int reg) {
  if ((reg >= 0x00) && (reg <= 0x0F))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<btshas_shxops_CheckRegGpr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <btshas_shxops_CheckRegGpr+0x27>
cmpl   $0xf,-0x8(%rbp)
jg     1127 <btshas_shxops_CheckRegGpr+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <btshas_shxops_CheckRegGpr+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btshas_shxops_CheckRegGpr>:
xor    %eax,%eax
cmp    $0x10,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @btshas_shxops_CheckRegGpr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 15
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @btshas_shxops_CheckRegGpr(i32 %0) {
%2 = icmp ult i32 %0, 16
%3 = zext i1 %2 to i32
ret i32 %3
}
void irq_handler() {}


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

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

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

LLVM IR (-O2):
define void @irq_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
dummy() { printf("hello\n"); }


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @dummy() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @dummy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double sqrt(double);
double ln_get_ell_mean_motion(double a) {
  double q = 0.9856076686;
  return q / (a * sqrt(a));
}


x86 assembly (clang, -O0):
<ln_get_ell_mean_motion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_ell_mean_motion>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1128 <ln_get_ell_mean_motion+0x18>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    113b <ln_get_ell_mean_motion+0x2b>
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_ell_mean_motion(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x3FEF8A1917EA5C9F, double* %3
%4 = load double, double* %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @sqrt(double %6)
%8 = fmul double %5, %7
%9 = fdiv double %4, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_ell_mean_motion(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fmul double %2, %0
%4 = fdiv double 0x3FEF8A1917EA5C9F, %3
ret double %4
}
int hash_func(char *k) {
  int hash = 1;
  char *c;
  for (c = k; *c; c++)
    hash = *c + hash * 31;
  return hash % 100;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <hash_func+0x45>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash_func+0x17>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    (%rdi),%cl
test   %cl,%cl
je     1145 <hash_func+0x45>
add    $0x1,%rdi
mov    $0x1,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_func+0x10>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @hash_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 1, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %17, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 31
%16 = add nsw i32 %13, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %10
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
br label %6
20: ; preds = %6
%21 = load i32, i32* %3
%22 = srem i32 %21, 100
ret i32 %22
}

LLVM IR (-O2):
define i32 @hash_func(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 1, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %7, 31
%10 = add nsw i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %10, 100
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 1, %1 ], [ %15, %14 ]
ret i32 %17
}
int Strlen(char *str) {
  int i;
  if (str == 0x0)
    return 0;
  for (i = 0; str[i] != 0x0; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<Strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <Strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1154 <Strlen+0x54>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <Strlen+0x4e>
jmp    1140 <Strlen+0x40>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <Strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strlen>:
test   %rdi,%rdi
je     111d <Strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <Strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Strlen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %23
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %18, %8
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %9
21: ; preds = %9
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @Strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
float M_PI;
float degrees(float radians) { return (radians * 180 / M_PI); }


x86 assembly (clang, -O0):
<degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees>:
mulss  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divss  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = load float, float* @M_PI
%6 = fdiv float %4, %5
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @degrees(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = load float, float* @M_PI
%4 = fdiv float %2, %3
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_hsp_meta_get_subevent_code(const uint8_t *event) {
  return event[2];
}


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

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

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

LLVM IR (-O2):
define i32 @hci_event_hsp_meta_get_subevent_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ scopy(char *, char *, int);
int slength(char *);
void sconcat(char *dest, char *src) {
  scopy(dest + slength(dest), src, slength(src));
}


x86 assembly (clang, -O0):
<sconcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <slength@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <slength@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <scopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sconcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <slength@plt>
movslq %eax,%rbx
add    %r15,%rbx
mov    %r14,%rdi
call   1040 <slength@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <scopy@plt>

LLVM IR (-O0):
define void @sconcat(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** %3
%7 = call i32 @slength(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @slength(i8* %11)
%13 = call i32 @scopy(i8* %9, i8* %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @sconcat(i8* %0, i8* %1) {
%3 = tail call i32 @slength(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @slength(i8* %1)
%7 = tail call i32 @scopy(i8* %5, i8* %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
double *dvector(int n) {
  double *a;
  a = (double *)malloc(sizeof(double) * n);
  if (a == (double *)NULL) {
    fprintf(stderr, "Error: Could not allocate memory\n");
    exit(1);
  }
  return (a);
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <dvector+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rax
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <dvector+0x10>
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Error: Could not allocate memory\0A\00"
define double* @dvector(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = icmp eq double* %10, null
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %1
%17 = load double*, double** %3
ret double* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Error: Could not allocate memory\0A\00"
define double* @dvector(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
void init_task_section() {}


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

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

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

LLVM IR (-O2):
define void @init_task_section() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void PWMOutputFaultLevel(uint32_t ui32Base, uint32_t ui32PWMOutBits,
                         bool bDriveHigh) {
  ;

  ;
  if (bDriveHigh == 1) {
    (*((volatile unsigned long *)(ui32Base + 0x00000024))) |= ui32PWMOutBits;
  } else {
    (*((volatile unsigned long *)(ui32Base + 0x00000024))) &= ~(ui32PWMOutBits);
  }
}


x86 assembly (clang, -O0):
<PWMOutputFaultLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1131 <PWMOutputFaultLevel+0x31>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x24(%rax)
jmp    1148 <PWMOutputFaultLevel+0x48>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMOutputFaultLevel>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x1,%edx
jne    111e <PWMOutputFaultLevel+0x1e>
mov    -0x10(%rsp),%rcx
or     %rax,0x24(%rcx)
ret
not    %rax
mov    -0x10(%rsp),%rcx
and    %rax,0x24(%rcx)
ret

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

LLVM IR (-O2):
define void @PWMOutputFaultLevel(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
%6 = icmp eq i32 %2, 1
%7 = load volatile i64, i64* %5
br i1 %6, label %8, label %14
8: ; preds = %3
%9 = load volatile i64, i64* %4
%10 = add i64 %9, 36
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %7
store volatile i64 %13, i64* %11
br label %21
14: ; preds = %3
%15 = xor i64 %7, -1
%16 = load volatile i64, i64* %4
%17 = add i64 %16, 36
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %15
store volatile i64 %20, i64* %18
br label %21
21: ; preds = %14, %8
ret void
}
streq(str1, str2) char str1[], str2[];
{
  int k;
  k = 0;
  while (str2[k]) {
    if ((str1[k]) != (str2[k]))
      return 0;
    k++;
  }
  return k;
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <streq+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1151 <streq+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1165 <streq+0x65>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <streq+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <streq+0x24>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %cl,(%rdi,%rdx,1)
jne    1124 <streq+0x24>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <streq+0x10>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %7
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11
%17 = trunc i64 %12 to i32
br label %18
18: ; preds = %5, %16, %2
%19 = phi i32 [ 0, %2 ], [ %17, %16 ], [ 0, %5 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
uint32_t co_rand_word(void) { return (uint32_t)rand(); }


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

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

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

LLVM IR (-O2):
define i32 @co_rand_word() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ChildProcess();
int /*<<< orphan*/ ParentProcess();
scalar_t__ fork();
int /*<<< orphan*/ printf(char *, int);
void main() {
  pid_t pid;
  int num = 20;
  pid = fork();
  if (pid == 0) {
    ChildProcess();
    num += 5;
  } else {
    ParentProcess();
    printf("Value of num = %d\n", num);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x14,-0xc(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117a <main+0x3a>
mov    $0x0,%al
call   1050 <ChildProcess@plt>
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1190 <main+0x50>
mov    $0x0,%al
call   1040 <ParentProcess@plt>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1166 <main+0x26>
xor    %eax,%eax
call   1040 <ParentProcess@plt>
lea    0xea5(%rip),%rdi
mov    $0x14,%esi
pop    %rax
jmp    1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ChildProcess@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Value of num = %d\0A\00"
define void @main() {
%1 = alloca i64
%2 = alloca i32
store i32 20, i32* %2
%3 = call i64 (...) @fork()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 (...) @ChildProcess()
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 5
store i32 %9, i32* %2
br label %14
10: ; preds = %0
%11 = call i32 (...) @ParentProcess()
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Value of num = %d\0A\00"
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @ChildProcess()
br label %8
5: ; preds = %0
%6 = tail call i32 (...) @ParentProcess()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20)
br label %8
8: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int sys_getresgid(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *);
int sys_getresgid32(gid_t *rgid, gid_t *egid, gid_t *sgid) {
  return sys_getresgid(rgid, egid, sgid);
}


x86 assembly (clang, -O0):
<sys_getresgid32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sys_getresgid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getresgid32>:
jmp    1030 <sys_getresgid@plt>

LLVM IR (-O0):
define i32 @sys_getresgid32(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 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @sys_getresgid(i32* %7, i32* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_getresgid32(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @sys_getresgid(i32* %0, i32* %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
int /*<<< orphan*/ marshal_u16(char *, int);
int /*<<< orphan*/ marshal_u32(char *, int);
void gator_annotate_marker_color(int color) {
  char header[8];
  header[0] = 0x1c;
  header[1] = 0x05;
  marshal_u16(header + 2, 4);
  marshal_u32(header + 4, color);
  kannotate_write(header, sizeof(header));
}


x86 assembly (clang, -O0):
<gator_annotate_marker_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x1c,-0xc(%rbp)
movb   $0x5,-0xb(%rbp)
lea    -0xc(%rbp),%rdi
add    $0x2,%rdi
mov    $0x4,%esi
call   1050 <marshal_u16@plt>
lea    -0xc(%rbp),%rdi
add    $0x4,%rdi
mov    -0x4(%rbp),%esi
call   1030 <marshal_u32@plt>
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_color>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movw   $0x51c,0x8(%rsp)
lea    0xa(%rsp),%rdi
mov    $0x4,%esi
call   1050 <marshal_u16@plt>
lea    0xc(%rsp),%rdi
mov    %ebx,%esi
call   1030 <marshal_u32@plt>
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
store i8 28, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 1
store i8 5, i8* %5
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @marshal_u16(i8* %7, i32 4)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 4
%11 = load i32, i32* %2
%12 = call i32 @marshal_u32(i8* %10, i32 %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%14 = call i32 @kannotate_write(i8* %13, i32 8)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
store i8 28, i8* %3
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
store i8 5, i8* %4
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
%6 = call i32 @marshal_u16(i8* %5, i32 4)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%8 = call i32 @marshal_u32(i8* %7, i32 %0)
%9 = call i32 @kannotate_write(i8* %3, i32 8)
ret void
}
void slab_put_item(struct item *it) { ; }


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

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

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

LLVM IR (-O2):
%struct.item = type opaque
define void @slab_put_item(%struct.item* nocapture %0) {
ret void
}
void id_() {}


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

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

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

LLVM IR (-O2):
define void @id_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int main(int argc, const char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%d arg = %s\n", i, argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d arg = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d arg = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}