xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t size, size_t nelem) {
  void *rv = malloc(size * nelem);
  if (rv)
    memset(rv, 0, size * nelem);
  return rv;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = call i32 @memset(i8* %13, i32 0, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
char test15(void) { return '\r'; }


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15>:
mov    $0xd,%al
ret

LLVM IR (-O0):
define signext i8 @test15() {
ret i8 13
}

LLVM IR (-O2):
define signext i8 @test15() {
ret i8 13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_vector(float *v, int nl, int nh) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vector(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = getelementptr inbounds float, float* %10, i64 -1
%12 = bitcast float* %11 to i8*
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
define void @free_vector(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = getelementptr inbounds float, float* %5, i64 -1
%7 = bitcast float* %6 to i8*
%8 = tail call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
int ishex(char c) {
  return isdigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F');
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1185 <ishex+0x75>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     115c <ishex+0x4c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    1185 <ishex+0x75>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     117f <ishex+0x6f>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%bl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
float bmi_imperial(float m, float h) {
  float bmi;
  bmi = (m / (h * h)) * 703.0f;
  return bmi;
}


x86 assembly (clang, -O0):
<bmi_imperial>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xed7(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmi_imperial>:
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
mulss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @bmi_imperial(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fdiv float %6, %9
%11 = fmul float %10, 7.030000e+02
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @bmi_imperial(float %0, float %1) {
%3 = fmul float %1, %1
%4 = fdiv float %0, %3
%5 = fmul float %4, 7.030000e+02
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
char *getString();
scalar_t__ strlen(char *);
int /*<<< orphan*/ traiteLigne(char *, int);
void IF_ExecCS(void) {
  char *f;
  f = getString();
  if (f != NULL) {
    if (strlen(f) > 0)
      traiteLigne(f, 2);
    free((void *)f);
  }
}


x86 assembly (clang, -O0):
<IF_ExecCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1188 <IF_ExecCS+0x48>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
jle    117f <IF_ExecCS+0x3f>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1060 <traiteLigne@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_ExecCS>:
push   %rbx
xor    %eax,%eax
call   1030 <getString@plt>
test   %rax,%rax
je     1173 <IF_ExecCS+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    116a <IF_ExecCS+0x2a>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <traiteLigne@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @IF_ExecCS() {
%1 = alloca i8*
%2 = call i8* (...) @getString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strlen(i8* %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %1
%11 = call i32 @traiteLigne(i8* %10, i32 2)
br label %12
12: ; preds = %9, %5
%13 = load i8*, i8** %1
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
define void @IF_ExecCS() {
%1 = tail call i8* (...) @getString()
%2 = icmp eq i8* %1, null
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 @strlen(i8* %1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @traiteLigne(i8* %1, i32 2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @free(i8* %1)
br label %10
10: ; preds = %8, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help(void) { printf(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @show_help() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 'q':
  case 'Q':
    exit(0);
    break;
  case 'a':
    break;
  case 'b':
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xffffffaf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x20,%eax
ja     115f <keyboard+0x4f>
mov    -0x18(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1164 <keyboard+0x54>
jmp    1164 <keyboard+0x54>
jmp    1164 <keyboard+0x54>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
or     $0x20,%dil
cmp    $0x71,%dil
je     111b <keyboard+0xb>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %13 [
i32 113, label %9
i32 81, label %9
i32 97, label %11
i32 98, label %12
]
9: ; preds = %3, %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %14
12: ; preds = %3
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %12, %11
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %6 [
i8 113, label %4
i8 81, label %4
]
4: ; preds = %3, %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *trim_left(char *source) {
  char *current = source;
  while (isspace(*current)) {
    current++;
  }
  return current;
}


x86 assembly (clang, -O0):
<trim_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114b <trim_left+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <trim_left+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_left>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <trim_left+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim_left(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int __attribute__((weak)) pthread_rwlock_unlock(pthread_rwlock_t *rwlock) {
  (void)rwlock;
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i32 @pthread_rwlock_unlock(i32* %0) {
ret i32 0
}
char *string_copy(char *destination, const char *source) {
  int esi, edi, eax;
  asm volatile("cld\n"
               "1:  lodsb\n"
               "stosb\n"
               "testb %%al, %%al\n"
               "jne 1b\n"
               : "=&S"(esi), "=&D"(edi), "=&a"(eax)
               : "0"(source), "1"(destination)
               : "memory");
  return destination;
}


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1115 <string_copy+0x15>
mov    %esi,%ecx
mov    %ecx,-0x14(%rbp)
mov    %edi,%ecx
mov    %ecx,-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
mov    %rdi,%rcx
cld
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1104 <string_copy+0x4>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @string_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call { i8*, i8*, i32 } asm sideeffect "cld\0A1: lodsb\0Astosb\0Atestb %al, %al\0Ajne 1b\0A", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i8*, i8*, i32 } %10, 0
%12 = extractvalue { i8*, i8*, i32 } %10, 1
%13 = extractvalue { i8*, i8*, i32 } %10, 2
%14 = ptrtoint i8* %11 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %12 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
store i32 %13, i32* %7
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @string_copy(i8* returned %0, i8* %1) {
%3 = tail call { i8*, i8*, i32 } asm sideeffect "cld\0A1: lodsb\0Astosb\0Atestb %al, %al\0Ajne 1b\0A", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
/* Variables and functions */
scalar_t__ isDivisible(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int i = 0;
  for (;;) {
    if (isDivisible(++i)) {
      printf("%d\n", i);
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x14(%rbp)
call   1030 <isDivisible@plt>
cmp    $0x0,%rax
je     116c <main+0x4c>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <isDivisible@plt>
test   %rax,%rax
je     1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i64 @isDivisible(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned xrop3_195_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ S;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_195_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_195_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
not    %ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_195_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = xor i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = and i32 %26, %27
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = or i32 %28, %32
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = and i32 %37, %38
%40 = or i32 %33, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_195_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ removePrefixFromString(char **, char const *);
void removePrefixFromStrings(char **strings, const unsigned numStrings,
                             const char *prefix) {
  for (unsigned i = 0; i < numStrings; i++) {
    removePrefixFromString(&(strings[i]), prefix);
  }
}


x86 assembly (clang, -O0):
<removePrefixFromStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115b <removePrefixFromStrings+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <removePrefixFromString@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <removePrefixFromStrings+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removePrefixFromStrings>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1145 <removePrefixFromStrings+0x35>
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %esi,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <removePrefixFromString@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <removePrefixFromStrings+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @removePrefixFromStrings(i8** %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = tail call i32 @removePrefixFromString(i8** %10, i8* %2)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}
any(ch, str) char *str;
{
  register char *f;
  register c;
  f = str;
  c = ch;
  while (*f)
    if (c == *f++)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <any+0x54>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    114f <any+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    115b <any+0x5b>
jmp    1119 <any+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movsbl (%rsi),%eax
test   %eax,%eax
je     1115 <any+0x15>
add    $0x1,%rsi
cmp    %edi,%eax
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ t(int);
main() {
  t(1);
  t(2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <t@plt>
mov    $0x2,%edi
call   1030 <t@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @t(i32 1)
%2 = call i32 @t(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @t(i32 1)
%2 = tail call i32 @t(i32 2)
ret i32 0
}
double squared(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<squared>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @squared(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @squared(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ DIST_POINT;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ DIST_POINT_it;
DIST_POINT *d2i_DIST_POINT(DIST_POINT **a, const unsigned char **in, long len) {
  return (DIST_POINT *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DIST_POINT_it);
}


x86 assembly (clang, -O0):
<d2i_DIST_POINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_DIST_POINT>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@DIST_POINT_it = global i32 0
define i32* @d2i_DIST_POINT(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @DIST_POINT_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@DIST_POINT_it = global i32 0
define i32* @d2i_DIST_POINT(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @DIST_POINT_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int agrv, char *argc[]) {
  int i = 0;
  while (1) {
    printf("%d\n", i++);
    sleep(5);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xed4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %ebp,%esi
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = tail call i32 @sleep(i32 5)
br label %3
}
float *vector(nl, nh)
long nh, nl;
{
  float *v;
  v = (float *)malloc((unsigned int)((nh - nl + 1 + 1) * sizeof(float)));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x1,%rax
add    $0x1,%rax
shl    $0x2,%rax
mov    %eax,%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbx
mov    %rdi,%rbx
sub    %ebx,%esi
lea    0x8(,%rsi,4),%edi
call   1030 <malloc@plt>
shl    $0x2,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x4,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias float* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = and i64 %5, 4294967292
%7 = tail call i8* @malloc(i64 %6)
%8 = bitcast i8* %7 to float*
%9 = sub i64 0, %0
%10 = getelementptr inbounds float, float* %8, i64 %9
%11 = getelementptr inbounds float, float* %10, i64 1
ret float* %11
}
void *Pop(struct Stack *stack) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define i8* @Pop(%struct.Stack* %0) {
%2 = alloca i8*
%3 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %3
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
%struct.Stack = type opaque
define noalias i8* @Pop(%struct.Stack* nocapture readnone %0) {
ret i8* undef
}
void rb_thread_stop_timer_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @rb_thread_stop_timer_thread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ dlerror();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void my_dlerror(const char *message) {
  char *error = (char *)dlerror();
  if (error != NULL) {
    fprintf(stderr, "%s: %s\n", message, error);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<my_dlerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117d <my_dlerror+0x4d>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_dlerror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
test   %rax,%rax
jne    1142 <my_dlerror+0x12>
pop    %rbx
ret
mov    0x2e97(%rip),%rcx
mov    (%rcx),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @my_dlerror(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 (...) @dlerror()
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @my_dlerror(i8* %0) {
%2 = tail call i64 (...) @dlerror()
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
bool ishex(char c) {
  if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
      (c >= 'a' && c <= 'f'))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <ishex+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <ishex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <ishex+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jle    1158 <ishex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1164 <ishex+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1164 <ishex+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ishex+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
long long or_ll(long long *, long long *);
long long intr_wrap_550(long long p1, long long p2) { return or_ll(&p1, &p2); }


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

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

LLVM IR (-O0):
define i64 @intr_wrap_550(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @or_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_550(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @or_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ zsim_magic_op(int);
void zsim_heartbeat() { zsim_magic_op((1028)); }


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

x86 assembly (clang, -O2):
<zsim_heartbeat>:
mov    $0x404,%edi
jmp    1030 <zsim_magic_op@plt>

LLVM IR (-O0):
define void @zsim_heartbeat() {
%1 = call i32 @zsim_magic_op(i32 1028)
ret void
}

LLVM IR (-O2):
define void @zsim_heartbeat() {
%1 = tail call i32 @zsim_magic_op(i32 1028)
ret void
}
/* Variables and functions */
scalar_t__ _eml_parse822_is_htab(char);
scalar_t__ _eml_parse822_is_space(char);
int _eml_parse822_is_lwsp_char(char c) {
  return _eml_parse822_is_space(c) || _eml_parse822_is_htab(c);
}


x86 assembly (clang, -O0):
<_eml_parse822_is_lwsp_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_eml_parse822_is_space@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <_eml_parse822_is_lwsp_char+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <_eml_parse822_is_htab@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_parse822_is_lwsp_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <_eml_parse822_is_space@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <_eml_parse822_is_lwsp_char+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <_eml_parse822_is_htab@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_eml_parse822_is_lwsp_char(i8 signext %0) {
%2 = tail call i64 @_eml_parse822_is_space(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @_eml_parse822_is_htab(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void XrmPutResource() {}


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

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

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

LLVM IR (-O2):
define void @XrmPutResource() {
ret void
}
/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ EAFNOSUPPORT;
int /*<<< orphan*/ errno;
char const *inet_ntop_v4(void const *, char *, size_t);
const char *inet_ntop(int af, const void *src, char *dst, size_t size) {
  switch (af) {
  case AF_INET:
    return inet_ntop_v4(src, dst, size);
  default:
    errno = EAFNOSUPPORT;
    return NULL;
  }
}


x86 assembly (clang, -O0):
<inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1154 <inet_ntop+0x44>
jmp    113a <inet_ntop+0x2a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <inet_ntop_v4@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <inet_ntop+0x5e>
mov    0x2e7d(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7c(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntop>:
cmp    $0x80,%edi
jne    1126 <inet_ntop+0x16>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <inet_ntop_v4@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%10 = load i32, i32* %6
switch i32 %10, label %16 [
i32 128, label %11
]
11: ; preds = %4
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = call i8* @inet_ntop_v4(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %5
br label %18
16: ; preds = %4
%17 = load i32, i32* @EAFNOSUPPORT
store i32 %17, i32* @errno
store i8* null, i8** %5
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = icmp eq i32 %0, 128
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i8* @inet_ntop_v4(i8* %1, i8* %2, i64 %3)
br label %10
8: ; preds = %4
%9 = load i32, i32* @EAFNOSUPPORT
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ null, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void child_died(int n) { wait(NULL); }


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

x86 assembly (clang, -O2):
<child_died>:
xor    %edi,%edi
jmp    1030 <wait@plt>

LLVM IR (-O0):
define void @child_died(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
define void @child_died(i32 %0) {
%2 = tail call i32 @wait(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int unlink(char *path) {
  errno = EIO;
  return (-1);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EIO
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i32 @unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @EIO
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int sem_post(int /*<<< orphan*/ *);
int /*<<< orphan*/ terminal_error(char *);
void post_sem(sem_t *s) {
retry:
  if ((sem_post(s)) == -1) {
    if (errno == EINTR)
      goto retry;
    terminal_error("sem_post");
  }
}


x86 assembly (clang, -O0):
<post_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sem_post@plt>
cmp    $0xffffffff,%eax
jne    1169 <post_sem+0x49>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <post_sem+0x3d>
jmp    112c <post_sem+0xc>
lea    0xe9c(%rip),%rdi
call   1040 <terminal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_sem>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r14
mov    0x2ea2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <sem_post@plt>
cmp    $0xffffffff,%eax
jne    1166 <post_sem+0x46>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1140 <post_sem+0x20>
lea    0xea4(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <terminal_error@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
@.str = [9 x i8] c"sem_post\00"
define void @post_sem(i32* %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @sem_post(i32* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = tail call i32 @terminal_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %2, %9
ret void
}
void mutex_unlock(struct mutex *lock) { (void)lock; }


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

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

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

LLVM IR (-O2):
%struct.mutex = type opaque
define void @mutex_unlock(%struct.mutex* nocapture %0) {
ret void
}