xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int vain() {
  printf("Hello world\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @vain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fn8(int x, int y) {
  int tem1 = ~(y & x);
  int tem2 = y | x;
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %7, %8
%10 = xor i32 %9, -1
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = or i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void ps_comment(FILE *ps, char *s) { fprintf(ps, "%%%% %s\n", s); }


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

x86 assembly (clang, -O2):
<ps_comment>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%%%% %s\0A\00"
define void @ps_comment(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findmax(int, int);
int main() {
  int max = 0;
  int min = 0;
  findmax(max, min);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @findmax(i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @findmax(i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int http_tocrlf_length(char const *);
int http_value_length(const char *s) { return http_tocrlf_length(s); }


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

x86 assembly (clang, -O2):
<http_value_length>:
jmp    1030 <http_tocrlf_length@plt>

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

LLVM IR (-O2):
define i32 @http_value_length(i8* %0) {
%2 = tail call i32 @http_tocrlf_length(i8* %0)
ret i32 %2
}
/* Variables and functions */
void *malloc(int);
void *LES_MemoryMalloc(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<LES_MemoryMalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @LES_MemoryMalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
void foo440() {}


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

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

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

LLVM IR (-O2):
define void @foo440() {
ret void
}
indreg0adrx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*p0) = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<indreg0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrx1_set>:
movslq %ecx,%rax
mov    0xa98ac7(,%rax,4),%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0adrx1_set(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*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %12
store i32 %17, i32* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @indreg0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %4
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
float const CLOCKS_PER_SEC;
scalar_t__ clock();
void attendre(const float temps) {
  clock_t arrivee;
  arrivee = clock() + (clock_t)(temps * CLOCKS_PER_SEC);
  while (clock() < arrivee)
    ;
}


x86 assembly (clang, -O0):
<attendre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movss  -0x4(%rbp),%xmm0
mov    0x2eb8(%rip),%rcx
mulss  (%rcx),%xmm0
cvttss2si %xmm0,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cmp    -0x10(%rbp),%rax
jge    1156 <attendre+0x46>
jmp    1140 <attendre+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attendre>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
xorps  %xmm0,%xmm0
mulss  0xc(%rsp),%xmm0
cvttss2si %xmm0,%rbx
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1140 <attendre+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = constant float 0.000000e+00
define void @attendre(float %0) {
%2 = alloca float
%3 = alloca i64
store float %0, float* %2
%4 = call i64 (...) @clock()
%5 = load float, float* %2
%6 = load float, float* @CLOCKS_PER_SEC
%7 = fmul float %5, %6
%8 = fptosi float %7 to i64
%9 = add nsw i64 %4, %8
store i64 %9, i64* %3
br label %10
10: ; preds = %14, %1
%11 = call i64 (...) @clock()
%12 = load i64, i64* %3
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = constant float 0.000000e+00
define void @attendre(float %0) {
%2 = tail call i64 (...) @clock()
%3 = fmul float %0, 0.000000e+00
%4 = fptosi float %3 to i64
%5 = add nsw i64 %2, %4
br label %6
6: ; preds = %6, %1
%7 = tail call i64 (...) @clock()
%8 = icmp slt i64 %7, %5
br i1 %8, label %6, label %9
9: ; preds = %6
ret void
}
char *strend(p)
char *p;
{
  while (*p++)
    ;
  return p;
}


x86 assembly (clang, -O0):
<strend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1125 <strend+0x25>
jmp    1108 <strend+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @strend(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* %4
}
int netRssi() {}


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

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

LLVM IR (-O0):
define i32 @netRssi() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @netRssi() {
ret i32 undef
}
double lower(double a, double b) { return a < b; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
cmpltsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lower(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 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @lower(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
void swap(char *a, char *b) {
  char *tmp = a;
  a = b;
  b = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(i8* %0, i8* %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
%7 = load i8*, i8** %4
store i8* %7, i8** %3
%8 = load i8*, i8** %5
store i8* %8, i8** %4
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(char);
char *AllCaps(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++) {
    toupper(str[i]);
  }
  return str;
}


x86 assembly (clang, -O0):
<AllCaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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     1157 <AllCaps+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <AllCaps+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @AllCaps(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %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 %22
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @toupper(i8 signext %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @AllCaps(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @toupper(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__TimerFrom__getNow();
int /*<<< orphan*/ VirtualizeTimerC__0__fireTimers(int /*<<< orphan*/);
void VirtualizeTimerC__0__TimerFrom__fired(void) {
  VirtualizeTimerC__0__fireTimers(VirtualizeTimerC__0__TimerFrom__getNow());
}


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

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

LLVM IR (-O0):
define void @VirtualizeTimerC__0__TimerFrom__fired() {
%1 = call i32 (...) @VirtualizeTimerC__0__TimerFrom__getNow()
%2 = call i32 @VirtualizeTimerC__0__fireTimers(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VirtualizeTimerC__0__TimerFrom__fired() {
%1 = tail call i32 (...) @VirtualizeTimerC__0__TimerFrom__getNow()
%2 = tail call i32 @VirtualizeTimerC__0__fireTimers(i32 %1)
ret void
}
/* Type definitions */
typedef enum Weekday { ____Placeholder_Weekday } Weekday;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void enumSample() {
  enum Weekday { sun, mon, tue, wed, thu, fri, sta };
  enum Weekday day1 = sta;
  printf("%d", day1);
  enum Enum { a = 3, b = 5 };
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @enumSample() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char *buf;
  buf = malloc(1 << 9);
  fgets(buf, 1024, stdin);
  printf("%s\n", buf);
  printf("we are on testing branch \n");
  return 1;
}


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)
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x200,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"we are on testing branch \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 512)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 1024, i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [26 x i8] c"we are on testing branch \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(512) i8* @malloc(i32 512)
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgets(i8* %3, i32 1024, i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) %3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 1
}
foo5() {}


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

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

LLVM IR (-O0):
define i32 @foo5() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo5() {
ret i32 undef
}
/* Variables and functions */
void *memrchr(char *, char, int);
int main(int argc, char **buffer) {
  char buf[10] = "01234A678";
  void *ptr;
  if ((ptr = memrchr(buf, 'A', 10)) == NULL)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1030 <memrchr@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1169 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3736413433323130,%rax
41 36 37
mov    %rax,0x8(%rsp)
movw   $0x38,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1030 <memrchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.buf = [10 x i8] c"01234A678\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = call i8* @memrchr(i8* %9, i8 signext 65, i32 10)
store i8* %10, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"01234A678\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i8* @memrchr(i8* %4, i8 signext 65, i32 10)
%6 = icmp eq i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
int fun412() { return 412; }


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

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

LLVM IR (-O0):
define i32 @fun412() {
ret i32 412
}

LLVM IR (-O2):
define i32 @fun412() {
ret i32 412
}
/* Variables and functions */
size_t b64encsize(size_t n) {
  size_t r;
  r = ((n + 2) / 3) * 4;
  return (r + 1);
}


x86 assembly (clang, -O0):
<b64encsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64encsize>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @b64encsize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 2
%6 = udiv i64 %5, 3
%7 = mul i64 %6, 4
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add i64 %8, 1
ret i64 %9
}

LLVM IR (-O2):
define i64 @b64encsize(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = or i64 %4, 1
ret i64 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit_error(char *, int);
uint32_t transform_address(uint32_t address) {
  uint32_t i = (address & 0xffffffff) - 0x00000000;
  if (i >= (uint32_t)(0x00100000 - 0x00000000))
    exit_error("Attempted to read from RAM address %08x", address);
  return i;
}


x86 assembly (clang, -O0):
<transform_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
sub    $0x0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x100000,-0x8(%rbp)
jl     1143 <transform_address+0x33>
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <exit_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_address>:
push   %rbx
mov    %edi,%ebx
cmp    $0x100000,%edi
jl     1129 <transform_address+0x19>
lea    0xede(%rip),%rdi
mov    %ebx,%esi
call   1030 <exit_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Attempted to read from RAM address %08x\00"
define i32 @transform_address(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -1
%6 = sub i32 %5, 0
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 1048576
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @exit_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [40 x i8] c"Attempted to read from RAM address %08x\00"
define i32 @transform_address(i32 returned %0) {
%2 = icmp sgt i32 %0, 1048575
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ is_memory_cache_ptr(void *);
void memory_free(void *p) {
  if (NULL != p && !is_memory_cache_ptr(p)) {
    free(p);
  }
}


x86 assembly (clang, -O0):
<memory_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1153 <memory_free+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <is_memory_cache_ptr@plt>
cmp    $0x0,%eax
jne    1153 <memory_free+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_free>:
push   %rbx
test   %rdi,%rdi
je     1132 <memory_free+0x12>
mov    %rdi,%rbx
call   1040 <is_memory_cache_ptr@plt>
test   %eax,%eax
je     1134 <memory_free+0x14>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @memory_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @is_memory_cache_ptr(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
define void @memory_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @is_memory_cache_ptr(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @free(i8* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
unsigned long vmMangleRID(unsigned long RIDVal) {
  union bits64 {
    unsigned char bytes[4];
    unsigned long uint;
  };
  union bits64 t;
  unsigned char tmp;
  t.uint = RIDVal;
  tmp = t.bytes[1];
  t.bytes[1] = t.bytes[3];
  t.bytes[3] = tmp;
  return t.uint;
}


x86 assembly (clang, -O0):
<vmMangleRID>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmMangleRID>:
mov    %rdi,%rcx
movabs $0xffffffff00ff00ff,%rax
ff ff ff
and    %rdi,%rax
and    $0xff00,%edi
shl    $0x10,%rdi
shr    $0x10,%rcx
and    $0xff00,%ecx
or     %rdi,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
%union.bits64 = type { i64 }
define i64 @vmMangleRID(i64 %0) {
%2 = alloca i64
%3 = alloca %union.bits64
%4 = alloca i8
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = bitcast %union.bits64* %3 to i64*
store i64 %5, i64* %6
%7 = bitcast %union.bits64* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 1
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = bitcast %union.bits64* %3 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 3
%12 = load i8, i8* %11
%13 = bitcast %union.bits64* %3 to [4 x i8]*
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 1
store i8 %12, i8* %14
%15 = load i8, i8* %4
%16 = bitcast %union.bits64* %3 to [4 x i8]*
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 3
store i8 %15, i8* %17
%18 = bitcast %union.bits64* %3 to i64*
%19 = load i64, i64* %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @vmMangleRID(i64 %0) {
%2 = shl i64 %0, 16
%3 = and i64 %2, 4278190080
%4 = lshr i64 %0, 16
%5 = and i64 %4, 65280
%6 = and i64 %0, -4278255361
%7 = or i64 %6, %3
%8 = or i64 %7, %5
ret i64 %8
}
int PortableTruncate_justHereToAvoidRanlibWarning(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PortableTruncate_justHereToAvoidRanlibWarning() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ strcmp(char const *, char *);
int test_4(const char *str, char *ptr) {
  if (strcmp(str, "VALUE")) {
  } else
    free(ptr);
  free(ptr);
}


x86 assembly (clang, -O0):
<test_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     114f <test_4+0x2f>
jmp    1158 <test_4+0x38>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_4>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    113d <test_4+0x1d>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"VALUE\00"
define i32 @test_4(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"VALUE\00"
define i32 @test_4(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %2, %5
%8 = tail call i32 @free(i8* %1)
ret i32 undef
}
int compar(p, q) const void *p, *q;
{ return (strcmp(*(const char *const *)p, *(const char *const *)q)); }


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

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

LLVM IR (-O0):
define i32 @compar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void foo421(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo421(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma_multiplos(int, int);
int main(void) {
  printf("\nSoma dos múltiplos de 3 = %d\n", soma_multiplos(3, 1000));
  printf("\nSoma dos múltiplos de 7 = %d\n\n", soma_multiplos(7, 1000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x3e8,%esi
call   1030 <soma_multiplos@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7,%edi
mov    $0x3e8,%esi
call   1030 <soma_multiplos@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x3e8,%esi
call   1030 <soma_multiplos@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x7,%edi
mov    $0x3e8,%esi
call   1030 <soma_multiplos@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0ASoma dos m\C3\BAltiplos de 3 = %d\0A\00"
@.str.1 = [33 x i8] c"\0ASoma dos m\C3\BAltiplos de 7 = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @soma_multiplos(i32 3, i32 1000)
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @soma_multiplos(i32 7, i32 1000)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0ASoma dos m\C3\BAltiplos de 3 = %d\0A\00"
@.str.1 = [33 x i8] c"\0ASoma dos m\C3\BAltiplos de 7 = %d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @soma_multiplos(i32 3, i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @soma_multiplos(i32 7, i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
double wrap(double v) {
  if (v < -0.5)
    v += 1.0;
  else if (v >= 0.5)
    v -= 1.0;
  return v;
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1133 <wrap+0x33>
movsd  0xeec(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <wrap+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1160 <wrap+0x60>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <wrap+0x65>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1117 <wrap+0x17>
addsd  0xf02(%rip),%xmm0
ret
ucomisd 0xee9(%rip),%xmm0
jb     1129 <wrap+0x29>
addsd  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wrap(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, -5.000000e-01
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 1.000000e+00
store double %7, double* %2
br label %15
8: ; preds = %1
%9 = load double, double* %2
%10 = fcmp oge double %9, 5.000000e-01
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %2
%13 = fsub double %12, 1.000000e+00
store double %13, double* %2
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %5
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @wrap(double %0) {
%2 = fcmp olt double %0, -5.000000e-01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 1.000000e+00
br label %9
5: ; preds = %1
%6 = fcmp ult double %0, 5.000000e-01
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = fadd double %0, -1.000000e+00
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xd2() {
  Assert_real((isalnum(210) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1055, ("isalnum should be 0 for 0xd2"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xd2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd2,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x41f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xd2>:
push   %rax
mov    $0xd2,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd2\00"
define void @t_isalnum_0xd2() {
%1 = call i64 @isalnum(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd2\00"
define void @t_isalnum_0xd2() {
%1 = tail call i64 @isalnum(i32 210)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void bnx2x_stats_do_nothing(struct bnx2x *bp) {}


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

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

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

LLVM IR (-O2):
%struct.bnx2x = type opaque
define void @bnx2x_stats_do_nothing(%struct.bnx2x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int *);
int /*<<< orphan*/ foo_irrelevant(int);
int use(int c) {
  int xx;
  int *y = &xx;
  foo(c, y);
  foo_irrelevant(c);
  return xx + 3;
}


x86 assembly (clang, -O0):
<use>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <foo@plt>
mov    -0x4(%rbp),%edi
call   1040 <foo_irrelevant@plt>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rsi
call   1030 <foo@plt>
mov    %ebx,%edi
call   1040 <foo_irrelevant@plt>
mov    0xc(%rsp),%eax
add    $0x3,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @use(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32* %3, i32** %4
%5 = load i32, i32* %2
%6 = load i32*, i32** %4
%7 = call i32 @foo(i32 %5, i32* %6)
%8 = load i32, i32* %2
%9 = call i32 @foo_irrelevant(i32 %8)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 3
ret i32 %11
}

LLVM IR (-O2):
define i32 @use(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @foo(i32 %0, i32* %2)
%5 = call i32 @foo_irrelevant(i32 %0)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 3
ret i32 %7
}
/* Variables and functions */
int __get_unaligned_le32(char *);
int le32_to_int(char *le32) { return (__get_unaligned_le32(le32)); }


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

x86 assembly (clang, -O2):
<le32_to_int>:
jmp    1030 <__get_unaligned_le32@plt>

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

LLVM IR (-O2):
define i32 @le32_to_int(i8* %0) {
%2 = tail call i32 @__get_unaligned_le32(i8* %0)
ret i32 %2
}
/* Variables and functions */
bool is_even(size_t n) { return (n % 2) == 0; }


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %rdi,%rax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_even(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 2
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_even(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t rgb24ToRgb32(uint32_t col, uint8_t alpha) {
  uint32_t c32_o = 0;
  uint8_t *c24 = (uint8_t *)&col;
  uint8_t *c32 = (uint8_t *)&c32_o;
  c32[0] = c24[2];
  c32[1] = c24[1];
  c32[2] = c24[0];
  c32[3] = alpha;
  return c32_o;
}


x86 assembly (clang, -O0):
<rgb24ToRgb32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rgb24ToRgb32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32* %3, i32** %6
store i32* %5, i32** %7
%8 = load i32*, i32** %6
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = load i32*, i32** %7
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %10, i32* %12
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = load i32*, i32** %7
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %20, i32* %22
%23 = load i32, i32* %4
%24 = load i32*, i32** %7
%25 = getelementptr inbounds i32, i32* %24, i64 3
store i32 %23, i32* %25
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @rgb24ToRgb32(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int hammingWeight(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
void test(unsigned n) { printf("%d, %d\n", n, hammingWeight(n)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hammingWeight@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1040 <hammingWeight@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @hammingWeight(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ trm_str(char *);
void pnumber(int n) {
  char buf[10];
  sprintf(buf, "%d", n);
  trm_str(buf);
}


x86 assembly (clang, -O0):
<pnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0xe(%rbp),%rdi
call   1040 <trm_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnumber>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <trm_str@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @pnumber(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @trm_str(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, char const *, unsigned int);
int sys_memfd_create(char const *, unsigned int);
void mfd_fail_new(const char *name, unsigned int flags) {
  int r;
  r = sys_memfd_create(name, flags);
  if (r >= 0) {
    printf("memfd_create(\"%s\", %u) succeeded, but failure expected\n", name,
           flags);
    close(r);
    abort();
  }
}


x86 assembly (clang, -O0):
<mfd_fail_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <sys_memfd_create@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     118a <mfd_fail_new+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
call   1050 <close@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfd_fail_new>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1060 <sys_memfd_create@plt>
test   %eax,%eax
jns    1158 <mfd_fail_new+0x18>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebp
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <printf@plt>
mov    %ebp,%edi
call   1050 <close@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"memfd_create(\22%s\22, %u) succeeded, but failure expected\0A\00"
define void @mfd_fail_new(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @sys_memfd_create(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @close(i32 %15)
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"memfd_create(\22%s\22, %u) succeeded, but failure expected\0A\00"
define void @mfd_fail_new(i8* %0, i32 %1) {
%3 = tail call i32 @sys_memfd_create(i8* %0, i32 %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%7 = tail call i32 @close(i32 %3)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret void
}