xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ stricmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ wfile_ext(char *);
int wfile_is_zipfile(char *filename) {
  return (!stricmp(wfile_ext(filename), "zip"));
}


x86 assembly (clang, -O0):
<wfile_is_zipfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <wfile_ext@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1030 <stricmp@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):
<wfile_is_zipfile>:
push   %rax
call   1040 <wfile_ext@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
call   1030 <stricmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"zip\00"
define i32 @wfile_is_zipfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @wfile_ext(i8* %3)
%5 = call i32 @stricmp(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"zip\00"
define i32 @wfile_is_zipfile(i8* %0) {
%2 = tail call i32 @wfile_ext(i8* %0)
%3 = tail call i32 @stricmp(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int add(int, int);
int multiply(int a, int b) {
  int i;
  int ret = 0;
  for (i = 0; i < a; ++i)
    ret = add(ret, b);
  return ret;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <multiply+0x44>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <multiply+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1130 <multiply+0x20>
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
nopl   (%rax)
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <add@plt>
add    $0xffffffff,%ebp
jne    1120 <multiply+0x10>
jmp    1132 <multiply+0x22>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = tail call i32 @add(i32 %5, i32 %1)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %11
}
void videomod(unsigned short int ax) { return; }


x86 assembly (clang, -O0):
<videomod>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @videomod(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int pq_gen_base(int, int, void **);
int pq_gen(int vects, int len, void **array) {
  return pq_gen_base(vects, len, array);
}


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

x86 assembly (clang, -O2):
<pq_gen>:
jmp    1030 <pq_gen_base@plt>

LLVM IR (-O0):
define i32 @pq_gen(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i32 @pq_gen_base(i32 %7, i32 %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pq_gen(i32 %0, i32 %1, i8** %2) {
%4 = tail call i32 @pq_gen_base(i32 %0, i32 %1, i8** %2)
ret i32 %4
}
void I2CMasterIntEnableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) |= ulIntFlags;
}


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

x86 assembly (clang, -O2):
<I2CMasterIntEnableEx>:
or     %rsi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 16
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = add i64 %0, 16
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double a = 0.1;
  printf("%lf\n", a / 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 1.000000e-01, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.000000e+00
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x3FA1111111111111)
ret i32 0
}
int test_imm_BEint64_lowword_reg(long long val) {
  return ((val) & (0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 190
%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_BEint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 190
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef union vec3 {
  int dummy;
} vec3;

/* Variables and functions */
union vec3 *vec3_normalize(union vec3 *, union vec3 *);
union vec3 *vec3_normalize_self(union vec3 *vo) {
  return vec3_normalize(vo, vo);
}


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

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

LLVM IR (-O0):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_normalize_self(%union.vec3* %0) {
%2 = alloca %union.vec3*
store %union.vec3* %0, %union.vec3** %2
%3 = load %union.vec3*, %union.vec3** %2
%4 = load %union.vec3*, %union.vec3** %2
%5 = call %union.vec3* @vec3_normalize(%union.vec3* %3, %union.vec3* %4)
ret %union.vec3* %5
}

LLVM IR (-O2):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_normalize_self(%union.vec3* %0) {
%2 = tail call %union.vec3* @vec3_normalize(%union.vec3* %0, %union.vec3* %0)
ret %union.vec3* %2
}
int toupper(int c) {
  if (c >= 'a' && c <= 'z') {
    c += ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <toupper+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void network_ipv4_init() {}


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

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

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

LLVM IR (-O2):
define void @network_ipv4_init() {
ret void
}
int min(int x, int y) {
  if (x >= y) {
    return (y);
  }
  return (x);
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void badCharPreprocess() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(struct rescache *);
void *rescache_load(struct rescache *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
void *rescache_loads(struct rescache *cache, char const *key) {
  assert(cache);
  if (!key) {
    return NULL;
  }
  return rescache_load(cache, key, strlen(key) + 1);
}


x86 assembly (clang, -O0):
<rescache_loads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
jne    1161 <rescache_loads+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1192 <rescache_loads+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <rescache_load@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rescache_loads>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <assert@plt>
test   %rbx,%rbx
je     1162 <rescache_loads+0x32>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <rescache_load@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rescache = type { i32 }
define i8* @rescache_loads(%struct.rescache* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.rescache*
%5 = alloca i8*
store %struct.rescache* %0, %struct.rescache** %4
store i8* %1, i8** %5
%6 = load %struct.rescache*, %struct.rescache** %4
%7 = call i32 @assert(%struct.rescache* %6)
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i8* null, i8** %3
br label %18
11: ; preds = %2
%12 = load %struct.rescache*, %struct.rescache** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %5
%15 = call i64 @strlen(i8* %14)
%16 = add nsw i64 %15, 1
%17 = call i8* @rescache_load(%struct.rescache* %12, i8* %13, i64 %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %11, %10
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
%struct.rescache = type { i32 }
define i8* @rescache_loads(%struct.rescache* %0, i8* %1) {
%3 = tail call i32 @assert(%struct.rescache* %0)
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* %1)
%7 = add nsw i64 %6, 1
%8 = tail call i8* @rescache_load(%struct.rescache* %0, i8* %1, i64 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ null, %2 ]
ret i8* %10
}
int c015(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c015() {
ret i32 0
}
void logwtmp(const char *line, const char *name, const char *host) {}


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

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

LLVM IR (-O0):
define void @logwtmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @logwtmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int parent(int i) { return ((i + 1) / 2) - 1; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 2
%4 = add nsw i32 %3, -1
ret i32 %4
}
int mul(const int a, const int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
const char *picosat_copyright(void) {
  return "Copyright (c) 2006 - 2012 Armin Biere JKU Linz";
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Copyright (c) 2006 - 2012 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"Copyright (c) 2006 - 2012 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ vfork();
int f1() {
  vfork();
  return 0;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
call   1030 <vfork@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1() {
%1 = call i32 @vfork()
ret i32 0
}

LLVM IR (-O2):
define i32 @f1() {
%1 = call i32 @vfork()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void report_errno_with_data(char *file, int line) {
  fprintf(stderr, "%s, line %d: ", file, line);
  perror(NULL);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<report_errno_with_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<report_errno_with_data>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <perror@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"%s, line %d: \00"
@EXIT_FAILURE = global i32 0
define void @report_errno_with_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @perror(i32* null)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"%s, line %d: \00"
@EXIT_FAILURE = global i32 0
define void @report_errno_with_data(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @perror(i32* null)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
pid_t fork_or_die(void) {
  pid_t p = fork();
  if (p == -1) {
    perror("error calling fork()");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<fork_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1166 <fork_or_die+0x36>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_or_die>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     113f <fork_or_die+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"error calling fork()\00"
@EXIT_FAILURE = global i32 0
define i32 @fork_or_die() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"error calling fork()\00"
@EXIT_FAILURE = global i32 0
define i32 @fork_or_die() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %1
}
/* Variables and functions */
size_t strcount_utf8(const char *s) {
  size_t cnt = 0;
  while (*s) {
    unsigned char ch = *(unsigned char *)s++;
    if (ch <= 0xBF)
      cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strcount_utf8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <strcount_utf8+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0xbf,%eax
jg     114c <strcount_utf8+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strcount_utf8+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcount_utf8>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strcount_utf8+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    $0xc0,%cl
adc    $0x0,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strcount_utf8+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strcount_utf8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = icmp ult i8 %5, -64
%10 = zext i1 %9 to i64
%11 = add i64 %7, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
void EPIAddressMapSet(unsigned long ulBase, unsigned long ulMap) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulMap;
}


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

x86 assembly (clang, -O2):
<EPIAddressMapSet>:
mov    %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @EPIAddressMapSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIAddressMapSet(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int AMCStrCaseComp(const char *str1, const char *str2) {
  return strcasecmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<AMCStrCaseComp>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @AMCStrCaseComp(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 = call i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @AMCStrCaseComp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void get_file_name(char *name) {
  printf("Enter name of the file \n");
  scanf("%s", name);
}


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

x86 assembly (clang, -O2):
<get_file_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Enter name of the file \0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @get_file_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [24 x i8] c"Enter name of the file \00"
define void @get_file_name(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uart2_putc(uint32_t sbyte) {
  while (!((*((volatile uint32_t *)0xE2900810)) & 0x02))
    ;
  (*((volatile uint32_t *)0xE2900820)) = sbyte;
}


x86 assembly (clang, -O0):
<uart2_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe2900810,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1126 <uart2_putc+0x26>
jmp    112b <uart2_putc+0x2b>
jmp    1107 <uart2_putc+0x7>
mov    -0x4(%rbp),%ecx
mov    $0xe2900820,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart2_putc>:
mov    $0xe2900810,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x2,(%rax)
je     1110 <uart2_putc+0x10>
mov    %edi,0x10(%rax)
ret

LLVM IR (-O0):
define void @uart2_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i32, i32* inttoptr (i64 3801090064 to i32*)
%5 = and i32 %4, 2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 3801090080 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart2_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3801090064 to i32*)
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 3801090080 to i32*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTHwFlowControlEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000030))) |=
      (0x00008000 | 0x00004000);
}


x86 assembly (clang, -O0):
<UARTHwFlowControlEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
or     $0xc000,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTHwFlowControlEnable>:
orq    $0xc000,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTHwFlowControlEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 48
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 49152
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTHwFlowControlEnable(i64 %0) {
%2 = add nsw i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 49152
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ system(char *);
isKaffeine() {
  if (system("qdbus |fgrep org.kde.kaffeine") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isKaffeine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jne    113a <isKaffeine+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <isKaffeine+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"qdbus |fgrep org.kde.kaffeine\00"
define i32 @isKaffeine() {
%1 = alloca i32
%2 = call i64 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [30 x i8] c"qdbus |fgrep org.kde.kaffeine\00"
define i32 @isKaffeine() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void write4ToEco(unsigned char *p, unsigned int data) {
  p[0] = data >> 24;
  p[1] = data >> 16;
  p[2] = data >> 8;
  p[3] = data >> 0;
}


x86 assembly (clang, -O0):
<write4ToEco>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write4ToEco>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write4ToEco(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x1e() {
  Assert_real((isbdigit(30) == 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_isbdigit.c",
              155, ("isbdigit should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x9b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1e\00"
define void @t_isbdigit_0x1e() {
%1 = call i64 @isbdigit(i32 30)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 155, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x1e\00"
define void @t_isbdigit_0x1e() {
%1 = tail call i64 @isbdigit(i32 30)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 155, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ieee80211_debugfs_key_remove_mgmt_default(
    struct ieee80211_sub_if_data *sdata) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_key_remove_mgmt_default(%struct.ieee80211_sub_if_data* nocapture %0) {
ret void
}
int foo2(int a) { return a + 0x0f100e10; }


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

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

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

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
%2 = add nsw i32 %0, 252710416
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_rsch_continuous_mode_exit();
void nrf_802154_priority_drop_timeslot_exit(void) {
  nrf_802154_rsch_continuous_mode_exit();
}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_priority_drop_timeslot_exit() {
%1 = tail call i32 (...) @nrf_802154_rsch_continuous_mode_exit()
ret void
}
void foo(int n, void *p) {
  int(*a)[n] = (int(*)[n])p;
#pragma omp parallel shared(a) default(none)
#pragma omp master
  a[-1][-1] = 42;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   $0xffffffffffffffff,%rcx,%rcx
movl   $0x2a,-0x4(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
shl    $0x2,%rax
sub    %rax,%rsi
movl   $0x2a,-0x4(%rsi)
ret

LLVM IR (-O0):
define void @foo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = mul nsw i64 -1, %7
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = getelementptr inbounds i32, i32* %14, i64 -1
store i32 42, i32* %15
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i8* nocapture writeonly %1) {
%3 = zext i32 %0 to i64
%4 = bitcast i8* %1 to i32*
%5 = sub nsw i64 0, %3
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32 42, i32* %7
ret void
}
void __attribute__((used)) func(void) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @func to i8*)], section "llvm.metadata"
define void @func() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @func to i8*)], section "llvm.metadata"
define void @func() {
ret void
}
int NameConflictTest1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NameConflictTest1() {
ret i32 0
}
void WriteFlush(int u) { ; }


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

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

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

LLVM IR (-O2):
define void @WriteFlush(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panoScriptParserError(char *, char const *);
void yyerror(char const *st) { panoScriptParserError("%s\n", st); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @panoScriptParserError(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_spaces(char *p) {
  while (*p && isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_spaces+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_spaces+0x47>
jmp    1168 <skip_spaces+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_spaces+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_spaces+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_spaces(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
unsigned int unsignedint_ignoring_unsignedlonglong(unsigned int x,
                                                   unsigned long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i32 @unsignedint_ignoring_unsignedlonglong(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @unsignedint_ignoring_unsignedlonglong(i32 returned %0, i64 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ prints(char *);
usage() {
  prints("Usage: kill pid\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <prints@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <prints@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Usage: kill pid\0A\00"
define i32 @usage() {
%1 = call i32 @prints(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Usage: kill pid\0A\00"
define i32 @usage() {
%1 = tail call i32 @prints(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float expf(float);
float num_exp(float a) { return expf(a); }


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

x86 assembly (clang, -O2):
<num_exp>:
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @num_exp(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @num_exp(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
int interpolate(int first, int second, int i, int count) {
  int diff = (second - first) * 100;
  diff *= i;
  diff /= count;
  diff /= 100;
  return first + diff;
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
imul   $0x64,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
sub    %edi,%esi
imul   %edx,%esi
imul   $0x64,%esi,%eax
cltd
idiv   %ecx
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @interpolate(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %1, %0
%6 = mul nsw i32 %5, 100
%7 = mul nsw i32 %6, %2
%8 = sdiv i32 %7, %3
%9 = sdiv i32 %8, 100
%10 = add nsw i32 %9, %0
ret i32 %10
}