xunge/DecIR huggingface dataset:
int get18(const unsigned char *p) {
  int r = p[0] + p[1] * 256 + (p[2] & 3) * 65536;
  if (r & 131072)
    r -= 262144;
  return r;
}


x86 assembly (clang, -O0):
<get18>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0x3,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     114b <get18+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x40000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get18>:
movzwl (%rdi),%eax
movzbl 0x2(%rdi),%ecx
mov    %ecx,%edx
and    $0x3,%edx
shl    $0x10,%edx
lea    (%rdx,%rax,1),%esi
test   $0x2,%cl
lea    -0x40000(%rdx,%rax,1),%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @get18(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 256
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, 3
%19 = mul nsw i32 %18, 65536
%20 = add nsw i32 %13, %19
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = and i32 %21, 131072
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %1
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 262144
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %1
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @get18(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = and i8 %10, 3
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %13, %8
%15 = and i32 %12, 2
%16 = icmp eq i32 %15, 0
%17 = or i32 %14, -262144
%18 = select i1 %16, i32 %14, i32 %17
ret i32 %18
}
void RTStrToInt8Full(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @init_channel() {
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
init(struct node *q) { q = NULL; }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @init(%struct.node* %0) {
%2 = alloca i32
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* null, %struct.node** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @init(%struct.node* nocapture readnone %0) {
ret i32 undef
}
unsigned default_eq_fnc(void *key1, void *key2) { return key1 == key2; }


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

x86 assembly (clang, -O2):
<default_eq_fnc>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @default_eq_fnc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @default_eq_fnc(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int foo[2];
  int *bar = foo;
  unsigned long a = (unsigned long)bar;
  unsigned long b = (unsigned long)(bar + 1);
  assert(b - a == sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
cmp    $0x4,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i64
store i64 %8, i64* %4
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = ptrtoint i32* %10 to i64
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = sub i64 %12, %13
%15 = icmp eq i64 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ checkFile(char *);
int main(int argc, char **argv) {
  (void)argc;
  checkFile(argv[0]);
  checkFile("/this/does/not/exist");
  checkFile("/home");
  checkFile("");
  checkFile("/root/test");
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <checkFile@plt>
lea    0xec7(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xed0(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xec9(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xebe(%rip),%rdi
call   1030 <checkFile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <checkFile@plt>
lea    0xee0(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xee9(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xee2(%rip),%rdi
call   1030 <checkFile@plt>
lea    0xed7(%rip),%rdi
call   1030 <checkFile@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/this/does/not/exist\00"
@.str.1 = [6 x i8] c"/home\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"/root/test\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @checkFile(i8* %9)
%11 = call i32 @checkFile(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @checkFile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @checkFile(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @checkFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"/this/does/not/exist\00"
@.str.1 = [6 x i8] c"/home\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"/root/test\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @checkFile(i8* %3)
%5 = tail call i32 @checkFile(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @checkFile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @checkFile(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @checkFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
long round(int);
long tspec_to_us(struct timespec *ts) {
  return round((ts->tv_sec * 1E9 + ts->tv_nsec) / 1000.0);
}


x86 assembly (clang, -O0):
<tspec_to_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tspec_to_us>:
cvtsi2sdl (%rdi),%xmm0
cvtsi2sdl 0x4(%rdi),%xmm1
mulsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @tspec_to_us(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+09, double %10)
%12 = fdiv double %11, 1.000000e+03
%13 = fptosi double %12 to i32
%14 = call i64 @round(i32 %13)
ret i64 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @tspec_to_us(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+09, double %7)
%9 = fdiv double %8, 1.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i64 @round(i32 %10)
ret i64 %11
}
void f(void) {
  int v2 = 3;
#pragma acc host_data copy(v2)
  ;
#pragma acc host_data use_device(v2)
  ;
#pragma acc host_data use_device(v0)
  ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int xround(const float f) { return f - (int)f > 0.5 ? (int)(f + 1.0) : (int)f; }


x86 assembly (clang, -O0):
<xround>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <xround+0x52>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <xround+0x5a>
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xround>:
cvttss2si %xmm0,%ecx
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cvtss2sd %xmm0,%xmm2
subss  %xmm1,%xmm0
ucomiss 0xee6(%rip),%xmm0
addsd  0xee6(%rip),%xmm2
cvttsd2si %xmm2,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xround(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
%7 = fsub float %3, %6
%8 = fpext float %7 to double
%9 = fcmp ogt double %8, 5.000000e-01
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fadd double %12, 1.000000e+00
%14 = fptosi double %13 to i32
br label %18
15: ; preds = %1
%16 = load float, float* %2
%17 = fptosi float %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @xround(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fcmp ogt float %4, 5.000000e-01
%6 = fpext float %0 to double
%7 = fadd double %6, 1.000000e+00
%8 = fptosi double %7 to i32
%9 = select i1 %5, i32 %8, i32 %2
ret i32 %9
}
/* Type definitions */
struct node {
  int dummy;
};
struct edge {
  int dummy;
};

/* Variables and functions */
struct node *compact(struct edge *root) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.edge = type { i32 }
define %struct.node* @compact(%struct.edge* %0) {
%2 = alloca %struct.edge*
store %struct.edge* %0, %struct.edge** %2
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.edge = type { i32 }
define noalias %struct.node* @compact(%struct.edge* nocapture readnone %0) {
ret %struct.node* null
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
void BN_free(void *p) { __coverity_free__(p); }


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

x86 assembly (clang, -O2):
<BN_free>:
jmp    1030 <__coverity_free__@plt>

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

LLVM IR (-O2):
define void @BN_free(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sockaddr *);
int /*<<< orphan*/ printf(char *);
void releaseAddress(struct sockaddr *addr) {
  if (addr) {
    free(addr);
  } else {
    printf("Error: An NULL address to free!\n");
  }
}


x86 assembly (clang, -O0):
<releaseAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <releaseAddress+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    1151 <releaseAddress+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaseAddress>:
test   %rdi,%rdi
je     112a <releaseAddress+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [33 x i8] c"Error: An NULL address to free!\0A\00"
define void @releaseAddress(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = icmp ne %struct.sockaddr* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.sockaddr*, %struct.sockaddr** %2
%7 = call i32 @free(%struct.sockaddr* %6)
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@str = [32 x i8] c"Error: An NULL address to free!\00"
define void @releaseAddress(%struct.sockaddr* %0) {
%2 = icmp eq %struct.sockaddr* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.sockaddr* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int PTHREAD_SCOPE_PROCESS;
void test_PTHREAD_SCOPE_PROCESS(void) {
  int dummy = PTHREAD_SCOPE_PROCESS;
  (void)dummy;
}


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

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

LLVM IR (-O0):
@PTHREAD_SCOPE_PROCESS = global i32 0
define void @test_PTHREAD_SCOPE_PROCESS() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_SCOPE_PROCESS
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
@PTHREAD_SCOPE_PROCESS = global i32 0
define void @test_PTHREAD_SCOPE_PROCESS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isgraph(int);
int ispunct(int c) { return isgraph(c) && !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1158 <ispunct+0x38>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1040 <isgraph@plt>
test   %rax,%rax
je     113f <ispunct+0x1f>
mov    %ebx,%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x8a() {
  Assert_real((isspace(138) == 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_isspace.c",
              695, ("isspace should be 0 for 0x8a"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x8a\00"
define void @t_isspace_0x8a() {
%1 = call i64 @isspace(i32 138)
%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 695, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x8a\00"
define void @t_isspace_0x8a() {
%1 = tail call i64 @isspace(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void AnalogConversionStart(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @nrf_802154_timer_critical_section_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush() {
  dump(NULL);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <dump@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
xor    %edi,%edi
call   1030 <dump@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush() {
%1 = call i32 @dump(i32* null)
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush() {
%1 = tail call i32 @dump(i32* null)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char a[10];
  printf("Enter the sentence:");
  scanf("%9s", a);
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xe(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the sentence:\00"
@.str.1 = [4 x i8] c"%9s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter the sentence:\00"
@.str.1 = [4 x i8] c"%9s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
int funcion_i_void() {
  int d;
  return d;
  d = 60;
}


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

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

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

LLVM IR (-O2):
define i32 @funcion_i_void() {
ret i32 undef
}
double ops_matvec(int n) { return 2.0 * n * n - n; }


x86 assembly (clang, -O0):
<ops_matvec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ops_matvec>:
cvtsi2sd %edi,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ops_matvec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 2.000000e+00, %4
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %5, double %7, double %10)
ret double %11
}

LLVM IR (-O2):
define double @ops_matvec(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 2.000000e+00
%4 = fneg double %2
%5 = tail call double @llvm.fmuladd.f64(double %3, double %2, double %4)
ret double %5
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ linkname_from_resource_name(char *, char const *);
int register_path(char *, char const *);
int register_resource(const char *name, const char *path) {
  char linkname[PATH_MAX];
  linkname_from_resource_name(linkname, name);
  return register_path(linkname, path);
}


x86 assembly (clang, -O0):
<register_resource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
call   1040 <linkname_from_resource_name@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <register_path@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_resource>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <linkname_from_resource_name@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <register_path@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i32 @register_resource(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @PATH_MAX
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %3
%12 = call i32 @linkname_from_resource_name(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @register_path(i8* %10, i8* %13)
%15 = load i8*, i8** %5
ret i32 %14
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i32 @register_resource(i8* %0, i8* %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @linkname_from_resource_name(i8* %5, i8* %0)
%7 = call i32 @register_path(i8* %5, i8* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _os_platform_sleep();
void _os_hangout(void *arg) {
  while (1) {
    _os_platform_sleep();
  }
}


x86 assembly (clang, -O0):
<_os_hangout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_os_platform_sleep@plt>
jmp    111c <_os_hangout+0xc>

x86 assembly (clang, -O2):
<_os_hangout>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_os_platform_sleep@plt>
jmp    1120 <_os_hangout+0x10>

LLVM IR (-O0):
define void @_os_hangout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @_os_platform_sleep()
br label %3
}

LLVM IR (-O2):
define void @_os_hangout(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @_os_platform_sleep()
br label %2
}
int test_imm_14int64_lowword_reg(long long val) {
  return ((val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 20
%5 = icmp ne i64 %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_14int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 20
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int cl_glimpse_size0(struct inode *, int);
int cl_agl(struct inode *inode) { return cl_glimpse_size0(inode, 1); }


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

x86 assembly (clang, -O2):
<cl_agl>:
mov    $0x1,%esi
jmp    1030 <cl_glimpse_size0@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define i32 @cl_agl(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @cl_glimpse_size0(%struct.inode* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define i32 @cl_agl(%struct.inode* %0) {
%2 = tail call i32 @cl_glimpse_size0(%struct.inode* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handle_interrup(int signo) { printf("sign = %d\n", signo); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"sign = %d\0A\00"
define void @handle_interrup(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_write_one(char);
void serial_write(char *s, size_t amount) {
  for (size_t i = 0; i < amount; i++) {
    serial_write_one(s[i]);
  }
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <serial_write+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <serial_write_one@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <serial_write+0x18>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @serial_write(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @serial_write_one(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
unsigned char const *ASN1_STRING_data(int /*<<< orphan*/ *);
const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) {
  return ASN1_STRING_data((ASN1_STRING *)x);
}


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

x86 assembly (clang, -O2):
<ASN1_STRING_get0_data>:
jmp    1030 <ASN1_STRING_data@plt>

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

LLVM IR (-O2):
define i8* @ASN1_STRING_get0_data(i32* %0) {
%2 = tail call i8* @ASN1_STRING_data(i32* %0)
ret i8* %2
}
void f4(void) {
  int i = 0;
#pragma omp task default(shared) if (0)
  {
#pragma omp simd linear(i : 1)
    for (i = 0; i < 100; i++)
      ;
  }
  if (i != 100)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1143 <f4+0x33>
jmp    1135 <f4+0x25>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <f4+0x16>
cmpl   $0x64,-0x4(%rbp)
je     1152 <f4+0x42>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f4() {
ret void
}
long long GetNumPlayers() { return 1LL; }


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

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

LLVM IR (-O0):
define i64 @GetNumPlayers() {
ret i64 1
}

LLVM IR (-O2):
define i64 @GetNumPlayers() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int stop_redirect() {
  puts("stop_redirect ");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"stop_redirect \00"
define i32 @stop_redirect() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fromBCD(int a) { return ((a >> 4) & 0xf) * 10 + (a & 0xf); }


x86 assembly (clang, -O0):
<fromBCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromBCD>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @fromBCD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = and i32 %4, 15
%6 = mul nsw i32 %5, 10
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @fromBCD(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = mul nuw nsw i32 %3, 10
%5 = and i32 %0, 15
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
int library2Function() { return 42; }


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

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

LLVM IR (-O0):
define i32 @library2Function() {
ret i32 42
}

LLVM IR (-O2):
define i32 @library2Function() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_puts(char *s) {
  while (*s) {
    if (*s == '\n')
      uart_putc('\r');
    uart_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <uart_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <uart_puts+0x33>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <uart_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <uart_puts+0x10>
test   %al,%al
jne    112d <uart_puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @uart_putc(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @uart_putc(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
float gaussianBurn(float radius, float *params) { return 0.0; }


x86 assembly (clang, -O0):
<gaussianBurn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussianBurn>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @gaussianBurn(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @gaussianBurn(float %0, float* nocapture readnone %1) {
ret float 0.000000e+00
}
void wifi_list() {}


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

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

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

LLVM IR (-O2):
define void @wifi_list() {
ret void
}
imm0adrreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movswl 0x87a22(%rax),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     1143 <imm0adrreg1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <imm0adrreg1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrreg1>:
xor    %eax,%eax
cmpw   $0x16,0x87a22(%r9)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = icmp sgt i16 %8, 21
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hidden() { printf("\n[!] Correct overflow.\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"\0A[!] Correct overflow.\00"
define void @hidden() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
void switch_iopl_mask(struct thread_struct *prev, struct thread_struct *next) {}


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

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

LLVM IR (-O0):
%struct.thread_struct = type opaque
define void @switch_iopl_mask(%struct.thread_struct* %0, %struct.thread_struct* %1) {
%3 = alloca %struct.thread_struct*
%4 = alloca %struct.thread_struct*
store %struct.thread_struct* %0, %struct.thread_struct** %3
store %struct.thread_struct* %1, %struct.thread_struct** %4
ret void
}

LLVM IR (-O2):
%struct.thread_struct = type opaque
define void @switch_iopl_mask(%struct.thread_struct* nocapture %0, %struct.thread_struct* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint_least16_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint_least16_t(uint_least16_t const k1,
                                             uint_least16_t const k2) {
  return k1 == k2;
}


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

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint_least16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_least16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
size_t writen(int, void *, size_t);
void Writen(int fd, void *ptr, size_t nbytes) {
  if (writen(fd, ptr, nbytes) != nbytes)
    err_sys("writen error");
}


x86 assembly (clang, -O0):
<Writen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <writen@plt>
cmp    -0x18(%rbp),%rax
je     1159 <Writen+0x39>
lea    0xeac(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Writen>:
push   %rbx
mov    %rdx,%rbx
call   1040 <writen@plt>
cmp    %rbx,%rax
jne    1130 <Writen+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <err_sys@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"writen error\00"
define void @Writen(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @writen(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
double average_power(double rms_voltage, double resistance) {
  return (rms_voltage * rms_voltage / resistance);
}


x86 assembly (clang, -O0):
<average_power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average_power>:
mulsd  %xmm0,%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @average_power(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* %3
%7 = fmul double %5, %6
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @average_power(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fdiv double %3, %1
ret double %4
}