xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ copysign(double, double);
int /*<<< orphan*/ link_failure_copysign();
void test_copysign(double d1, double d2) {
  if (copysign(d1, d2) != copysign(d1, d2))
    link_failure_copysign();
}


x86 assembly (clang, -O0):
<test_copysign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <copysign@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <copysign@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_copysign+0x4b>
mov    $0x0,%al
call   1030 <link_failure_copysign@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_copysign>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <copysign@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <copysign@plt>
cmp    %rax,%rbx
jne    1153 <test_copysign+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_copysign@plt>

LLVM IR (-O0):
define void @test_copysign(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 i64 @copysign(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @copysign(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_copysign()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_copysign(double %0, double %1) {
%3 = tail call i64 @copysign(double %0, double %1)
%4 = tail call i64 @copysign(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_copysign()
br label %8
8: ; preds = %6, %2
ret void
}
int f_ne_mr1(float *a1, float a2) { return (((*a1) != (a2))); }


x86 assembly (clang, -O0):
<f_ne_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_mr1>:
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_mr1(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 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp une float %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_ne_mr1(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp une float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void inner();
int /*<<< orphan*/ printf(char *);
void function() {
  printf("hi, tangel\n");
  return inner();
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <inner@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <inner@plt>

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

LLVM IR (-O2):
@str = [11 x i8] c"hi, tangel\00"
define void @function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
tail call void (...) @inner()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world from QA bundle a!\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello world from QA bundle a!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Hello world from QA bundle a!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const int8_t;

/* Variables and functions */
int8_t copy_int8_t(const int8_t _val) { return _val; }


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

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

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

LLVM IR (-O2):
define i32 @copy_int8_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ e_izpx();
int /*<<< orphan*/ e_sbc();
void e_sbc_izpx() {
  e_izpx();
  e_sbc();
}


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

x86 assembly (clang, -O2):
<e_sbc_izpx>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_sbc@plt>

LLVM IR (-O0):
define void @e_sbc_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_sbc()
ret void
}

LLVM IR (-O2):
define void @e_sbc_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_sbc()
ret void
}
void swr_convert_frame() {}


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

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

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

LLVM IR (-O2):
define void @swr_convert_frame() {
ret void
}
/* Variables and functions */
double floor(double);
double hl_math_ffloor(double d) { return floor(d); }


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

x86 assembly (clang, -O2):
<hl_math_ffloor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @hl_math_ffloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @hl_math_ffloor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ complain(char *);
scalar_t__ fork();
pid_t dofork(void) {
  pid_t pid;
  pid = fork();
  if (pid < 0) {
    complain("fork");
  }
  return pid;
}


x86 assembly (clang, -O0):
<dofork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    114a <dofork+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <complain@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dofork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    113c <dofork+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <complain@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i64 @dofork() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @complain(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ TestBasicDecoding();
int /*<<< orphan*/ TestCprDecoding();
int /*<<< orphan*/ TestFixingBitErrors();
int main(void) {
  TestBasicDecoding();
  TestFixingBitErrors();
  TestCprDecoding();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <TestBasicDecoding@plt>
mov    $0x0,%al
call   1050 <TestFixingBitErrors@plt>
mov    $0x0,%al
call   1040 <TestCprDecoding@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestBasicDecoding@plt>
xor    %eax,%eax
call   1050 <TestFixingBitErrors@plt>
xor    %eax,%eax
call   1040 <TestCprDecoding@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @TestBasicDecoding()
%3 = call i32 (...) @TestFixingBitErrors()
%4 = call i32 (...) @TestCprDecoding()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestBasicDecoding()
%2 = tail call i32 (...) @TestFixingBitErrors()
%3 = tail call i32 (...) @TestCprDecoding()
ret i32 0
}
/* Variables and functions */
char h2o_toupper(char);
void h2o_strtoupper(char *s, size_t len) {
  for (; len != 0; ++s, --len)
    *s = h2o_toupper(*s);
}


x86 assembly (clang, -O0):
<h2o_strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <h2o_strtoupper+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <h2o_toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <h2o_strtoupper+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_strtoupper>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1147 <h2o_strtoupper+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r15,%rbx,1),%edi
call   1030 <h2o_toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <h2o_strtoupper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @h2o_strtoupper(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call signext i8 @h2o_toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i64 %5, -1
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
char *basename(const char *path) {
  const char *p = path;
  const char *q = path;
  while (*p)
    if (*(p++) == '/')
      q = p;
  return (char *)q;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <basename+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1148 <basename+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <basename+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <basename+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <basename+0x10>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ findxml_string(char *, int, char *, char *);
int xml_pw_validate(char *xml, int xml_len) {
  char password[48];
  findxml_string(xml, xml_len, "Password", password);
  return 0;
}


x86 assembly (clang, -O0):
<xml_pw_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rcx
lea    0xecf(%rip),%rdx
call   1030 <findxml_string@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_pw_validate>:
sub    $0x38,%rsp
lea    0xee5(%rip),%rdx
mov    %rsp,%rcx
call   1030 <findxml_string@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Password\00"
define i32 @xml_pw_validate(i8* %0, i32 %1) {
%3 = alloca [48 x i8]
%4 = getelementptr inbounds [48 x i8], [48 x i8]* %3, i64 0, i64 0
%5 = call i32 @findxml_string(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AcctReportLegacy(char *);
int /*<<< orphan*/ ConnectDb();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void CurrentMonthReportLegacy(char *cPasswd) {
  ConnectDb();
  AcctReportLegacy("tRadacct");
  exit(0);
}


x86 assembly (clang, -O0):
<CurrentMonthReportLegacy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ConnectDb@plt>
lea    0xeb6(%rip),%rdi
call   1030 <AcctReportLegacy@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<CurrentMonthReportLegacy>:
push   %rax
xor    %eax,%eax
call   1040 <ConnectDb@plt>
lea    0xec1(%rip),%rdi
call   1030 <AcctReportLegacy@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"tRadacct\00"
define void @CurrentMonthReportLegacy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @ConnectDb()
%4 = call i32 @AcctReportLegacy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"tRadacct\00"
define void @CurrentMonthReportLegacy(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @ConnectDb()
%3 = tail call i32 @AcctReportLegacy(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int menu_state_destroy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @menu_state_destroy() {
ret i32 0
}
int test_imm_D4int64_lowword_mem(long long *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D4int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 212
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void psocWriteMemoryBarrier() { __asm__ __volatile__("sfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @psocWriteMemoryBarrier() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void display_int_delta(int value, int align) {
  printf(value ? " %+*d |" : " %*d |", align, value);
}


x86 assembly (clang, -O0):
<display_int_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee0(%rip),%rdi
lea    0xed1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_int_delta>:
mov    %edi,%edx
test   %edi,%edi
lea    0xeed(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %+*d |\00"
@.str.1 = [7 x i8] c" %*d |\00"
define void @display_int_delta(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %+*d |\00"
@.str.1 = [7 x i8] c" %*d |\00"
define void @display_int_delta(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %1, i32 %0)
ret void
}
int max_int(int x, int y) {
  if (x > y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
void *memory_alloc(size_t size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @memory_alloc(i64 %0) {
ret i8* undef
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  c &= 0xff;
  if (isupper(c))
    return c ^= 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1149 <tolower+0x39>
mov    -0x8(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    114f <tolower+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
movzbl %dil,%ebx
mov    %ebx,%edi
call   1030 <isupper@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 255
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @isupper(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = xor i32 %10, 32
store i32 %11, i32* %3
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i64 @isupper(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = xor i32 %2, 32
%6 = select i1 %4, i32 %2, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ mesg;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int write(int, char *, int);
void __attribute__((noreturn)) usage(void) {
  static char mesg[] = "Usage: {halt|reboot|poweroff} [-n]\n";
  if (write(2, mesg, sizeof(mesg) - 1) == -1)
    exit(EXIT_FAILURE);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0x2f10(%rip),%rsi
mov    $0x23,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1151 <usage+0x31>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0x2f18(%rip),%rsi
mov    $0x2,%edi
mov    $0x23,%edx
call   1030 <write@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@usage.mesg = internal global [36 x i8] c"Usage: {halt|reboot|poweroff} [-n]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @usage.mesg, i64 0, i64 0), i32 35)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@usage.mesg = internal global [36 x i8] c"Usage: {halt|reboot|poweroff} [-n]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @usage.mesg, i64 0, i64 0), i32 35)
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ del(char *, char);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *str, ch;
  printf("\nEnter string: ");
  gets(str);
  printf("\nEnter character to be deleted: ");
  scanf("%ch", &ch);
  del(str, ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <gets@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1060 <del@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
call   1040 <gets@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%esi
call   1060 <del@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0AEnter string: \00"
@.str.1 = [33 x i8] c"\0AEnter character to be deleted: \00"
@.str.2 = [4 x i8] c"%ch\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @gets(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%9 = load i8*, i8** %2
%10 = load i8, i8* %3
%11 = call i32 @del(i8* %9, i8 signext %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AEnter string: \00"
@.str.1 = [33 x i8] c"\0AEnter character to be deleted: \00"
@.str.2 = [4 x i8] c"%ch\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @gets(i8* undef)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = call i32 @del(i8* undef, i8 signext %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xstrdup(char *s) {
  char *t;
  if (!s)
    return NULL;
  t = (char *)malloc(strlen(s) + 1);
  if (t) {
    strcpy(t, s);
  }
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118d <xstrdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1185 <xstrdup+0x55>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <xstrdup+0x2f>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1162 <xstrdup+0x32>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1162 <xstrdup+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Q_free(void *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<Q_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Q_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_D2int32_reg(int val) { return ((val) & (0xD2 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_D2int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D2int32_reg>:
test   $0xd2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D2int32_reg(i32 %0) {
%2 = and i32 %0, 210
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pollen_interfaces_Gpio_makeOutput__E();
void test7_Led_targetInit__I() {
  { pollen_interfaces_Gpio_makeOutput__E(); }
}


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

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

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

LLVM IR (-O2):
define void @test7_Led_targetInit__I() {
%1 = tail call i32 (...) @pollen_interfaces_Gpio_makeOutput__E()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void GPIO_setDio(uint32_t dioNumber) {
  ;
  (*((volatile unsigned long *)(0x40022000 + 0x00000090))) = (1 << dioNumber);
}


x86 assembly (clang, -O0):
<GPIO_setDio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x40022090,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_setDio>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x40022090
40
ret

LLVM IR (-O0):
define void @GPIO_setDio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 1073881232 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIO_setDio(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 1073881232 to i64*)
ret void
}
int bits_to_bytes(const int bits) { return ((bits + 7) >> 3); }


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

x86 assembly (clang, -O2):
<bits_to_bytes>:
lea    0x7(%rdi),%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_to_bytes(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = ashr i32 %2, 3
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t inv_fifo_protocol_helper_encode_ping(uint8_t supported, uint8_t *out) {
  out[0] = supported;
  return 1;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_encode_ping>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_encode_ping>:
mov    %edi,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_encode_ping(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ return_int4();
int /*<<< orphan*/ take_int4(int /*<<< orphan*/);
void test_int4() { take_int4(return_int4()); }


x86 assembly (clang, -O0):
<test_int4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_int4@plt>
mov    %eax,%edi
call   1030 <take_int4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int4>:
push   %rax
xor    %eax,%eax
call   1040 <return_int4@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_int4@plt>

LLVM IR (-O0):
define void @test_int4() {
%1 = call i32 (...) @return_int4()
%2 = call i32 @take_int4(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_int4() {
%1 = tail call i32 (...) @return_int4()
%2 = tail call i32 @take_int4(i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_collapse_diagonal(int k, int d) {
  int a[2], *b, fail;
  double *c;
  a[0] = k;
  a[1] = d;
  fail = _ada_use_c2phc4c(170, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_collapse_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0xaa,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_collapse_diagonal>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0xaa,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca i32*
%7 = alloca i32
%8 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = load i32*, i32** %6
%15 = load double*, double** %8
%16 = call i32 @_ada_use_c2phc4c(i32 170, i32* %13, i32* %14, double* %15, i32 0)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @standard_collapse_diagonal(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %1, i32* %6
%7 = call i32 @_ada_use_c2phc4c(i32 170, i32* %5, i32* undef, double* undef, i32 0)
ret i32 %7
}
void XcmsPrefixOfFormat() {}


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

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

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

LLVM IR (-O2):
define void @XcmsPrefixOfFormat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
size_t strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, size_t);
void vt_write_str(const char *str) {
  if (str == NULL) {
    return;
  }
  size_t str_cap = strlen(str);
  write(STDOUT_FILENO, str, str_cap);
}


x86 assembly (clang, -O0):
<vt_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <vt_write_str+0x1c>
jmp    115f <vt_write_str+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_write_str>:
test   %rdi,%rdi
je     1143 <vt_write_str+0x23>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%edi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @vt_write_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %3
%10 = load i32, i32* @STDOUT_FILENO
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = call i32 @write(i32 %10, i8* %11, i64 %12)
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @vt_write_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = load i32, i32* @STDOUT_FILENO
%6 = tail call i32 @write(i32 %5, i8* %0, i64 %4)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_togglewait();
int /*<<< orphan*/ flash_writecommand(unsigned long, unsigned char);
void flash_programbyte(unsigned long flashaddress, unsigned char flashdata) {
  flash_writecommand(0x5555, 0xAA);
  flash_writecommand(0x2AAA, 0x55);
  flash_writecommand(0x5555, 0xA0);
  flash_writecommand(flashaddress, flashdata);
  flash_togglewait();
}


x86 assembly (clang, -O0):
<flash_programbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1030 <flash_writecommand@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1030 <flash_writecommand@plt>
mov    $0x5555,%edi
mov    $0xa0,%esi
call   1030 <flash_writecommand@plt>
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <flash_writecommand@plt>
mov    $0x0,%al
call   1040 <flash_togglewait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_programbyte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1030 <flash_writecommand@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1030 <flash_writecommand@plt>
mov    $0x5555,%edi
mov    $0xa0,%esi
call   1030 <flash_writecommand@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <flash_writecommand@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <flash_togglewait@plt>

LLVM IR (-O0):
define void @flash_programbyte(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = call i32 @flash_writecommand(i64 21845, i8 zeroext -86)
%6 = call i32 @flash_writecommand(i64 10922, i8 zeroext 85)
%7 = call i32 @flash_writecommand(i64 21845, i8 zeroext -96)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @flash_writecommand(i64 %8, i8 zeroext %9)
%11 = call i32 (...) @flash_togglewait()
ret void
}

LLVM IR (-O2):
define void @flash_programbyte(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @flash_writecommand(i64 21845, i8 zeroext -86)
%4 = tail call i32 @flash_writecommand(i64 10922, i8 zeroext 85)
%5 = tail call i32 @flash_writecommand(i64 21845, i8 zeroext -96)
%6 = tail call i32 @flash_writecommand(i64 %0, i8 zeroext %1)
%7 = tail call i32 (...) @flash_togglewait()
ret void
}
void test1() {
  {
    ;
    {
      ;
      ;
    }
  };
  ;
}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) {
#pragma omp task
  {
    printf("1");
#pragma omp task
    printf("2");
  }
#pragma omp task
  printf("3");
#pragma omp taskwait
}


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

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @putchar(i32 49)
%2 = tail call i32 @putchar(i32 50)
%3 = tail call i32 @putchar(i32 51)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loopsWhile();
int main() {
  loopsWhile();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <loopsWhile@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @loopsWhile()
ret i32 0
}
void lock(void) {}


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

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

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

LLVM IR (-O2):
define void @lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ multi_arr(int **, int);
int main() {
  int arr[3][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};
  int barr[2][2];
  multi_arr(arr, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1040 <multi_arr@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <multi_arr@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 0, i32 1, i32 2], [3 x i32] [i32 3, i32 4, i32 5], [3 x i32] [i32 6, i32 7, i32 8]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i32]]
%3 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%4 = bitcast [3 x [3 x i32]]* %2 to i8*
%5 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%6 = bitcast [3 x i32]* %5 to i32**
%7 = call i32 @multi_arr(i32** %6, i32 3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [3 x [3 x i32]] [[3 x i32] [i32 0, i32 1, i32 2], [3 x i32] [i32 3, i32 4, i32 5], [3 x i32] [i32 6, i32 7, i32 8]]
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @multi_arr(i32** %3, i32 3)
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int net_wait(int sockfd) {
  int fd;
  int len;
  struct sockaddr_in addr;
  if ((fd = accept(sockfd, (struct sockaddr *)&addr, &len)) < 0) {
    ;
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<net_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1143 <net_wait+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <net_wait+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_wait>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1030 <accept@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @net_wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sockaddr_in
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %5)
store i32 %9, i32* %4
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @net_wait(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %2)
%8 = icmp sgt i32 %7, -1
%9 = select i1 %8, i32 %7, i32 -1
ret i32 %9
}