xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void die_if_with_errno(int error, const char *msg, int errnum) {
  if (error) {
    fprintf(stderr, "%s: %s\n", msg, strerror(errnum));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<die_if_with_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     118c <die_if_with_errno+0x5c>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_if_with_errno>:
test   %edi,%edi
jne    1135 <die_if_with_errno+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
mov    %edx,%edi
call   1050 <strerror@plt>
lea    0xeae(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <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 @die_if_with_errno(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %3
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 @die_if_with_errno(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i8* @strerror(i32 %2)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
double median_weight_double(int, double *, double *);
double median_weight(int n, double *data, double *err) {
  return median_weight_double(n, data, err);
}


x86 assembly (clang, -O0):
<median_weight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <median_weight_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_weight>:
jmp    1030 <median_weight_double@plt>

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

LLVM IR (-O2):
define double @median_weight(i32 %0, double* %1, double* %2) {
%4 = tail call double @median_weight_double(i32 %0, double* %1, double* %2)
ret double %4
}
void irq_disable(void) { asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @irq_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
char *mprStrLower(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char src[] = "Streaming/channels/102/preview";
  char *dst;
  dst = mprStrLower(src);
  printf("src = %s\n", src);
  printf("dst = %s\n", dst);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x12(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <mprStrLower@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <mprStrLower@plt>
mov    %rax,%rbx
lea    0xecc(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.src = [31 x i8] c"Streaming/channels/102/preview\00"
@.str = [10 x i8] c"src = %s\0A\00"
@.str.1 = [10 x i8] c"dst = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [31 x i8]* %2 to i8*
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%6 = call i8* @mprStrLower(i8* %5)
store i8* %6, i8** %3
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [31 x i8] c"Streaming/channels/102/preview\00"
@.str = [10 x i8] c"src = %s\0A\00"
@.str.1 = [10 x i8] c"dst = %s\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i8* @mprStrLower(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
__attribute__((visibility("hidden"))) void
write_array(uint16_t address, uint8_t *data, uint32_t lenght) {}


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

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

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

LLVM IR (-O2):
define hidden void @write_array(i32 %0, i32* nocapture %1, i32 %2) {
ret void
}
unsigned int bitset_add(unsigned int set, unsigned int element) {
  if (element > 15)
    return set;
  return set | (1U << element);
}


x86 assembly (clang, -O0):
<bitset_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jbe    111f <bitset_add+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <bitset_add+0x33>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitset_add>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x10,%esi
cmovb  %edx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bitset_add(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 15
%4 = shl nuw i32 1, %1
%5 = select i1 %3, i32 0, i32 %4
%6 = or i32 %5, %0
ret i32 %6
}
void tb_(signed char *const ba, int *const nb, signed char *const b) {

  int j;
  *b = 0;
  for (j = 0; j < *nb; j++)
    *b = *b + ba[j];
}


x86 assembly (clang, -O0):
<tb_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <tb_+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <tb_+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tb_>:
movb   $0x0,(%rdx)
cmpl   $0x0,(%rsi)
jle    1123 <tb_+0x23>
xor    %r8d,%r8d
xor    %ecx,%ecx
nopl   (%rax)
add    (%rdi,%rcx,1),%r8b
mov    %r8b,(%rdx)
add    $0x1,%rcx
movslq (%rsi),%rax
cmp    %rax,%rcx
jl     1110 <tb_+0x10>
ret

LLVM IR (-O0):
define void @tb_(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
%8 = load i8*, i8** %6
store i8 0, i8* %8
store i32 0, i32* %7
br label %9
9: ; preds = %27, %3
%10 = load i32, i32* %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %30
14: ; preds = %9
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %17, %23
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %6
store i8 %25, i8* %26
br label %27
27: ; preds = %14
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %9
30: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @tb_(i8* nocapture %0, i32* nocapture %1, i8* nocapture %2) {
store i8 0, i8* %2
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ 0, %3 ]
%8 = phi i64 [ %12, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = add i8 %10, %7
store i8 %11, i8* %2
%12 = add nuw nsw i64 %8, 1
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(scalar_t__);
void SSIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(_SSIBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<SSIIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    %r14,0x20(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SSIIntClear(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 = call i32 @_SSIBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 32
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @SSIIntClear(i64 %0, i64 %1) {
%3 = tail call i32 @_SSIBaseValid(i64 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i64 %0, 32
%6 = inttoptr i64 %5 to i64*
store volatile i64 %1, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int x = 5, a, b, n;
  scanf("%d", &n);
  a = x >> n;
  b = x & 0x0001;
  b = b << (16 - n);
  printf("%d", a | b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
or     -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%cl
mov    $0x5,%esi
shr    %cl,%esi
mov    $0x10,%al
sub    %cl,%al
bts    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 5, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = and i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 16, %12
%14 = shl i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = or i32 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = lshr i32 5, %4
%6 = sub nsw i32 16, %4
%7 = shl nuw i32 1, %6
%8 = or i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int c) { return (isalpha(c) || isdigit(c)) ? 1 : 0; }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %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 i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %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
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *MCP_HAL_STRING_Strstr(const char *Str1, const char *Str2) {
  return strstr(Str1, Str2);
}


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

x86 assembly (clang, -O2):
<MCP_HAL_STRING_Strstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @MCP_HAL_STRING_Strstr(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* @strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @MCP_HAL_STRING_Strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
double rmax(double a, double b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<rmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <rmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <rmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @rmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ safePrefWrite(int, char *);
int cbDSlines(int *data, int argc, char **argv, char **azColName) {
  int i;
  for (i = 0; i < argc; i++) {
    safePrefWrite(data[0], argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cbDSlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <cbDSlines+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <safePrefWrite@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <cbDSlines+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbDSlines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <cbDSlines+0x35>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    (%r14,%rbx,8),%rsi
call   1030 <safePrefWrite@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <cbDSlines+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @cbDSlines(i32* nocapture %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = load i32, i32* %0
%11 = getelementptr inbounds i8*, i8** %2, i64 %9
%12 = load i8*, i8** %11
%13 = tail call i32 @safePrefWrite(i32 %10, i8* %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? (c + ('A' - 'a')) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xf5() {
  Assert_real((isalpha(245) == 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_isalpha.c",
              1230, ("isalpha should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf5\00"
define void @t_isalpha_0xf5() {
%1 = call i64 @isalpha(i32 245)
%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 1230, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf5\00"
define void @t_isalpha_0xf5() {
%1 = tail call i64 @isalpha(i32 245)
%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 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ setpriority(int, int, int);
void setval(int sys, int val) {
  if (setpriority(1764, sys, val)) {
    perror("");
  }
}


x86 assembly (clang, -O0):
<setval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x6e4,%edi
call   1030 <setpriority@plt>
cmp    $0x0,%rax
je     1154 <setval+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
mov    $0x6e4,%edi
call   1030 <setpriority@plt>
test   %rax,%rax
jne    1136 <setval+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @setval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @setpriority(i32 1764, i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @setval(i32 %0, i32 %1) {
%3 = tail call i64 @setpriority(i32 1764, i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ printf(char *, int, char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int ret = 0;
  while (1) {
    puts("hello world: %d %%f %s %c\n");
    ret += printf("hello world: %d %%f %s %c\n", ret, "string", (int)'x');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    $0x78,%ecx
call   1040 <printf@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
lea    0xed3(%rip),%rbx
lea    0xee7(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    $0x78,%ecx
call   1040 <printf@plt>
add    %ebp,%eax
mov    %eax,%ebp
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [27 x i8] c"hello world: %d %%f %s %c\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 120)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
br label %1
}
int RGBclamp(int x) {
  if (x < 0)
    return 0;
  if (x > 255)
    return 255;
  return x;
}


x86 assembly (clang, -O0):
<RGBclamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <RGBclamp+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <RGBclamp+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <RGBclamp+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <RGBclamp+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGBclamp>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @RGBclamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
int msm_dts_eagle_pcm_new(struct snd_soc_pcm_runtime *runtime) {
  pr_debug("%s\n", __func__);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_soc_pcm_runtime = type opaque
@.str = [4 x i8] c"%s\0A\00"
@__func__.msm_dts_eagle_pcm_new = [22 x i8] c"msm_dts_eagle_pcm_new\00"
define i32 @msm_dts_eagle_pcm_new(%struct.snd_soc_pcm_runtime* %0) {
%2 = alloca %struct.snd_soc_pcm_runtime*
store %struct.snd_soc_pcm_runtime* %0, %struct.snd_soc_pcm_runtime** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_debug to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.msm_dts_eagle_pcm_new, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.snd_soc_pcm_runtime = type opaque
@.str = [4 x i8] c"%s\0A\00"
@__func__.msm_dts_eagle_pcm_new = [22 x i8] c"msm_dts_eagle_pcm_new\00"
define i32 @msm_dts_eagle_pcm_new(%struct.snd_soc_pcm_runtime* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_debug to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.msm_dts_eagle_pcm_new, i64 0, i64 0))
ret i32 0
}
int dev_close_default(struct device_d *dev, struct filep *f) { return 0; }


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

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

LLVM IR (-O0):
%struct.device_d = type opaque
%struct.filep = type opaque
define i32 @dev_close_default(%struct.device_d* %0, %struct.filep* %1) {
%3 = alloca %struct.device_d*
%4 = alloca %struct.filep*
store %struct.device_d* %0, %struct.device_d** %3
store %struct.filep* %1, %struct.filep** %4
ret i32 0
}

LLVM IR (-O2):
%struct.device_d = type opaque
%struct.filep = type opaque
define i32 @dev_close_default(%struct.device_d* nocapture readnone %0, %struct.filep* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Put_buf_len(char const *, int /*<<< orphan*/, char **, int *,
                               int *);
int /*<<< orphan*/ safestrlen(char const *);
void Put_buf_str(const char *s, char **buf, int *max, int *len) {
  if (s && *s)
    Put_buf_len(s, safestrlen(s), buf, max, len);
}


x86 assembly (clang, -O0):
<Put_buf_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117b <Put_buf_str+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117b <Put_buf_str+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <safestrlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1040 <Put_buf_len@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Put_buf_str>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1164 <Put_buf_str+0x44>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1164 <Put_buf_str+0x44>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rbx,%rdi
call   1030 <safestrlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <Put_buf_len@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @Put_buf_str(i8* %0, i8** %1, i32* %2, i32* %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 @safestrlen(i8* %0)
%11 = tail call i32 @Put_buf_len(i8* %0, i32 %10, i8** %1, i32* %2, i32* %3)
br label %12
12: ; preds = %9, %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void Fatal_InternalInconsistency(const char *p_message) {
  fprintf(stderr, "*** INTERNAL INCONSISTENCY (%s) ***\n", p_message);
  exit(1);
}


x86 assembly (clang, -O0):
<Fatal_InternalInconsistency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Fatal_InternalInconsistency>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"*** INTERNAL INCONSISTENCY (%s) ***\0A\00"
define void @Fatal_InternalInconsistency(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 ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"*** INTERNAL INCONSISTENCY (%s) ***\0A\00"
define void @Fatal_InternalInconsistency(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int jmm_test_cell_g(unsigned int);
int /*<<< orphan*/ jmm_test_cell_s(unsigned int);
int jmm_test_cell(unsigned int ptr) {
  extern void tty_blink_ctl(int enable);
  tty_blink_ctl(0);
  jmm_test_cell_s(ptr);
  tty_blink_ctl(1);
  return jmm_test_cell_g(ptr) == 0x12345678;
}


x86 assembly (clang, -O0):
<jmm_test_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <tty_blink_ctl@plt>
mov    -0x4(%rbp),%edi
call   1050 <jmm_test_cell_s@plt>
mov    $0x1,%edi
call   1030 <tty_blink_ctl@plt>
mov    -0x4(%rbp),%edi
call   1040 <jmm_test_cell_g@plt>
cmp    $0x12345678,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmm_test_cell>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <tty_blink_ctl@plt>
mov    %ebx,%edi
call   1050 <jmm_test_cell_s@plt>
mov    $0x1,%edi
call   1030 <tty_blink_ctl@plt>
mov    %ebx,%edi
call   1040 <jmm_test_cell_g@plt>
xor    %ecx,%ecx
cmp    $0x12345678,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @jmm_test_cell(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @jmm_test_cell_s(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @jmm_test_cell_g(i32 %5)
%7 = icmp eq i32 %6, 305419896
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @jmm_test_cell(i32 %0) {
tail call void @tty_blink_ctl(i32 0)
%2 = tail call i32 @jmm_test_cell_s(i32 %0)
tail call void @tty_blink_ctl(i32 1)
%3 = tail call i32 @jmm_test_cell_g(i32 %0)
%4 = icmp eq i32 %3, 305419896
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_EAint8_reg(signed char val) {
  return ((val) & (-0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff16,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EAint8_reg>:
test   $0xffffff16,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EAint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -234
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
unsigned short app_usb_file_report(char *, unsigned short);
unsigned short HMItextReport(char *filename, unsigned short index) {
  return app_usb_file_report(filename, index);
}


x86 assembly (clang, -O0):
<HMItextReport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <app_usb_file_report@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMItextReport>:
jmp    1030 <app_usb_file_report@plt>

LLVM IR (-O0):
define zeroext i16 @HMItextReport(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = call zeroext i16 @app_usb_file_report(i8* %5, i16 zeroext %6)
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @HMItextReport(i8* %0, i16 zeroext %1) {
%3 = tail call zeroext i16 @app_usb_file_report(i8* %0, i16 zeroext %1)
ret i16 %3
}
/* Variables and functions */
int read(int, char *, int);
int safe_read(int desc, char *ptr, int len) {
  int n_chars;
  if (len <= 0)
    return len;
  n_chars = read(desc, ptr, len);
  return n_chars;
}


x86 assembly (clang, -O0):
<safe_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1137 <safe_read+0x27>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <safe_read+0x3f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_read>:
test   %edx,%edx
jle    1119 <safe_read+0x9>
jmp    1030 <read@plt>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @safe_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %2, %3 ]
ret i32 %8
}
int SDL_imageFilterAddUintMMX(unsigned char *Src1, unsigned char *Dest,
                              int length, unsigned int C, unsigned int Cs) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterAddUintMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterAddUintMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
float sqrt(int);
float CircularEaseOut(float p) { return sqrt((2 - p) * p); }


x86 assembly (clang, -O0):
<CircularEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CircularEaseOut>:
movss  0xee8(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @CircularEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 2.000000e+00, %3
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = fptosi float %6 to i32
%8 = call float @sqrt(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @CircularEaseOut(float %0) {
%2 = fsub float 2.000000e+00, %0
%3 = fmul float %2, %0
%4 = fptosi float %3 to i32
%5 = tail call float @sqrt(i32 %4)
ret float %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
int pca_cmp_file(const void *v1, const void *v2) {
  const char *file_name = (const char *)v1;
  const char **cache_name = (const char **)v2;
  return strcmp(file_name, *cache_name + 1);
}


x86 assembly (clang, -O0):
<pca_cmp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pca_cmp_file>:
mov    (%rsi),%rsi
add    $0x1,%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @pca_cmp_file(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char const *);
void exit_with_error(const char *str) {
  printf("Error: %s\n", str);
  getchar();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_with_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_error>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_with_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @getchar()
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_with_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void apush() {
  asm volatile("popq %%rax\n\t"
               "movq %%rsp, %%r8\n\t"
               "movq 0x10(%%rbp), %%rsp\n\t"
               "pushq %%rax\n\t"
               "movq %%rsp, 0x10(%%rbp)\n\t"
               "movq %%r8, %%rsp\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<apush>:
pop    %rax
mov    %rsp,%r8
mov    0x10(%rbp),%rsp
push   %rax
mov    %rsp,0x10(%rbp)
mov    %r8,%rsp
ret

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

LLVM IR (-O2):
define void @apush() {
tail call void asm sideeffect "popq %rax\0A\09movq %rsp, %r8\0A\09movq 0x10(%rbp), %rsp\0A\09pushq %rax\0A\09movq %rsp, 0x10(%rbp)\0A\09movq %r8, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}