xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ set_hl(int);
void opcb_d6() { set_hl(2); }


x86 assembly (clang, -O0):
<opcb_d6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <set_hl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcb_d6>:
mov    $0x2,%edi
jmp    1030 <set_hl@plt>

LLVM IR (-O0):
define void @opcb_d6() {
%1 = call i32 @set_hl(i32 2)
ret void
}

LLVM IR (-O2):
define void @opcb_d6() {
%1 = tail call i32 @set_hl(i32 2)
ret void
}
long evenFibSum(int max) {
  int i = 1, j = 2;
  long sum = 0;
  while (j <= max) {
    if (j % 2 == 0)
      sum += j;
    j = j + i;
    i = j - i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<evenFibSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1160 <evenFibSum+0x60>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <evenFibSum+0x49>
movslq -0xc(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111d <evenFibSum+0x1d>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evenFibSum>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     113e <evenFibSum+0x3e>
mov    $0x1,%ecx
mov    $0x2,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edx,%esi
test   $0x1,%sil
mov    $0x0,%edx
cmove  %esi,%edx
movslq %edx,%rdx
add    %rdx,%rax
add    %esi,%ecx
mov    %ecx,%edx
cmp    %edi,%ecx
mov    %esi,%ecx
jle    1120 <evenFibSum+0x20>
ret

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

LLVM IR (-O2):
define i64 @evenFibSum(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 2, %1 ]
%6 = phi i32 [ %5, %3 ], [ 1, %1 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 %5, i32 0
%10 = sext i32 %9 to i64
%11 = add nsw i64 %4, %10
%12 = add nsw i32 %5, %6
%13 = icmp sgt i32 %12, %0
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %11, %3 ]
ret i64 %15
}
void heap_init(void) { __asm__("int $0x40" ::"a"(68), "b"(11)); }


x86 assembly (clang, -O0):
<heap_init>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x44,%eax
mov    $0xb,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_init>:
push   %rbx
mov    $0x44,%eax
mov    $0xb,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @heap_init() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 11)
ret void
}
/* Variables and functions */
int isdigit(int /*<<< orphan*/);
int has_numbers(const char *str) {
  while (*str != '\0') {
    if (isdigit(*str++) == 1)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <has_numbers+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x1,%eax
jne    1158 <has_numbers+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1164 <has_numbers+0x54>
jmp    111c <has_numbers+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_numbers>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1119 <has_numbers+0x19>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0x9,%eax
ja     1100 <has_numbers>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @has_numbers(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = add nsw i32 %7, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %12
}
void YUY2ToUV422Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUV422Row_Any_NEON() {
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v32_12_sse4() {
ret void
}
/* Variables and functions */
int rand();
void MD5_Salt(unsigned int len, char *output) {
  unsigned int i;
  for (i = 0; i < len; ++i)
    output[i] = (char)(1 + rand() % 255);
}


x86 assembly (clang, -O0):
<MD5_Salt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115c <MD5_Salt+0x4c>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <MD5_Salt+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD5_Salt>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1162 <MD5_Salt+0x52>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
add    %eax,%ecx
add    $0x1,%cl
mov    %cl,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <MD5_Salt+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @MD5_Salt(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = add i8 %10, 1
%12 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 %11, i8* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void timefunc(int value) {
  printf("FAIL: test26\n");
  exit(1);
}


x86 assembly (clang, -O0):
<timefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [14 x i8] c"FAIL: test26\0A\00"
define void @timefunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"FAIL: test26\00"
define void @timefunc(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *format(char *, char *, char const *);
char *append(char *s1, const char *s2) { return format("%s%s", s1, s2); }


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

x86 assembly (clang, -O2):
<append>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <format@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @append(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 i8* @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @append(i8* %0, i8* %1) {
%3 = tail call i8* @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xda() {
  Assert_real((isspace(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1095, ("isspace should be 0 for 0xda"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xda\00"
define void @t_isspace_0xda() {
%1 = tail call i64 @isspace(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long diffdays(long t1, long t0) { return (t1 - t0) / (24 * 60 * 60); }


x86 assembly (clang, -O0):
<diffdays>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    $0x15180,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffdays>:
mov    %rdi,%rax
sub    %rsi,%rax
movabs $0x1845c8a0ce512957,%rcx
c8 45 18
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xd,%rdx
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @diffdays(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = sdiv i64 %7, 86400
ret i64 %8
}

LLVM IR (-O2):
define i64 @diffdays(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = sdiv i64 %3, 86400
ret i64 %4
}
/* Variables and functions */
double EvalAngDist_alpha0_4plus_0plus_15097_L4(double);
double funcAngDist_alpha0_4plus_0plus_15097_L4(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha0_4plus_0plus_15097_L4(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha0_4plus_0plus_15097_L4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha0_4plus_0plus_15097_L4@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha0_4plus_0plus_15097_L4>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha0_4plus_0plus_15097_L4@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha0_4plus_0plus_15097_L4(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha0_4plus_0plus_15097_L4(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha0_4plus_0plus_15097_L4(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha0_4plus_0plus_15097_L4(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M222_f(char *s) {
  debug("M222_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M222_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M222_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M222_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M222_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M222_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M222_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadMolecule(int);
int indigoReadBuffer(char const *, int);
__attribute__((visibility("default"))) int
indigoLoadMoleculeFromBuffer(const char *buf, int size) {
  int source = indigoReadBuffer(buf, size);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadMolecule(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadMoleculeFromBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <indigoReadBuffer@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <indigoLoadMoleculeFromBuffer+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <indigoLoadMoleculeFromBuffer+0x4d>
mov    -0x18(%rbp),%edi
call   1030 <indigoLoadMolecule@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadMoleculeFromBuffer>:
push   %rbp
push   %rbx
push   %rax
call   1050 <indigoReadBuffer@plt>
test   %eax,%eax
jle    1152 <indigoLoadMoleculeFromBuffer+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <indigoLoadMolecule@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadMoleculeFromBuffer+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoLoadMoleculeFromBuffer(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @indigoReadBuffer(i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %6
%16 = call i32 @indigoLoadMolecule(i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @indigoFree(i32 %17)
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @indigoLoadMoleculeFromBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @indigoReadBuffer(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @indigoLoadMolecule(i32 %3)
%7 = tail call i32 @indigoFree(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int strcmp(char *, char *);
int isHello(char *s) { return strcmp(s, "Hello"); }


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

x86 assembly (clang, -O2):
<isHello>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @isHello(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char const *, int);
unsigned int ntohl(unsigned int);
unsigned int readInt32FromBuffer(const unsigned char *buffer,
                                 unsigned short *offset) {
  unsigned int value;
  memcpy(&value, buffer + *offset, sizeof(unsigned int));
  value = ntohl(value);
  *offset += sizeof(unsigned int);
  return value;
}


x86 assembly (clang, -O0):
<readInt32FromBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
cltq
add    %rax,%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
add    $0x4,%rcx
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt32FromBuffer>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movzwl (%rsi),%esi
add    %rdi,%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
addw   $0x4,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readInt32FromBuffer(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i32
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i8*, i8** %3
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = call i32 @memcpy(i32* %5, i8* %11, i32 4)
%13 = load i32, i32* %5
%14 = call i32 @ntohl(i32 %13)
store i32 %14, i32* %5
%15 = load i16*, i16** %4
%16 = load i16, i16* %15
%17 = zext i16 %16 to i64
%18 = add i64 %17, 4
%19 = trunc i64 %18 to i16
store i16 %19, i16* %15
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @readInt32FromBuffer(i8* %0, i16* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i16, i16* %1
%6 = zext i16 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = call i32 @memcpy(i32* %3, i8* %7, i32 4)
%9 = load i32, i32* %3
%10 = call i32 @ntohl(i32 %9)
%11 = load i16, i16* %1
%12 = add i16 %11, 4
store i16 %12, i16* %1
ret i32 %10
}
/* Variables and functions */
bool is_absolute(const char *path) { return path[0] == '/'; }


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

x86 assembly (clang, -O2):
<is_absolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_absolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_absolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dot_nodeid(int);
int /*<<< orphan*/ printf(char *);
void dot_add_undir_edge(int id, int id2) {
  dot_nodeid(id);
  printf(" -- ");
  dot_nodeid(id2);
  printf(";\n");
}


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

x86 assembly (clang, -O2):
<dot_add_undir_edge>:
push   %rbx
mov    %esi,%ebx
call   1050 <dot_nodeid@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <dot_nodeid@plt>
lea    0xeb3(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" -- \00"
@.str.1 = [3 x i8] c";\0A\00"
define void @dot_add_undir_edge(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 = call i32 @dot_nodeid(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @dot_nodeid(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" -- \00"
@str = [2 x i8] c";\00"
define void @dot_add_undir_edge(i32 %0, i32 %1) {
%3 = tail call i32 @dot_nodeid(i32 %0)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @dot_nodeid(i32 %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void XRootWindowOfScreen() {}


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

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

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

LLVM IR (-O2):
define void @XRootWindowOfScreen() {
ret void
}
void _Jv_JVMTI_Interface(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_JVMTI_Interface() {
ret void
}
/* Variables and functions */
double sin(double);
double sinc(double x) {
  if (x == 0.0) {
    return 1.0;
  }
  return sin(x) / x;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sinc+0x37>
jp     1147 <sinc+0x37>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115b <sinc+0x4b>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1127 <sinc+0x17>
jp     1127 <sinc+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sin(double %8)
%10 = load double, double* %3
%11 = fdiv double %9, %10
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call double @sin(double %0)
%5 = fdiv double %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 1.000000e+00, %1 ]
ret double %7
}
int isupper(int c) { return (((c) <= (0x5a)) && ((c) >= (0x41))); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <isupper+0x20>
cmpl   $0x41,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 90
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 65
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 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  long tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ normalize(struct timespec *);
struct timespec timeCreate(time_t s, long ns) {
  struct timespec r;
  r.tv_sec = s;
  r.tv_nsec = ns;
  normalize(&r);
  return r;
}


x86 assembly (clang, -O0):
<timeCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <normalize@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%edx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeCreate>:
sub    $0x18,%rsp
mov    %edi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <normalize@plt>
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%edx
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define { i64, i32 } @timeCreate(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i64, i64* %5
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @normalize(%struct.timespec* %3)
%11 = bitcast %struct.timespec* %3 to { i64, i32 }*
%12 = load { i64, i32 }, { i64, i32 }* %11
ret { i64, i32 } %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define { i64, i32 } @timeCreate(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i64 %1, i64* %5
%6 = call i32 @normalize(%struct.timespec* %3)
%7 = load i64, i64* %5
%8 = insertvalue { i64, i32 } poison, i64 %7, 0
%9 = load i32, i32* %4
%10 = insertvalue { i64, i32 } %8, i32 %9, 1
ret { i64, i32 } %10
}
int BPQSerialClrDSR(unsigned int hDevice) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BPQSerialClrDSR(i32 %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_die();
void *xmalloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(size))) {
    xalloc_die();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <xmalloc+0x2a>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @xalloc_die()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @xalloc_die()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *string_copy(char *);
void string_free4(char *s) {
  char *t;
  int i;
  for (i = 0; i < 3; i++) {
    t = string_copy(s);
    *t = 'a';
    free(t);
  }
  free(s);
}


x86 assembly (clang, -O0):
<string_free4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1168 <string_free4+0x48>
mov    -0x8(%rbp),%rdi
call   1040 <string_copy@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <string_free4+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_free4>:
push   %rbx
mov    %rdi,%rbx
call   1040 <string_copy@plt>
movb   $0x61,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1040 <string_copy@plt>
movb   $0x61,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1040 <string_copy@plt>
movb   $0x61,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @string_free4(i8* %0) {
%2 = tail call i8* @string_copy(i8* %0)
store i8 97, i8* %2
%3 = tail call i32 @free(i8* %2)
%4 = tail call i8* @string_copy(i8* %0)
store i8 97, i8* %4
%5 = tail call i32 @free(i8* %4)
%6 = tail call i8* @string_copy(i8* %0)
store i8 97, i8* %6
%7 = tail call i32 @free(i8* %6)
%8 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int shmget(int, int, int);
void shm_del() {
  int shmid = shmget(1234, 512, IPC_CREAT | 0644);
  if (shmctl(shmid, IPC_RMID, NULL) == -1) {
    printf("shm_del error!");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<shm_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    119a <shm_del+0x5a>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_del>:
push   %rax
mov    0x2e90(%rip),%rax
mov    $0x1a4,%edx
or     (%rax),%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1177 <shm_del+0x37>
pop    %rax
ret
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@.str = [15 x i8] c"shm_del error!\00"
define void @shm_del() {
%1 = alloca i32
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 420
%4 = call i32 @shmget(i32 1234, i32 512, i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* @IPC_RMID
%7 = call i32 @shmctl(i32 %5, i32 %6, i32* null)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %0
ret void
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@.str = [15 x i8] c"shm_del error!\00"
define void @shm_del() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 420
%3 = tail call i32 @shmget(i32 1234, i32 512, i32 %2)
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @shmctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %0
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int strlonger(char *s, char *t) { return strlen(s) > strlen(t); }


x86 assembly (clang, -O0):
<strlonger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlonger>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strlonger(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 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = icmp sgt i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @strlonger(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int a, b, c = 1;
  printf("%d %d %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef, i32 1)
ret i32 0
}
/* Variables and functions */
int AT91F_LoadBoot();
scalar_t__ AT91F_ResetRegisters();
int /*<<< orphan*/ Jump(int);
int /*<<< orphan*/ printf(char *);
int AT91F_StartBoot(void) {
  int sts;
  if ((sts = AT91F_LoadBoot()) != -1)
    return sts;
  if (AT91F_ResetRegisters()) {
    printf("Jump");
    Jump(0x21F00000);
  }
  return 3;
}


x86 assembly (clang, -O0):
<AT91F_StartBoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <AT91F_LoadBoot@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1166 <AT91F_StartBoot+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <AT91F_StartBoot+0x54>
mov    $0x0,%al
call   1030 <AT91F_ResetRegisters@plt>
cmp    $0x0,%rax
je     118d <AT91F_StartBoot+0x4d>
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
mov    $0x21f00000,%edi
call   1060 <Jump@plt>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT91F_StartBoot>:
push   %rbx
xor    %eax,%eax
call   1040 <AT91F_LoadBoot@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1176 <AT91F_StartBoot+0x36>
xor    %eax,%eax
call   1030 <AT91F_ResetRegisters@plt>
mov    $0x3,%ebx
test   %rax,%rax
je     1176 <AT91F_StartBoot+0x36>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    $0x21f00000,%edi
call   1060 <Jump@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Jump\00"
define i32 @AT91F_StartBoot() {
%1 = tail call i32 (...) @AT91F_LoadBoot()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i64 (...) @AT91F_ResetRegisters()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @Jump(i32 569376768)
br label %9
9: ; preds = %3, %6, %0
%10 = phi i32 [ %1, %0 ], [ 3, %6 ], [ 3, %3 ]
ret i32 %10
}
int __isalnum_ascii(int ch) {
  return (unsigned int)((ch | 0x20) - 'a') < 26u ||
         (unsigned int)(ch - '0') < 10u;
}


x86 assembly (clang, -O0):
<__isalnum_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x20,%ecx
sub    $0x61,%ecx
mov    $0x1,%al
cmp    $0x1a,%ecx
mov    %al,-0x5(%rbp)
jb     112d <__isalnum_ascii+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isalnum_ascii>:
mov    %edi,%eax
or     $0x20,%eax
add    $0xffffff9f,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__isalnum_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 32
%5 = sub nsw i32 %4, 97
%6 = icmp ult i32 %5, 26
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 48
%10 = icmp ult i32 %9, 10
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @__isalnum_ascii(i32 %0) {
%2 = or i32 %0, 32
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = add nsw i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(char const *program_name) {
  fprintf(stderr, "%s: executable\n", program_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s: executable\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ FALSE;
int /*<<< orphan*/ endwin();
scalar_t__ isendwin();
int /*<<< orphan*/ *stdscr;
void restore_terminal(void) {
  if (stdscr != NULL && isendwin() == FALSE) {
    endwin();
  }
}


x86 assembly (clang, -O0):
<restore_terminal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <restore_terminal+0x33>
mov    $0x0,%al
call   1040 <isendwin@plt>
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
jne    1153 <restore_terminal+0x33>
mov    $0x0,%al
call   1030 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_terminal>:
push   %rax
mov    0x2ec0(%rip),%rax
cmpq   $0x0,(%rax)
je     1149 <restore_terminal+0x29>
xor    %eax,%eax
call   1040 <isendwin@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
jne    1149 <restore_terminal+0x29>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdscr = global i32* null
@FALSE = global i64 0
define void @restore_terminal() {
%1 = load i32*, i32** @stdscr
%2 = icmp ne i32* %1, null
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 (...) @isendwin()
%5 = load i64, i64* @FALSE
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @endwin()
br label %9
9: ; preds = %7, %3, %0
ret void
}

LLVM IR (-O2):
@stdscr = global i32* null
@FALSE = global i64 0
define void @restore_terminal() {
%1 = load i32*, i32** @stdscr
%2 = icmp eq i32* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i64 (...) @isendwin()
%5 = load i64, i64* @FALSE
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @endwin()
br label %9
9: ; preds = %7, %3, %0
ret void
}
/* Variables and functions */
unsigned int dictGenHashFunction(void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void const *);
unsigned int dictEncObjHash(const void *key) {
  return dictGenHashFunction(key, strlen(key));
}


x86 assembly (clang, -O0):
<dictEncObjHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <dictGenHashFunction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictEncObjHash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <dictGenHashFunction@plt>

LLVM IR (-O0):
define i32 @dictEncObjHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @dictGenHashFunction(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @dictEncObjHash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @dictGenHashFunction(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 10)
ret i32 0
}