xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
scalar_t__ strlen(char const *);
char *unescape_b(char const *, char *);
char *unescape(const char *esc_str) {
  char *str;
  str = malloc(strlen(esc_str) + 1);
  return unescape_b(esc_str, str);
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <unescape_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <unescape_b@plt>

LLVM IR (-O0):
define i8* @unescape(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i8* @unescape_b(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @unescape(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @unescape_b(i8* %0, i8* %4)
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
movslq %edi,%rax
andl   $0xffffffef,0x2c(%rax)
ret

LLVM IR (-O0):
define void @UARTFIFODisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -17
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTFIFODisable(i32 %0) {
%2 = add nsw i32 %0, 44
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -17
store volatile i32 %6, i32* %4
ret void
}
int compare(const void *n1, const void *n2) {
  return *(const int *)n1 - *(const int *)n2;
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is test #2.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"This is test.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"This is test.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprint_invalid(int /*<<< orphan*/ *, unsigned char *,
                                  unsigned char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_null(FILE *f, unsigned char *p, unsigned char *e) {
  if (p < e) {
    fprint_invalid(f, p, e);
    return;
  }
  fprintf(f, "(null)");
}


x86 assembly (clang, -O0):
<fprint_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1158 <fprint_null+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <fprint_invalid@plt>
jmp    1168 <fprint_null+0x48>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_null>:
mov    %rdi,%rcx
cmp    %rdx,%rsi
jae    1130 <fprint_null+0x10>
mov    %rcx,%rdi
jmp    1030 <fprint_invalid@plt>
lea    0xec9(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define void @fprint_null(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @fprint_invalid(i32* %11, i8* %12, i8* %13)
br label %18
15: ; preds = %3
%16 = load i32*, i32** %4
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @fprint_null(i32* %0, i8* %1, i8* %2) {
%4 = icmp ult i8* %1, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @fprint_invalid(i32* %0, i8* %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_cmp(int, int);
int /*<<< orphan*/ emit_orrgt_imm(int, int, int);
void emit_cmpgt(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_cmp(s2, s1);
  emit_orrgt_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_cmpgt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1040 <emit_andimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <emit_cmp@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_orrgt_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmpgt>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1040 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <emit_cmp@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <emit_orrgt_imm@plt>

LLVM IR (-O0):
define void @emit_cmpgt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @emit_andimm(i32 %9, i32 -2, i32 %10)
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @emit_cmp(i32 %12, i32 %13)
%15 = load i32, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @emit_orrgt_imm(i32 %15, i32 1, i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_cmpgt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_cmp(i32 %1, i32 %0)
%7 = tail call i32 @emit_orrgt_imm(i32 %2, i32 1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void sigint_handler(int k) {
  char a;
  printf("are you sure you want to exit? y/n");
  scanf("%c", &a);
  if (a == 'y') {
    exit(0);
  } else
    return;
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
jne    116b <sigint_handler+0x3b>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
cmpb   $0x79,0x7(%rsp)
je     1157 <sigint_handler+0x27>
pop    %rax
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"are you sure you want to exit? y/n\00"
@.str.1 = [3 x i8] c"%c\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"are you sure you want to exit? y/n\00"
@.str.1 = [3 x i8] c"%c\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i8
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 121
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int x = 0xff;
  printf("0x%x\n", x);
  printf("%d\n", bitcount(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1040 <bitcount@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 255)
%2 = tail call i32 @bitcount(i32 255)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
void __VERIFIER_atomic_CAS(volatile int *v, int e, int u, int *r) {
  if (*v == e) {
    *v = u, *r = 1;
  } else {
    *r = 0;
  }
}


x86 assembly (clang, -O0):
<__VERIFIER_atomic_CAS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1139 <__VERIFIER_atomic_CAS+0x39>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    1143 <__VERIFIER_atomic_CAS+0x43>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_atomic_CAS>:
mov    (%rdi),%eax
xor    %r8d,%r8d
cmp    %esi,%eax
jne    1111 <__VERIFIER_atomic_CAS+0x11>
mov    %edx,(%rdi)
mov    $0x1,%r8d
mov    %r8d,(%rcx)
ret

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

LLVM IR (-O2):
define void @__VERIFIER_atomic_CAS(i32* %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = load volatile i32, i32* %0
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %4
store volatile i32 %2, i32* %0
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 1, %7 ], [ 0, %4 ]
store i32 %9, i32* %3
ret void
}
void cygwin_premain0(int argc, char **argv) {}


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

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

LLVM IR (-O0):
define void @cygwin_premain0(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @cygwin_premain0(i32 %0, i8** nocapture %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_window(void *_p, unsigned long _v) {
  ((XLeaveWindowEvent *)_p)->window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XLeaveWindowEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ stdlib_strided_svariancewd(int /*<<< orphan*/ const,
                                              float const, float const *,
                                              int /*<<< orphan*/ const);
float stdlib_strided_sstdevwd(const int64_t N, const float correction,
                              const float *X, const int64_t stride) {
  return sqrtf(stdlib_strided_svariancewd(N, correction, X, stride));
}


x86 assembly (clang, -O0):
<stdlib_strided_sstdevwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <stdlib_strided_svariancewd@plt>
mov    %eax,%edi
call   1030 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_sstdevwd>:
push   %rax
call   1040 <stdlib_strided_svariancewd@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @stdlib_strided_sstdevwd(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call i32 @stdlib_strided_svariancewd(i32 %9, float %10, float* %11, i32 %12)
%14 = call float @sqrtf(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @stdlib_strided_sstdevwd(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call i32 @stdlib_strided_svariancewd(i32 %0, float %1, float* %2, i32 %3)
%6 = tail call float @sqrtf(i32 %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ LCD(int, int /*<<< orphan*/);
int /*<<< orphan*/ converterNumero(int);
void mostraNumero(int numero) { LCD(1, converterNumero(numero)); }


x86 assembly (clang, -O0):
<mostraNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <converterNumero@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1040 <LCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostraNumero>:
push   %rax
call   1030 <converterNumero@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <LCD@plt>

LLVM IR (-O0):
define void @mostraNumero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @converterNumero(i32 %3)
%5 = call i32 @LCD(i32 1, i32 %4)
ret void
}

LLVM IR (-O2):
define void @mostraNumero(i32 %0) {
%2 = tail call i32 @converterNumero(i32 %0)
%3 = tail call i32 @LCD(i32 1, i32 %2)
ret void
}
int test_imm_B9uint8_reg(unsigned char val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 185
%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_B9uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -71
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_text_iter_compare() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_compare() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ mhandle_out_of_memory(char *);
void *__xcalloc(size_t nmemb, size_t size, char *at) {
  void *ptr;
  ptr = calloc(nmemb, size);
  if (!ptr)
    mhandle_out_of_memory(at);
  return ptr;
}


x86 assembly (clang, -O0):
<__xcalloc>:
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
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <__xcalloc+0x39>
mov    -0x18(%rbp),%rdi
call   1030 <mhandle_out_of_memory@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <__xcalloc+0x1c>
mov    %r14,%rdi
call   1030 <mhandle_out_of_memory@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @__xcalloc(i64 %0, i64 %1, i8* %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @mhandle_out_of_memory(i8* %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *getcwd(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char buf[1024];
  char *cwd = getcwd(buf, sizeof(buf));
  if (cwd == NULL) {
    perror("Error.\n");
    exit(-1);
  } else {
    printf("%s\n", cwd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
mov    %rax,-0x418(%rbp)
cmpq   $0x0,-0x418(%rbp)
jne    118e <main+0x4e>
lea    0xe81(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x418(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     1172 <main+0x32>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret
lea    0xe87(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Error.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i8* @getcwd(i8* %4, i32 1024)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Error.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i8* @getcwd(i8* %2, i32 1024)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
int is_slash(char ch) { return ch == '/'; }


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

x86 assembly (clang, -O2):
<is_slash>:
xor    %eax,%eax
cmp    $0x2f,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_slash(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *nxt(char **);
double strtod(char *, int /*<<< orphan*/ *);
void scandbl(char **toks, double *f) {
  char *t = nxt(toks);
  double l = strtod(t, NULL);
  *f = l;
}


x86 assembly (clang, -O0):
<scandbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nxt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scandbl>:
push   %rbx
mov    %rsi,%rbx
call   1040 <nxt@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @scandbl(i8** %0, double* %1) {
%3 = alloca i8**
%4 = alloca double*
%5 = alloca i8*
%6 = alloca double
store i8** %0, i8*** %3
store double* %1, double** %4
%7 = load i8**, i8*** %3
%8 = call i8* @nxt(i8** %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call double @strtod(i8* %9, i32* null)
store double %10, double* %6
%11 = load double, double* %6
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @scandbl(i8** %0, double* nocapture writeonly %1) {
%3 = tail call i8* @nxt(i8** %0)
%4 = tail call double @strtod(i8* nocapture %3, i32* null)
store double %4, double* %1
ret void
}
char manipulateName(char name[]) {
  char buf[20];
  strcpy(buf, name);
  return buf;
}


x86 assembly (clang, -O0):
<manipulateName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manipulateName>:
lea    -0x18(%rsp),%rax
ret

LLVM IR (-O0):
define signext i8 @manipulateName(i8* %0) {
%2 = alloca i8*
%3 = alloca [20 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = ptrtoint i8* %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @manipulateName(i8* nocapture %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = ptrtoint [20 x i8]* %2 to i64
%5 = trunc i64 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program_name) {
  printf("USAGE: %s <path-to-cproto> <dut-source-file.c> <mockables.lst> "
         "<path-to-cutest>"
         " [-I flags]\n",
         program_name);
}


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

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

LLVM IR (-O0):
@.str = [92 x i8] c"USAGE: %s <path-to-cproto> <dut-source-file.c> <mockables.lst> <path-to-cutest> [-I flags]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [92 x i8] c"USAGE: %s <path-to-cproto> <dut-source-file.c> <mockables.lst> <path-to-cutest> [-I flags]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_C3int32_reg(int val) { return ((val) & (0xC3 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_C3int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C3int32_reg(i32 %0) {
%2 = and i32 %0, 195
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long long unsigned int div8(long long unsigned int value) { return value >> 3; }


x86 assembly (clang, -O0):
<div8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div8>:
mov    %rdi,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @div8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 3
ret i64 %4
}

LLVM IR (-O2):
define i64 @div8(i64 %0) {
%2 = lshr i64 %0, 3
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_string(char *);
int main(int argc, char *argv[]) {
  char str[] = "first second third";
  reverse_string(str);
  printf("Output : %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x1e(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <reverse_string@plt>
lea    -0x30(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x647269,0xf(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse_string@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [19 x i8] c"first second third\00"
@.str = [13 x i8] c"Output : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [19 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [19 x i8]* %5 to i8*
%7 = getelementptr inbounds [19 x i8], [19 x i8]* %5, i64 0, i64 0
%8 = call i32 @reverse_string(i8* %7)
%9 = getelementptr inbounds [19 x i8], [19 x i8]* %5, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [19 x i8] c"first second third\00"
@.str = [13 x i8] c"Output : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [19 x i8]
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%5 = call i32 @reverse_string(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x34() {
  Assert_real((ispunct(52) == 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_ispunct.c",
              265, ("ispunct should be 0 for 4"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x34>:
push   %rax
mov    $0x34,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x109,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 4\00"
define void @t_ispunct_0x34() {
%1 = call i64 @ispunct(i32 52)
%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 265, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 4\00"
define void @t_ispunct_0x34() {
%1 = tail call i64 @ispunct(i32 52)
%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 265, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f(int i, int j) { printf("i + j = %d\n", i + j); }


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

x86 assembly (clang, -O2):
<f>:
add    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"i + j = %d\0A\00"
define void @f(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 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"i + j = %d\0A\00"
define void @f(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int foo() { return 3; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned long long);
void foo(unsigned long long n) {
  unsigned long long i;
#pragma omp for schedule(nonmonotonic : guided, 7)
  for (i = 0; i < n; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114c <foo+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <foo+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1131 <foo+0x21>
mov    %rdi,%r14
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <bar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar(i64 %4)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
unsigned test(unsigned X) { return (unsigned char)X; }


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

x86 assembly (clang, -O2):
<test>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_new_ipv6() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_new_ipv6"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_client_new_ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_socket_client_new_ipv6>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_ipv6\0A\00"
define i32 @pa_socket_client_new_ipv6() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_socket_client_new_ipv6\00"
define i32 @pa_socket_client_new_ipv6() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct nmodule {
  int dummy;
};

/* Variables and functions */
struct nmodule *find_module_by_name(char const *);
int open_module(struct nmodule *);
int network_open_module(const char *name) {
  struct nmodule *nm;
  if ((nm = find_module_by_name(name)) == NULL)
    return -1;
  return open_module(nm);
}


x86 assembly (clang, -O0):
<network_open_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <find_module_by_name@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114f <network_open_module+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <network_open_module+0x3b>
mov    -0x18(%rbp),%rdi
call   1040 <open_module@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_open_module>:
push   %rax
call   1030 <find_module_by_name@plt>
test   %rax,%rax
je     1134 <network_open_module+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <open_module@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nmodule = type { i32 }
define i32 @network_open_module(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.nmodule*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.nmodule* @find_module_by_name(i8* %5)
store %struct.nmodule* %6, %struct.nmodule** %4
%7 = icmp eq %struct.nmodule* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load %struct.nmodule*, %struct.nmodule** %4
%11 = call i32 @open_module(%struct.nmodule* %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.nmodule = type { i32 }
define i32 @network_open_module(i8* %0) {
%2 = tail call %struct.nmodule* @find_module_by_name(i8* %0)
%3 = icmp eq %struct.nmodule* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @open_module(%struct.nmodule* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
int /*<<< orphan*/ abort();
void test_1(int i) {
  if (i == 42)
    abort();
  __analyzer_eval(i != 42);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
jne    113c <test_1+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2a,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
cmp    $0x2a,%edi
je     112f <test_1+0xf>
mov    $0x1,%edi
jmp    1040 <__analyzer_eval@plt>
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 42
%10 = zext i1 %9 to i32
%11 = call i32 @__analyzer_eval(i32 %10)
ret void
}

LLVM IR (-O2):
define void @test_1(i32 %0) {
%2 = icmp eq i32 %0, 42
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outadd() { outop2str("ADD"); }


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

x86 assembly (clang, -O2):
<outadd>:
lea    0xee9(%rip),%rdi
jmp    1030 <outop2str@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ADD\00"
define void @outadd() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ADD\00"
define void @outadd() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_http_run();
int main(void) { iothub_client_sample_http_run(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_http_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int long_double_to_i32(long);
int main(void) {
  assert(long_double_to_i32(42.L) == 42);
  assert(long_double_to_i32(-42.L) == -42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1040 <long_double_to_i32@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xffffffffffffffd6,%rdi
call   1040 <long_double_to_i32@plt>
cmp    $0xffffffd6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1040 <long_double_to_i32@plt>
xor    %edi,%edi
cmp    $0x2a,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0xffffffffffffffd6,%rdi
call   1040 <long_double_to_i32@plt>
xor    %edi,%edi
cmp    $0xffffffd6,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @long_double_to_i32(i64 42)
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @long_double_to_i32(i64 -42)
%6 = icmp eq i32 %5, -42
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @long_double_to_i32(i64 42)
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @long_double_to_i32(i64 -42)
%6 = icmp eq i32 %5, -42
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
void SPI1_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_SaveConfig() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_unpackhi_epi32(__m128i A, __m128i B) {
  return _mm_unpackhi_epi32(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_unpackhi_epi32>:
jmp    1030 <_mm_unpackhi_epi32@plt>

LLVM IR (-O0):
define i32 @test_mm_unpackhi_epi32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_unpackhi_epi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_unpackhi_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpackhi_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int syscall(int, char *, char *);
int symlink(char *oldfile, char *newfile) {
  return syscall(25, oldfile, newfile);
}


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

x86 assembly (clang, -O2):
<symlink>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x19,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @syscall(i32 25, i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @symlink(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 25, i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
char *X509_NAME_oneline(int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int /*<<< orphan*/ X509_get_subject_name(int /*<<< orphan*/ *);
char *abac_get_subject(X509 *cert) {
  char *ptr = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
  return ptr;
}


x86 assembly (clang, -O0):
<abac_get_subject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <X509_get_subject_name@plt>
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <X509_NAME_oneline@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abac_get_subject>:
push   %rax
call   1040 <X509_get_subject_name@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <X509_NAME_oneline@plt>

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

LLVM IR (-O2):
define i8* @abac_get_subject(i32* %0) {
%2 = tail call i32 @X509_get_subject_name(i32* %0)
%3 = tail call i8* @X509_NAME_oneline(i32 %2, i32 0, i32 0)
ret i8* %3
}