xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_space_and(char *p, char a) {
  char *p1;
  p1 = p;
  while (isspace(*p1) || *p1 == a)
    p1++;
  return p1;
}


x86 assembly (clang, -O0):
<skip_space_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    115b <skip_space_and+0x4b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116b <skip_space_and+0x5b>
jmp    117c <skip_space_and+0x6c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <skip_space_and+0x1a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space_and>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
jmp    1124 <skip_space_and+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_space_and+0x10>
cmp    %bpl,(%rbx)
je     1120 <skip_space_and+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @skip_space_and(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i8* [ %0, %2 ], [ %12, %11 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, %1
br i1 %10, label %11, label %13
11: ; preds = %3, %8
%12 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
13: ; preds = %8
ret i8* %4
}
/* Variables and functions */
char f_char();
double f_double();
float f_float();
int f_int();
short f_short();
int main() {
  char c;
  short s;
  float f;
  int i;
  double d;
  c = f_char();
  s = f_short();
  f = f_float();
  i = f_int();
  d = f_double();
  return 123;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f_char@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1060 <f_short@plt>
mov    %ax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <f_float@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <f_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <f_double@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x7b,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f_char@plt>
xor    %eax,%eax
call   1060 <f_short@plt>
xor    %eax,%eax
call   1070 <f_float@plt>
xor    %eax,%eax
call   1050 <f_int@plt>
xor    %eax,%eax
call   1040 <f_double@plt>
mov    $0x7b,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
%4 = alloca float
%5 = alloca i32
%6 = alloca double
store i32 0, i32* %1
%7 = call signext i8 (...) @f_char()
store i8 %7, i8* %2
%8 = call signext i16 (...) @f_short()
store i16 %8, i16* %3
%9 = call float (...) @f_float()
store float %9, float* %4
%10 = call i32 (...) @f_int()
store i32 %10, i32* %5
%11 = call double (...) @f_double()
store double %11, double* %6
ret i32 123
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @f_char()
%2 = tail call signext i16 (...) @f_short()
%3 = tail call float (...) @f_float()
%4 = tail call i32 (...) @f_int()
%5 = tail call double (...) @f_double()
ret i32 123
}
void print_dice(char *msg, int *dice) {
  int i;
  for (i = 0; i < 6; i++) {
    if (dice[i] != -1) {
    }
  }
}


x86 assembly (clang, -O0):
<print_dice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1147 <print_dice+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1134 <print_dice+0x34>
jmp    1134 <print_dice+0x34>
jmp    1139 <print_dice+0x39>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <print_dice+0x13>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_dice(i8* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
double __nv_dmul_ru(double, double);
double __dmul_ru(double __a, double __b) { return __nv_dmul_ru(__a, __b); }


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

x86 assembly (clang, -O2):
<__dmul_ru>:
jmp    1030 <__nv_dmul_ru@plt>

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

LLVM IR (-O2):
define double @__dmul_ru(double %0, double %1) {
%3 = tail call double @__nv_dmul_ru(double %0, double %1)
ret double %3
}
void unexpected(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<unexpected>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <unexpected+0x9>
jmp    1109 <unexpected+0x9>

x86 assembly (clang, -O2):
<unexpected>:
jmp    1100 <unexpected>

LLVM IR (-O0):
define void @unexpected() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @unexpected() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
float __nv_ynf(int, float);
float ynf(int __a, float __b) { return __nv_ynf(__a, __b); }


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

x86 assembly (clang, -O2):
<ynf>:
jmp    1030 <__nv_ynf@plt>

LLVM IR (-O0):
define float @ynf(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = load float, float* %4
%7 = call float @__nv_ynf(i32 %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @ynf(i32 %0, float %1) {
%3 = tail call float @__nv_ynf(i32 %0, float %1)
ret float %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ imprimir(int);
int main(int argc, char **argv) {
  int i = 25;
  imprimir(i);
  return (EXIT_SUCCESS);
}


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   $0x19,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <imprimir@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 25, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @imprimir(i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @imprimir(i32 25)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
char *strerror(int errnum) {
  (void)errnum;
  return "";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ alarmd_createdir(char *);
int main(int argc, char **argv) {
  if (alarmd_createdir("./filedir/testdir/subdir/wahha") < 0) {
    return -1;
  }
  if (alarmd_createdir("./filedir/testdir/subdir2/") < 0) {
    return -1;
  }
  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    0xed3(%rip),%rdi
call   1030 <alarmd_createdir@plt>
cmp    $0x0,%rax
jge    1148 <main+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <main+0x61>
lea    0xed0(%rip),%rdi
call   1030 <alarmd_createdir@plt>
cmp    $0x0,%rax
jge    116a <main+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <main+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <alarmd_createdir@plt>
test   %rax,%rax
js     1134 <main+0x24>
lea    0xef6(%rip),%rdi
call   1030 <alarmd_createdir@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"./filedir/testdir/subdir/wahha\00"
@.str.1 = [27 x i8] c"./filedir/testdir/subdir2/\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 i64 @alarmd_createdir(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %14
9: ; preds = %2
%10 = call i64 @alarmd_createdir(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %3
br label %14
13: ; preds = %9
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [31 x i8] c"./filedir/testdir/subdir/wahha\00"
@.str.1 = [27 x i8] c"./filedir/testdir/subdir2/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @alarmd_createdir(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @alarmd_createdir(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
char *siod_version(void) { return ("3.5 5-MAY-97"); }


x86 assembly (clang, -O0):
<siod_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<siod_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"3.5 5-MAY-97\00"
define i8* @siod_version() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"3.5 5-MAY-97\00"
define i8* @siod_version() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgroups(int size, gid_t list[]) { return 0; }


x86 assembly (clang, -O0):
<getgroups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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
ret i32 0
}

LLVM IR (-O2):
define i32 @getgroups(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
void createEvent(int uid, int eid) {}


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

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

LLVM IR (-O0):
define void @createEvent(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @createEvent(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *name) {
  fprintf(stderr, "usage: %s <up to 64 bytes of characters\n", name);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s <up to 64 bytes of characters\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s <up to 64 bytes of characters\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void BlendPlaneRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @BlendPlaneRow_Any_AVX2() {
ret void
}
char test_53_0(char *mem) { return __atomic_or_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_53_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    0x4(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
or     %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    1152 <test_53_0+0x52>
jmp    1127 <test_53_0+0x27>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
or     %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_53_0>:
mov    0x4(%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
or     $0x1,%cl
lock cmpxchg %cl,0x4(%rdi)
jne    1110 <test_53_0+0x10>
or     $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @test_53_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw or i8* %6, i8 %7 acq_rel
%9 = or i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_53_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw or i8* %2, i8 1 acq_rel
%4 = or i8 %3, 1
ret i8 %4
}
int nop(int delay) {
  int tmp = 0, i;
  for (i = 0; i < delay; i++)
    tmp = i + tmp;
  return tmp;
}


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <nop+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <nop+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
test   %edi,%edi
jle    1118 <nop+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nop(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void refresh() {
  write(STDOUT_FILENO, "\x1b[2J", 4);
  write(STDOUT_FILENO, "\x1b[H", 3);
}


x86 assembly (clang, -O0):
<refresh>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<refresh>:
push   %rbx
mov    0x2ed8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
mov    $0x3,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @refresh() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @refresh() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *name) { printf("USAGE %s a b\n", name); }


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"USAGE %s a b\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void tlv_set_length(uint8_t *p_tlv, uint16_t i_length) {
  p_tlv[2] = i_length >> 8;
  p_tlv[3] = i_length & 0xff;
}


x86 assembly (clang, -O0):
<tlv_set_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_set_length>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,0x8(%rdi)
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @tlv_set_length(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 3
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @tlv_set_length(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %4
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("ayy");
  return 1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"ayy\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void run(void) { return; }


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

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

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

LLVM IR (-O2):
define void @run() {
ret void
}
/* Variables and functions */
unsigned int const CHAR_BIT;
unsigned get_bit(const unsigned char *const p, const unsigned int i) {
  const unsigned int byte = i / CHAR_BIT;
  const unsigned bit = i % CHAR_BIT;
  return p[byte] >> bit & 1u;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ecb(%rip),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eba(%rip),%rcx
xor    %edx,%edx
divl   (%rcx)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@CHAR_BIT = constant i32 0
define i32 @get_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* @CHAR_BIT
%9 = udiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* @CHAR_BIT
%12 = urem i32 %10, %11
store i32 %12, i32* %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i32, i32* %6
%20 = ashr i32 %18, %19
%21 = and i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
@CHAR_BIT = constant i32 0
define i32 @get_bit(i8* nocapture readnone %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
void fill_str(char *str, size_t len, char c, char term) {
  size_t i, last;
  last = len - 1;
  for (i = 0; i < last; ++i) {
    str[i] = c;
  }
  str[last] = term;
}


x86 assembly (clang, -O0):
<fill_str>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1157 <fill_str+0x57>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112a <fill_str+0x2a>
mov    -0x12(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_str>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0xffffffffffffffff,%rbx
je     1131 <fill_str+0x21>
movzbl %dl,%esi
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14b,0x0(%rbp,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fill_str(i8* %0, i64 %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%11 = load i64, i64* %6
%12 = sub i64 %11, 1
store i64 %12, i64* %10
store i64 0, i64* %9
br label %13
13: ; preds = %22, %4
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i8, i8* %7
%19 = load i8*, i8** %5
%20 = load i64, i64* %9
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 %18, i8* %21
br label %22
22: ; preds = %17
%23 = load i64, i64* %9
%24 = add i64 %23, 1
store i64 %24, i64* %9
br label %13
25: ; preds = %13
%26 = load i8, i8* %8
%27 = load i8*, i8** %5
%28 = load i64, i64* %10
%29 = getelementptr inbounds i8, i8* %27, i64 %28
store i8 %26, i8* %29
ret void
}

LLVM IR (-O2):
define void @fill_str(i8* nocapture writeonly %0, i64 %1, i8 signext %2, i8 signext %3) {
%5 = add i64 %1, -1
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
br label %8
8: ; preds = %7, %4
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %3, i8* %9
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ fnmatch(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int mydir_filter(const struct dirent *dir_entry) {
  if (fnmatch("prio*", dir_entry->d_name, 0))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<mydir_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
xor    %edx,%edx
call   1030 <fnmatch@plt>
cmp    $0x0,%rax
je     1146 <mydir_filter+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114d <mydir_filter+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mydir_filter>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
call   1030 <fnmatch@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [6 x i8] c"prio*\00"
define i32 @mydir_filter(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i64 @fnmatch(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [6 x i8] c"prio*\00"
define i32 @mydir_filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @fnmatch(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ rat_mod_parse_module(char const *, scalar_t__ *);
int rat_mod_icpt_mid(uint16_t mid, const char *mstr) {
  uint16_t icptmid;
  do {
  } while (0);
  if (rat_mod_parse_module(mstr, &icptmid) == 0 && mid == icptmid)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<rat_mod_icpt_mid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
jmp    1125 <rat_mod_icpt_mid+0x15>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <rat_mod_parse_module@plt>
cmp    $0x0,%rax
jne    1156 <rat_mod_icpt_mid+0x46>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1156 <rat_mod_icpt_mid+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115d <rat_mod_icpt_mid+0x4d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_icpt_mid>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <rat_mod_parse_module@plt>
xor    0x8(%rsp),%rbx
xor    %ecx,%ecx
or     %rax,%rbx
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rat_mod_icpt_mid(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
br label %7
7: ; preds = %2
br label %8
8: ; preds = %7
%9 = load i8*, i8** %5
%10 = call i64 @rat_mod_parse_module(i8* %9, i64* %6)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %3
br label %18
17: ; preds = %12, %8
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @rat_mod_icpt_mid(i64 %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @rat_mod_parse_module(i8* %1, i64* %3)
%6 = icmp ne i64 %5, 0
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ red_book(unsigned int, unsigned char *, unsigned char *,
                            unsigned char *);
unsigned int hsg(unsigned int value) {
  unsigned char min, sec, frame;
  red_book(value, &min, &sec, &frame);
  value = (unsigned int)min * 4500;
  value += (short)sec * 75;
  value += frame;
  value -= 150;
  return value;
}


x86 assembly (clang, -O0):
<hsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
lea    -0x6(%rbp),%rdx
lea    -0x7(%rbp),%rcx
call   1030 <red_book@plt>
movzbl -0x5(%rbp),%eax
imul   $0x1194,%eax,%eax
mov    %eax,-0x4(%rbp)
movzbl -0x6(%rbp),%eax
cwtl
imul   $0x4b,%eax,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movzbl -0x7(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x96,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsg>:
push   %rax
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rdx
lea    0x5(%rsp),%rcx
call   1030 <red_book@plt>
movzbl 0x7(%rsp),%eax
imul   $0x1194,%eax,%eax
movzbl 0x6(%rsp),%ecx
imul   $0x4b,%ecx,%ecx
add    %eax,%ecx
movzbl 0x5(%rsp),%eax
add    %ecx,%eax
add    $0xffffff6a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hsg(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @red_book(i32 %6, i8* %3, i8* %4, i8* %5)
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = mul i32 %9, 4500
store i32 %10, i32* %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i16
%13 = sext i16 %12 to i32
%14 = mul nsw i32 %13, 75
%15 = load i32, i32* %2
%16 = add i32 %15, %14
store i32 %16, i32* %2
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i32, i32* %2
%20 = add i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = sub i32 %21, 150
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @hsg(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = call i32 @red_book(i32 %0, i8* %2, i8* %3, i8* %4)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = mul nuw nsw i32 %7, 4500
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = mul nuw nsw i32 %10, 75
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = add nsw i32 %8, -150
%15 = add nsw i32 %14, %11
%16 = add nsw i32 %15, %13
ret i32 %16
}
void Abort_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @Abort_Handler() {
ret void
}
unsigned short swapu16_2(unsigned short x) { return (x >> 8) | (x << 8); }


x86 assembly (clang, -O0):
<swapu16_2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapu16_2>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @swapu16_2(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @swapu16_2(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ mm_update_max_long_term_frame_idx(int /*<<< orphan*/);
void mm_unmark_all_long_term_for_reference() {
  mm_update_max_long_term_frame_idx(0);
}


x86 assembly (clang, -O0):
<mm_unmark_all_long_term_for_reference>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mm_update_max_long_term_frame_idx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_unmark_all_long_term_for_reference>:
xor    %edi,%edi
jmp    1030 <mm_update_max_long_term_frame_idx@plt>

LLVM IR (-O0):
define void @mm_unmark_all_long_term_for_reference() {
%1 = call i32 @mm_update_max_long_term_frame_idx(i32 0)
ret void
}

LLVM IR (-O2):
define void @mm_unmark_all_long_term_for_reference() {
%1 = tail call i32 @mm_update_max_long_term_frame_idx(i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ nios_pkt_8x8_unpack(int const *, int *, int *, int *, int *);
void nios_pkt_8x8_resp_unpack(const uint8_t *buf, uint8_t *target, bool *write,
                              uint8_t *addr, uint8_t *data, bool *success) {
  nios_pkt_8x8_unpack(buf, target, write, addr, data);
  if ((buf[2] & (1 << 1)) != 0) {
    *success = true;
  } else {
    *success = false;
  }
}


x86 assembly (clang, -O0):
<nios_pkt_8x8_resp_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <nios_pkt_8x8_unpack@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116b <nios_pkt_8x8_resp_unpack+0x5b>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
jmp    1175 <nios_pkt_8x8_resp_unpack+0x65>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_8x8_resp_unpack>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rdi,%rbx
call   1030 <nios_pkt_8x8_unpack@plt>
mov    0x8(%rbx),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nios_pkt_8x8_resp_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i32*, i32** %9
%16 = load i32*, i32** %10
%17 = load i32*, i32** %11
%18 = call i32 @nios_pkt_8x8_unpack(i32* %13, i32* %14, i32* %15, i32* %16, i32* %17)
%19 = load i32*, i32** %7
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = and i32 %21, 2
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %6
%25 = load i32*, i32** %12
store i32 1, i32* %25
br label %28
26: ; preds = %6
%27 = load i32*, i32** %12
store i32 0, i32* %27
br label %28
28: ; preds = %26, %24
ret void
}

LLVM IR (-O2):
define void @nios_pkt_8x8_resp_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* nocapture writeonly %5) {
%7 = tail call i32 @nios_pkt_8x8_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 1
%11 = and i32 %10, 1
store i32 %11, i32* %5
ret void
}
int adis16251_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16251_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
unsigned long bits_turnon(unsigned long num) {
  unsigned long x, i = 1;
  for (x = num; x; i <<= 1, x >>= 1)
    num |= i;
  return num;
}


x86 assembly (clang, -O0):
<bits_turnon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <bits_turnon+0x4c>
mov    -0x18(%rbp),%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <bits_turnon+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_turnon>:
test   %rdi,%rdi
je     1123 <bits_turnon+0x23>
mov    $0x1,%ecx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rcx,%rax
add    %rcx,%rcx
shr    %rdx
cmp    $0x1,%rdi
mov    %rdx,%rdi
ja     1110 <bits_turnon+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @bits_turnon(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %4
%5 = load i64, i64* %2
store i64 %5, i64* %3
br label %6
6: ; preds = %13, %1
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i64, i64* %4
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
br label %13
13: ; preds = %9
%14 = load i64, i64* %4
%15 = shl i64 %14, 1
store i64 %15, i64* %4
%16 = load i64, i64* %3
%17 = lshr i64 %16, 1
store i64 %17, i64* %3
br label %6
18: ; preds = %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @bits_turnon(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 1, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = phi i64 [ %7, %3 ], [ %0, %1 ]
%7 = or i64 %4, %6
%8 = shl i64 %4, 1
%9 = lshr i64 %5, 1
%10 = icmp ult i64 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %12
}
int stbi_convert_bit_range(int c, int from_bits, int to_bits) {
  int b = (1 << (from_bits - 1)) + c * ((1 << to_bits) - 1);
  return (b + (b >> from_bits)) >> from_bits;
}


x86 assembly (clang, -O0):
<stbi_convert_bit_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_convert_bit_range>:
mov    %edx,%r8d
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xffffffff,%edx
mov    %r8d,%ecx
shl    %cl,%edx
not    %edx
imul   %edi,%edx
add    %eax,%edx
mov    %edx,%eax
mov    %esi,%ecx
sar    %cl,%eax
add    %edx,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @stbi_convert_bit_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = shl i32 1, %12
%14 = sub nsw i32 %13, 1
%15 = mul nsw i32 %11, %14
%16 = add nsw i32 %10, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %7
%19 = load i32, i32* %5
%20 = ashr i32 %18, %19
%21 = add nsw i32 %17, %20
%22 = load i32, i32* %5
%23 = ashr i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @stbi_convert_bit_range(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = shl nuw i32 1, %4
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
%8 = mul nsw i32 %7, %0
%9 = add nsw i32 %8, %5
%10 = ashr i32 %9, %1
%11 = add nsw i32 %10, %9
%12 = ashr i32 %11, %1
ret i32 %12
}
int strlen_my(char string1[100]) {
  int n;
  for (n = 0; string1[n] != '\0'; n++) {
  }
  return n;
}


x86 assembly (clang, -O0):
<strlen_my>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen_my+0x37>
jmp    1129 <strlen_my+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen_my+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_my>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen_my+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen_my(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ mem;

/* Variables and functions */
int /*<<< orphan*/ __tfree(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ talloc_set_parent(void *, int /*<<< orphan*/ *);
void *tfree(void *mem) {
  if (!mem)
    return NULL;
  talloc_set_parent(mem, NULL);
  __tfree((((void **)(mem))[-3]));
  free((void *)((void **)(mem)-3));
  return NULL;
}


x86 assembly (clang, -O0):
<tfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <tfree+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1183 <tfree+0x53>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <talloc_set_parent@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rax),%rdi
call   1050 <__tfree@plt>
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffe8,%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfree>:
test   %rdi,%rdi
je     1156 <tfree+0x26>
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <talloc_set_parent@plt>
mov    -0x18(%rbx),%rdi
add    $0xffffffffffffffe8,%rbx
call   1050 <__tfree@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @tfree(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %20
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @talloc_set_parent(i8* %8, i32* null)
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i8**
%12 = getelementptr inbounds i8*, i8** %11, i64 -3
%13 = load i8*, i8** %12
%14 = call i32 @__tfree(i8* %13)
%15 = load i8*, i8** %3
%16 = bitcast i8* %15 to i8**
%17 = getelementptr inbounds i8*, i8** %16, i64 -3
%18 = bitcast i8** %17 to i8*
%19 = call i32 @free(i8* %18)
store i8* null, i8** %2
br label %20
20: ; preds = %7, %6
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @tfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @talloc_set_parent(i8* %0, i32* null)
%5 = getelementptr inbounds i8, i8* %0, i64 -24
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = tail call i32 @__tfree(i8* %7)
%9 = tail call i32 @free(i8* %5)
br label %10
10: ; preds = %1, %3
ret i8* null
}