xunge/DecIR huggingface dataset:
int match_token(str)
char *str;
{
  char *tok;
  return (str && (tok = need_token()) && strcasecmp(str, tok) == 0);
}


x86 assembly (clang, -O0):
<match_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     116f <match_token+0x4f>
mov    $0x0,%al
call   1040 <need_token@plt>
movslq %eax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116f <match_token+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_token>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114d <match_token+0x2d>
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <need_token@plt>
test   %eax,%eax
je     114f <match_token+0x2f>
movslq %eax,%rsi
mov    %r14,%rdi
call   1030 <strcasecmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
jmp    114f <match_token+0x2f>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @match_token(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = call i32 (...) @need_token()
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8*, i8** %3
%14 = call i32 @strcasecmp(i8* %12, i8* %13)
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %11, %6, %1
%17 = phi i1 [ false, %6 ], [ false, %1 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @match_token(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 (...) @need_token()
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcasecmp(i8* %0, i8* %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %3, %1
%13 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
extern int num_density(struct Num *this) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.Num = type opaque
define i32 @num_density(%struct.Num* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int a[], int aSize) {
  int i;
  for (i = 0; i < aSize; i++) {
    printf("%d\n", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ get_export(struct pe_image *, char const *, void **);
void *GetProcAddress(struct pe_image *pe, const char *name) {
  void *ptr = NULL;
  get_export(pe, name, &ptr);
  return ptr;
}


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

x86 assembly (clang, -O2):
<GetProcAddress>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdx
call   1030 <get_export@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pe_image = type { i32 }
define i8* @GetProcAddress(%struct.pe_image* %0, i8* %1) {
%3 = alloca %struct.pe_image*
%4 = alloca i8*
%5 = alloca i8*
store %struct.pe_image* %0, %struct.pe_image** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load %struct.pe_image*, %struct.pe_image** %3
%7 = load i8*, i8** %4
%8 = call i32 @get_export(%struct.pe_image* %6, i8* %7, i8** %5)
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.pe_image = type { i32 }
define i8* @GetProcAddress(%struct.pe_image* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @get_export(%struct.pe_image* %0, i8* %1, i8** %3)
%6 = load i8*, i8** %3
ret i8* %6
}
void liberar(float **matriz, int xpoints) {
  int i;
  for (i = 0; i < xpoints; i++) {
    free(matriz[i]);
  }
  free(matriz);
}


x86 assembly (clang, -O0):
<liberar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <liberar+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <liberar+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liberar>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <liberar+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <liberar+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @liberar(float** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float*, float** %0, i64 %7
%9 = bitcast float** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast float** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_ptrarg(int *, int);
int /*<<< orphan*/ limit2_i32(int *, int, int);
int mksym_i32();
int ptrarg(int *);
void test_ptrarg() {
  int x = mksym_i32();
  limit2_i32(&x, 28, 42);
  int res = ptrarg(&x);
  gen_ptrarg(&x, res);
}


x86 assembly (clang, -O0):
<test_ptrarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <mksym_i32@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1c,%esi
mov    $0x2a,%edx
call   1050 <limit2_i32@plt>
lea    -0x4(%rbp),%rdi
call   1060 <ptrarg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1040 <gen_ptrarg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ptrarg>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <mksym_i32@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1c,%esi
mov    $0x2a,%edx
call   1050 <limit2_i32@plt>
mov    %rbx,%rdi
call   1060 <ptrarg@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <gen_ptrarg@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_ptrarg() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @mksym_i32()
store i32 %3, i32* %1
%4 = call i32 @limit2_i32(i32* %1, i32 28, i32 42)
%5 = call i32 @ptrarg(i32* %1)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @gen_ptrarg(i32* %1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_ptrarg() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @mksym_i32()
store i32 %3, i32* %1
%4 = call i32 @limit2_i32(i32* %1, i32 28, i32 42)
%5 = call i32 @ptrarg(i32* %1)
%6 = call i32 @gen_ptrarg(i32* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free5(void *****);
void free5ushort(unsigned short *****p) { free5((void *****)p); }


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

x86 assembly (clang, -O2):
<free5ushort>:
jmp    1030 <free5@plt>

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

LLVM IR (-O2):
define void @free5ushort(i16***** %0) {
%2 = bitcast i16***** %0 to i8*****
%3 = tail call i32 @free5(i8***** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ estimateParametersML(int);
void estimateParameters(int population_index) {
  estimateParametersML(population_index);
}


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

x86 assembly (clang, -O2):
<estimateParameters>:
jmp    1030 <estimateParametersML@plt>

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

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

/* Variables and functions */
char const *GetConstructModuleName(struct constructHeader *);
const char *EnvDefruleModule(void *theEnv, void *theDefrule) {
  return GetConstructModuleName((struct constructHeader *)theDefrule);
}


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

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

LLVM IR (-O0):
%struct.constructHeader = type { i32 }
define i8* @EnvDefruleModule(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.constructHeader*
%7 = call i8* @GetConstructModuleName(%struct.constructHeader* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define i8* @EnvDefruleModule(i8* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.constructHeader*
%4 = tail call i8* @GetConstructModuleName(%struct.constructHeader* %3)
ret i8* %4
}
void error(void) {
  {
  ERROR:
    goto ERROR;
  }
}


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

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

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

LLVM IR (-O2):
define void @error() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t extractSignedBits(uint32_t word, uint32_t lowBitOffset,
                           uint32_t size) {
  uint32_t mask = (1u << size) - 1;
  uint32_t value = (word >> lowBitOffset) & mask;
  if (value & (1u << (size - 1)))
    value |= ~mask;
  return value;
}


x86 assembly (clang, -O0):
<extractSignedBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1154 <extractSignedBits+0x54>
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractSignedBits>:
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
mov    %esi,%ecx
mov    %eax,%esi
shr    %cl,%edi
not    %esi
and    %edi,%esi
add    $0xff,%dl
movzbl %dl,%ecx
or     %edi,%eax
bt     %ecx,%esi
cmovae %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @extractSignedBits(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = lshr i32 %0, %1
%7 = and i32 %6, %5
%8 = add i32 %2, -1
%9 = shl nuw i32 1, %8
%10 = and i32 %7, %9
%11 = icmp eq i32 %10, 0
%12 = or i32 %4, %6
%13 = select i1 %11, i32 %7, i32 %12
ret i32 %13
}
double _g_4(void) { return 0.0; }


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

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

LLVM IR (-O0):
define double @_g_4() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @_g_4() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_bit(int, char);
void led_write_1(char value) { gpio_write_bit(7, value); }


x86 assembly (clang, -O0):
<led_write_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gpio_write_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_write_1>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <gpio_write_bit@plt>

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

LLVM IR (-O2):
define void @led_write_1(i8 signext %0) {
%2 = tail call i32 @gpio_write_bit(i32 7, i8 signext %0)
ret void
}
RX0I1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jg     113f <RX0I1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <RX0I1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpb   $0x22,(%r8,%rcx,1)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = icmp slt i8 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
size_t align_to(size_t n, size_t align) {
  size_t x = align - 1;
  return (n + x) & ~x;
}


x86 assembly (clang, -O0):
<align_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align_to(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
store i64 %7, i64* %5
%8 = load i64, i64* %3
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = load i64, i64* %5
%12 = xor i64 %11, -1
%13 = and i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @align_to(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
int f(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void cleanup_net() {}


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

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

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

LLVM IR (-O2):
define void @cleanup_net() {
ret void
}
/* Variables and functions */
bool is_almost_zero_ex(double val, double eps) {
  return (-eps < val) && (val < eps);
}


x86 assembly (clang, -O0):
<is_almost_zero_ex>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jbe    1152 <is_almost_zero_ex+0x52>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_almost_zero_ex>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
seta   %al
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_almost_zero_ex(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fneg double %5
%7 = load double, double* %3
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fcmp olt double %10, %11
br label %13
13: ; preds = %9, %2
%14 = phi i1 [ false, %2 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_almost_zero_ex(double %0, double %1) {
%3 = fneg double %1
%4 = fcmp olt double %3, %0
%5 = fcmp olt double %0, %1
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double frand_a_b(double a, double b) {
  return (rand() / (double)RAND_MAX) * (b - a) + a;
}


x86 assembly (clang, -O0):
<frand_a_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2eb8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frand_a_b>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @frand_a_b(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @rand()
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %8, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @frand_a_b(double %0, double %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
int byte_order() {
  union {
    int i;
    char c[sizeof(int)];
  } u;
  u.i = 1;
  if ((int)u.c[sizeof(int) - 1] == 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<byte_order>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <byte_order+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <byte_order+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @byte_order() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i32*
store i32 1, i32* %3
%4 = bitcast %union.anon* %2 to [4 x i8]*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @byte_order() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ port_lock_from_isr();
void chSysLockFromISR(void) {
  port_lock_from_isr();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @chSysLockFromISR() {
%1 = tail call i32 (...) @port_lock_from_isr()
ret void
}
void alrm_handler(int type) {}


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

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

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

LLVM IR (-O2):
define void @alrm_handler(i32 %0) {
ret void
}
int funcmais(int input) { return (input + 1); }


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

x86 assembly (clang, -O2):
<funcmais>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @funcmais(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
__attribute__((always_)) int request_module_nowait(const char *name, ...) {
  return -38;
}


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

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

LLVM IR (-O0):
define i32 @request_module_nowait(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -38
}

LLVM IR (-O2):
define i32 @request_module_nowait(i8* nocapture readnone %0, ...) {
ret i32 -38
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
uint64_t ltob_64(uint64_t num) {
  uint32_t high_part, low_part;
  high_part = htonl((uint32_t)(num >> 32));
  low_part = htonl((uint32_t)(num & 0xFFFFFFFFLL));
  return (((uint64_t)(low_part)) << 32) | high_part;
}


x86 assembly (clang, -O0):
<ltob_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltob_64>:
push   %rbx
mov    %edi,%ebx
call   1030 <htonl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @ltob_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
%12 = call i32 @htonl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 32
%15 = load i32, i32* %3
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @ltob_64(i32 %0) {
%2 = tail call i32 @htonl(i32 poison)
%3 = tail call i32 @htonl(i32 %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ mb();
extern void outl(unsigned int b, unsigned long addr) {
  *(volatile unsigned int *)((addr << 7) +
                             ((0xfffffc0000000000UL) + 0x300000000UL) + 0x60) =
      b;
  mb();
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
shl    $0x7,%rax
movabs $0xfffffc0300000000,%rdx
fc ff ff
add    %rdx,%rax
mov    %ecx,0x60(%rax)
mov    $0x0,%al
call   1030 <mb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
shl    $0x7,%rsi
movabs $0xfffffc0300000060,%rax
fc ff ff
mov    %edi,(%rsi,%rax,1)
xor    %eax,%eax
jmp    1030 <mb@plt>

LLVM IR (-O0):
define void @outl(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = shl i64 %6, 7
%8 = add i64 %7, -4385161609216
%9 = add i64 %8, 96
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
%11 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i64 %1) {
%3 = shl i64 %1, 7
%4 = add i64 %3, -4385161609120
%5 = inttoptr i64 %4 to i32*
store volatile i32 %0, i32* %5
%6 = tail call i32 (...) @mb()
ret void
}
void WeaponXM1014_ReloadNULL(void) {}


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

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

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

LLVM IR (-O2):
define void @WeaponXM1014_ReloadNULL() {
ret void
}
extern int logError(const char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @logError(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int file_exists(char *path) { return !access(path, F_OK); }


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int xtensa_soffset(v)
int v;
{ return v >= -131072 && v <= 131071; }


x86 assembly (clang, -O0):
<xtensa_soffset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xfffe0000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xtensa_soffset+0x26>
cmpl   $0x1ffff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_soffset>:
add    $0x20000,%edi
xor    %eax,%eax
cmp    $0x40000,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xtensa_soffset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, -131072
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 131071
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xtensa_soffset(i32 %0) {
%2 = add i32 %0, 131072
%3 = icmp ult i32 %2, 262144
%4 = zext i1 %3 to i32
ret i32 %4
}
void inc_zcache_pers_zbytes(unsigned clen) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_pers_zbytes(i32 %0) {
ret void
}
int positiveInt_separator(const void *arg) {
  int *tmp;
  tmp = (int *)arg;
  if (*tmp >= 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<positiveInt_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1129 <positiveInt_separator+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <positiveInt_separator+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<positiveInt_separator>:
mov    (%rdi),%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @positiveInt_separator(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
void s3mplayer_code_lock_start(void) {}


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

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

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

LLVM IR (-O2):
define void @s3mplayer_code_lock_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int checkForkStatus(int *forkVal, int child) {
  if ((*forkVal) == -1) {
    fprintf(stderr, "ERROR: Fork of Child %d failed!\n", child);
    return 1;
  }
}


x86 assembly (clang, -O0):
<checkForkStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    114b <checkForkStatus+0x3b>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForkStatus>:
push   %rax
cmpl   $0xffffffff,(%rdi)
jne    112d <checkForkStatus+0x1d>
mov    %esi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: Fork of Child %d failed!\0A\00"
define i32 @checkForkStatus(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i32, i32* %5
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 1, i32* %3
br label %13
13: ; preds = %9, %2
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: Fork of Child %d failed!\0A\00"
define i32 @checkForkStatus(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %5, %2
ret i32 1
}
/* Variables and functions */
int alu_tle(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ op_pop();
int op_tle() { return alu_tle(op_pop(), op_pop()); }


x86 assembly (clang, -O0):
<op_tle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <alu_tle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_tle>:
push   %rbx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <alu_tle@plt>

LLVM IR (-O0):
define i32 @op_tle() {
%1 = call i32 (...) @op_pop()
%2 = call i32 (...) @op_pop()
%3 = call i32 @alu_tle(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @op_tle() {
%1 = tail call i32 (...) @op_pop()
%2 = tail call i32 (...) @op_pop()
%3 = tail call i32 @alu_tle(i32 %1, i32 %2)
ret i32 %3
}
void testClosureLLrV(void (*closure)(long long), long long a1) {
  (*closure)(a1);
}


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

x86 assembly (clang, -O2):
<testClosureLLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLrV(void (i64)* %0, i64 %1) {
%3 = alloca void (i64)*
%4 = alloca i64
store void (i64)* %0, void (i64)** %3
store i64 %1, i64* %4
%5 = load void (i64)*, void (i64)** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @testClosureLLrV(void (i64)* nocapture %0, i64 %1) {
tail call void %0(i64 %1)
ret void
}
int sgs_hexchar(char c) {
  return ((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') ||
         ((c) >= 'A' && (c) <= 'F');
}


x86 assembly (clang, -O0):
<sgs_hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <sgs_hexchar+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <sgs_hexchar+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <sgs_hexchar+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <sgs_hexchar+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <sgs_hexchar+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_hexchar>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sgs_hexchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @sgs_hexchar(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_03int16_reg(short val) {
  return ((val) & (0x03 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_03int16_reg(i16 signext %0) {
%2 = and i16 %0, 3
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ swap_gt(unsigned int *, unsigned int *);
void init_curve_key(unsigned dest[3], unsigned src[3]) {
  (void)memcpy(dest, src, sizeof(unsigned[3]));
  swap_gt(dest + 0, dest + 1);
  swap_gt(dest + 0, dest + 2);
  swap_gt(dest + 1, dest + 2);
}


x86 assembly (clang, -O0):
<init_curve_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xc,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
call   1030 <swap_gt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1030 <swap_gt@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1030 <swap_gt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_curve_key>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%edx
call   1040 <memcpy@plt>
lea    0x4(%rbx),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <swap_gt@plt>
lea    0x8(%rbx),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <swap_gt@plt>
mov    %r14,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <swap_gt@plt>

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

LLVM IR (-O2):
define void @init_curve_key(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 12)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @swap_gt(i32* %0, i32* %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = tail call i32 @swap_gt(i32* %0, i32* %6)
%8 = tail call i32 @swap_gt(i32* %4, i32* %6)
ret void
}
void raio_bs_null_set_last_in_batch(struct raio_bs *dev) {}


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

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

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

LLVM IR (-O2):
%struct.raio_bs = type opaque
define void @raio_bs_null_set_last_in_batch(%struct.raio_bs* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ printf(char *, size_t);
int main(int argc, char **argv) {
  size_t allocated = 0;
  while (1) {
    malloc(1024 * 1024);
    allocated += 1024 * 1024;
    printf("Allocated %zd bytes of ram in total\n", allocated);
  }
}


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)
movq   $0x0,-0x18(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    -0x18(%rbp),%rax
add    $0x100000,%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    113e <main+0x1e>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x100000,%ebx
lea    0xed0(%rip),%r14
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x100000,%rbx
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [37 x i8] c"Allocated %zd bytes of ram in total\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
br label %7
7: ; preds = %2, %7
%8 = call i32 @malloc(i32 1048576)
%9 = load i64, i64* %6
%10 = add i64 %9, 1048576
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %7
}

LLVM IR (-O2):
@.str = [37 x i8] c"Allocated %zd bytes of ram in total\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @malloc(i32 1048576)
%6 = add i64 %4, 1048576
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %3
}