xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void error(int num) { fprintf(stderr, "Error %d\n", num); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Error %d\0A\00"
define void @error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TIME;

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


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

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

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

LLVM IR (-O2):
@ASN1_TIME_it = global i32 0
define i32* @d2i_ASN1_TIME(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_TIME_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void link_error0() {}


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

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

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

LLVM IR (-O2):
define void @link_error0() {
ret void
}
int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
                                                char **devicefile,
                                                int num_devicefiles) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @am33xx_bbu_nand_xloadslots_register_handler(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
struct hal_flash {
  int dummy;
};

/* Variables and functions */
const struct hal_flash *hal_bsp_flash_dev(uint8_t id) {
  if (id != 0) {
    return NULL;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<hal_bsp_flash_dev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <hal_bsp_flash_dev+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1128 <hal_bsp_flash_dev+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.hal_flash = type { i32 }
define noalias %struct.hal_flash* @hal_bsp_flash_dev(i64 %0) {
ret %struct.hal_flash* null
}
/* Type definitions */
struct tmx {
  int dummy;
};
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
int /*<<< orphan*/ strfxtime(char *, size_t, char *, struct tmx *);
void uninitvar_strftime(void) {
  char *s;
  size_t max;
  char *fmt;
  struct tm *p;
  (void)strftime(s, max, fmt, p);
  struct tmx *px;
  (void)strfxtime(s, max, fmt, px);
}


x86 assembly (clang, -O0):
<uninitvar_strftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <strftime@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <strfxtime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_strftime>:
push   %rax
call   1030 <strftime@plt>
pop    %rax
jmp    1040 <strfxtime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
%struct.tmx = type { i32 }
define void @uninitvar_strftime() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.tm*
%5 = alloca %struct.tmx*
%6 = load i8*, i8** %1
%7 = load i64, i64* %2
%8 = load i8*, i8** %3
%9 = load %struct.tm*, %struct.tm** %4
%10 = call i32 @strftime(i8* %6, i64 %7, i8* %8, %struct.tm* %9)
%11 = load i8*, i8** %1
%12 = load i64, i64* %2
%13 = load i8*, i8** %3
%14 = load %struct.tmx*, %struct.tmx** %5
%15 = call i32 @strfxtime(i8* %11, i64 %12, i8* %13, %struct.tmx* %14)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
%struct.tmx = type { i32 }
define void @uninitvar_strftime() {
%1 = tail call i32 @strftime(i8* undef, i64 undef, i8* undef, %struct.tm* undef)
%2 = tail call i32 @strfxtime(i8* undef, i64 undef, i8* undef, %struct.tmx* undef)
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int);
int shim_pkey_get(int pkey) { return (int)shim_enosys(0, pkey); }


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

x86 assembly (clang, -O2):
<shim_pkey_get>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_pkey_get(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @shim_enosys(i32 0, i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @shim_pkey_get(i32 %0) {
%2 = tail call i64 @shim_enosys(i32 0, i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void too_complex() {
  printf("Expression is too complex.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<too_complex>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [28 x i8] c"Expression is too complex.\0A\00"
@EXIT_FAILURE = global i32 0
define void @too_complex() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [27 x i8] c"Expression is too complex.\00"
define void @too_complex() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
double trunc(double);
double d_int(double *x) { return trunc(*x); }


x86 assembly (clang, -O0):
<d_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <trunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_int>:
movsd  (%rdi),%xmm0
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define double @d_int(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @llvm.trunc.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @d_int(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.trunc.f64(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void es4(int *array, size_t size) {
  int mult = 0;
  for (int i = 0; i < size; i++)
    mult *= array[i];
  printf("%d\n", mult);
}


x86 assembly (clang, -O0):
<es4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <es4+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <es4+0x1e>
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<es4>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @es4(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %7
%13 = load i32*, i32** %3
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, %17
store i32 %19, i32* %5
br label %20
20: ; preds = %12
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
%24 = load i32, i32* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @es4(i32* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
int max(int first, int second) {
  int max;
  if (first > second) {
    max = first;
  } else {
    max = second;
  }
  return max;
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
double sum(double x, double y) { return (x + y); }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sum(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sum(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ back(char);
char input();
void skipblank(void) {
  char c;
  while ((c = input()) == ' ' || c == '\t')
    ;
  back(c);
}


x86 assembly (clang, -O0):
<skipblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <input@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1150 <skipblank+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1160 <skipblank+0x40>
jmp    1165 <skipblank+0x45>
jmp    1128 <skipblank+0x8>
movsbl -0x1(%rbp),%edi
call   1030 <back@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipblank>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <input@plt>
cmp    $0x9,%al
je     1130 <skipblank+0x10>
cmp    $0x20,%al
je     1130 <skipblank+0x10>
movsbl %al,%edi
pop    %rax
jmp    1030 <back@plt>

LLVM IR (-O0):
define void @skipblank() {
%1 = alloca i8
br label %2
2: ; preds = %12, %0
%3 = call signext i8 (...) @input()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ true, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i8, i8* %1
%15 = call i32 @back(i8 signext %14)
ret void
}

LLVM IR (-O2):
define void @skipblank() {
br label %1
1: ; preds = %3, %0
%2 = tail call signext i8 (...) @input()
switch i8 %2, label %4 [
i8 32, label %3
i8 9, label %3
]
3: ; preds = %1, %1
br label %1
4: ; preds = %1
%5 = tail call i32 @back(i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mstrcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char t[] = " two";
  char s[20];
  s[0] = 'o';
  s[1] = 'n';
  s[2] = 'e';
  s[3] = '\0';
  mstrcat(&s[0], &t[0]);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
movb   $0x6f,-0x20(%rbp)
movb   $0x6e,-0x1f(%rbp)
movb   $0x65,-0x1e(%rbp)
movb   $0x0,-0x1d(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x9(%rbp),%rsi
call   1040 <mstrcat@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x6f777420,0x8(%rsp)
6f
movl   $0x656e6f,0x10(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <mstrcat@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.t = [5 x i8] c" two\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 111, i8* %5
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 1
store i8 110, i8* %6
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 2
store i8 101, i8* %7
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 3
store i8 0, i8* %8
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = call i32 @mstrcat(i8* %9, i8* %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.t = [5 x i8] c" two\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
store i8 111, i8* %4
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 1
store i8 110, i8* %5
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 2
store i8 101, i8* %6
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 3
store i8 0, i8* %7
%8 = call i32 @mstrcat(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
char *strcat(char *restrict s1, const char *restrict s2) {
  char *save = s1;
  for (; *s1; s1++)
    ;
  while ((*s1++ = *s2++) != '\0')
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <strcat+0x37>
jmp    1126 <strcat+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113c <strcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <strcat+0x6f>
jmp    113c <strcat+0x3c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_bit_false(int /*<<< orphan*/ volatile *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ set_bit_true(int /*<<< orphan*/ volatile *, int);
void turn_led_off(volatile uint8_t *buffer) {
  set_bit_false(buffer, 0);
  set_bit_true(buffer, 1);
  set_bit_true(buffer, 3);
  set_bit_true(buffer, 2);
}


x86 assembly (clang, -O0):
<turn_led_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <set_bit_false@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <set_bit_true@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1040 <set_bit_true@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <set_bit_true@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_led_off>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <set_bit_false@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <set_bit_true@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <set_bit_true@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1040 <set_bit_true@plt>

LLVM IR (-O0):
define void @turn_led_off(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @set_bit_false(i32* %3, i32 0)
%5 = load i32*, i32** %2
%6 = call i32 @set_bit_true(i32* %5, i32 1)
%7 = load i32*, i32** %2
%8 = call i32 @set_bit_true(i32* %7, i32 3)
%9 = load i32*, i32** %2
%10 = call i32 @set_bit_true(i32* %9, i32 2)
ret void
}

LLVM IR (-O2):
define void @turn_led_off(i32* %0) {
%2 = tail call i32 @set_bit_false(i32* %0, i32 0)
%3 = tail call i32 @set_bit_true(i32* %0, i32 1)
%4 = tail call i32 @set_bit_true(i32* %0, i32 3)
%5 = tail call i32 @set_bit_true(i32* %0, i32 2)
ret void
}
int emac1_ifinmulticastpkts_set(unsigned int dev_id,
                                union emac1_ifinmulticastpkts_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_ifinmulticastpkts_u = type opaque
define i32 @emac1_ifinmulticastpkts_set(i32 %0, %union.emac1_ifinmulticastpkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_ifinmulticastpkts_u*
store i32 %0, i32* %3
store %union.emac1_ifinmulticastpkts_u* %1, %union.emac1_ifinmulticastpkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_ifinmulticastpkts_u = type opaque
define i32 @emac1_ifinmulticastpkts_set(i32 %0, %union.emac1_ifinmulticastpkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ strlcat(char *, char const *, size_t);
void uninitvar_strlcat(char *Ct, const char *S, size_t N) {
  char *ct;
  char *s;
  size_t n;
  (void)strlcat(ct, s, n);
  (void)strlcat(ct, S, N);
  (void)strlcat(Ct, s, N);
  (void)strlcat(Ct, S, n);
  (void)strlcat(Ct, S, N);
}


x86 assembly (clang, -O0):
<uninitvar_strlcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_strlcat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlcat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strlcat@plt>

LLVM IR (-O0):
define void @uninitvar_strlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = load i64, i64* %9
%13 = call i32 @strlcat(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %7
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @strlcat(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %4
%19 = load i8*, i8** %8
%20 = load i64, i64* %6
%21 = call i32 @strlcat(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = load i64, i64* %9
%25 = call i32 @strlcat(i8* %22, i8* %23, i64 %24)
%26 = load i8*, i8** %4
%27 = load i8*, i8** %5
%28 = load i64, i64* %6
%29 = call i32 @strlcat(i8* %26, i8* %27, i64 %28)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strlcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlcat(i8* undef, i8* undef, i64 undef)
%5 = tail call i32 @strlcat(i8* undef, i8* %1, i64 %2)
%6 = tail call i32 @strlcat(i8* %0, i8* undef, i64 %2)
%7 = tail call i32 @strlcat(i8* %0, i8* %1, i64 undef)
%8 = tail call i32 @strlcat(i8* %0, i8* %1, i64 %2)
ret void
}
int CODEC_Detect(int *a, int *b) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @CODEC_Detect(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xd1() {
  Assert_real((isalpha(209) == 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",
              1050, ("isalpha should be 0 for 0xd1"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xd1>:
push   %rax
mov    $0xd1,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41a,%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 0xd1\00"
define void @t_isalpha_0xd1() {
%1 = call i64 @isalpha(i32 209)
%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 1050, 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 0xd1\00"
define void @t_isalpha_0xd1() {
%1 = tail call i64 @isalpha(i32 209)
%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 1050, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_func();
int main() { test_func(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int CFC_filter_signal_duplicate_and_consecutive_sn() {
  int nb_marked = 0;
  puts("Cloaking - Filtering all packet with signal, duplicate and consecutive "
       "SN filters");
  puts("Not yet implemented");
  return nb_marked;
}


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

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

LLVM IR (-O0):
@.str = [82 x i8] c"Cloaking - Filtering all packet with signal, duplicate and consecutive SN filters\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @CFC_filter_signal_duplicate_and_consecutive_sn() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [82 x i8] c"Cloaking - Filtering all packet with signal, duplicate and consecutive SN filters\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @CFC_filter_signal_duplicate_and_consecutive_sn() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void vfree(void *);
void vdma_mem_free(unsigned long addr, unsigned long size) {
  return vfree((void *)addr);
}


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

x86 assembly (clang, -O2):
<vdma_mem_free>:
jmp    1030 <vfree@plt>

LLVM IR (-O0):
define void @vdma_mem_free(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 = inttoptr i64 %5 to i8*
ret void
}

LLVM IR (-O2):
define void @vdma_mem_free(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i8*
tail call void @vfree(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: whtgen -n SIZE \n");
  printf("    -h            Show this help message.\n");
  printf("    -n SIZE       Generate codelet of size N=2^SIZE.\n");
  printf("\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
lea    0xef1(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: whtgen -n SIZE \0A\00"
@.str.1 = [43 x i8] c" -h Show this help message.\0A\00"
@.str.2 = [54 x i8] c" -n SIZE Generate codelet of size N=2^SIZE.\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Usage: whtgen -n SIZE \00"
@str.4 = [42 x i8] c" -h Show this help message.\00"
@str.5 = [53 x i8] c" -n SIZE Generate codelet of size N=2^SIZE.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ptr_glFlush();
extern void glFlush(void) { ptr_glFlush(); }


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

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

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

LLVM IR (-O2):
define void @glFlush() {
%1 = tail call i32 (...) @ptr_glFlush()
ret void
}
int *brook(int x, int y) {
  int c;
  c = x + y;
  return c;
}


x86 assembly (clang, -O0):
<brook>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brook>:
add    %esi,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i32* @brook(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @brook(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int execute_pipe2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pipe2() {
ret i32 0
}
/* Variables and functions */
int execvp(char const *, char *const *);
int outside_execvp(const char *file, char *const argv[]) {
  return execvp(file, argv);
}


x86 assembly (clang, -O0):
<outside_execvp>:
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 <execvp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outside_execvp>:
jmp    1030 <execvp@plt>

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

LLVM IR (-O2):
define i32 @outside_execvp(i8* %0, i8** %1) {
%3 = tail call i32 @execvp(i8* %0, i8** %1)
ret i32 %3
}
f(x) {
  int a = ~x;
  while (a)
    a = g(a);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1140 <f+0x30>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0xc(%rbp)
jmp    1124 <f+0x14>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
cmp    $0xffffffff,%edi
je     112d <f+0x1d>
mov    %edi,%eax
not    %eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
xor    %eax,%eax
call   1030 <g@plt>
test   %eax,%eax
jne    1120 <f+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = xor i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %4, %3 ]
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @g to i32 (i32, ...)*)(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (strcmp(argv[0], "./mkdir") != 0)
    return 1;
  if (argv[1] == NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     114f <main+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x61>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    116a <main+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <main+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xee2(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1132 <main+0x22>
pop    %rbx
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"./mkdir\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 1, %2 ], [ %10, %6 ]
ret i32 %12
}
void outer_sync(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
void strreplace(char **old, const char *new) {
  free(*old);
  *old = strdup(new);
}


x86 assembly (clang, -O0):
<strreplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreplace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strreplace(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** %5
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @strdup(i8* %8)
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
ret void
}

LLVM IR (-O2):
define void @strreplace(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
%5 = tail call i8* @strdup(i8* %1)
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, char *);
void alt_bkt_free(void *ptr) {
  printf("%s\n", "alt_bkt_free");
  free(ptr);
}


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

x86 assembly (clang, -O2):
<alt_bkt_free>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"alt_bkt_free\00"
define void @alt_bkt_free(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @free(i8* %0)
ret void
}
void gtk_accel_label_get_accel_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_label_get_accel_widget() {
ret void
}
_Noreturn void die2(const char *msg1, const char *msg2) {
  warn2(msg1, msg2);
  dien();
}


x86 assembly (clang, -O0):
<die2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <warn2@plt>
mov    $0x0,%al
call   1030 <dien@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die2>:
push   %rax
xor    %eax,%eax
call   1040 <warn2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <dien@plt>

LLVM IR (-O0):
define void @die2(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 (i8*, i8*, ...) bitcast (i32 (...)* @warn2 to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = call i32 (...) @dien()
ret void
}

LLVM IR (-O2):
define void @die2(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @warn2 to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = tail call i32 (...) @dien()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printPageInInfo(const char *cmd) {
  (void)cmd;
  output("Paged in Pages\t0\t0\t1/s\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Paged in Pages\090\090\091/s\0A\00"
define void @printPageInInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Paged in Pages\090\090\091/s\0A\00"
define void @printPageInInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strerror(int);
void checked_mutex_init(pthread_mutex_t *m) {
  int err = pthread_mutex_init(m, NULL);
  if (err != 0) {
    errx(1, "Failed to initialize mutex: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_mutex_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_mutex_init@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <checked_mutex_init+0x41>
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe94(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_mutex_init>:
push   %rax
xor    %esi,%esi
call   1050 <pthread_mutex_init@plt>
test   %eax,%eax
je     1157 <checked_mutex_init+0x27>
mov    %eax,%edi
call   1040 <strerror@plt>
lea    0xeb6(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Failed to initialize mutex: %s\00"
define void @checked_mutex_init(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_init(i32* %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Failed to initialize mutex: %s\00"
define void @checked_mutex_init(i32* %0) {
%2 = tail call i32 @pthread_mutex_init(i32* %0, i32* null)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @strerror(i32 %2)
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void dlnaDisplayBanner(FILE *fd __attribute__((unused)),
                       const char **lines __attribute__((unused)),
                       size_t size __attribute__((unused)),
                       int starlength __attribute__((unused))) {}


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

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

LLVM IR (-O0):
define void @dlnaDisplayBanner(i32* %0, i8** %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @dlnaDisplayBanner(i32* nocapture %0, i8** nocapture %1, i64 %2, i32 %3) {
ret void
}