xunge/DecIR huggingface dataset:
/* Type definitions */
struct _test_data_mount_setattr_idmapped {
  int dummy;
};
struct __test_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MNT_DETACH;
int /*<<< orphan*/ umount2(char *, int /*<<< orphan*/);
void mount_setattr_idmapped_teardown(
    struct __test_metadata __attribute__((unused)) * _metadata,
    struct _test_data_mount_setattr_idmapped __attribute__((unused)) * self) {
  (void)umount2("/mnt/A", MNT_DETACH);
  (void)umount2("/tmp", MNT_DETACH);
}


x86 assembly (clang, -O0):
<mount_setattr_idmapped_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <umount2@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1030 <umount2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_setattr_idmapped_teardown>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <umount2@plt>
mov    (%rbx),%esi
lea    0xed8(%rip),%rdi
pop    %rbx
jmp    1030 <umount2@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct._test_data_mount_setattr_idmapped = type { i32 }
@.str = [7 x i8] c"/mnt/A\00"
@MNT_DETACH = global i32 0
@.str.1 = [5 x i8] c"/tmp\00"
define void @mount_setattr_idmapped_teardown(%struct.__test_metadata* %0, %struct._test_data_mount_setattr_idmapped* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct._test_data_mount_setattr_idmapped*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct._test_data_mount_setattr_idmapped* %1, %struct._test_data_mount_setattr_idmapped** %4
%5 = load i32, i32* @MNT_DETACH
%6 = call i32 @umount2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @MNT_DETACH
%8 = call i32 @umount2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct._test_data_mount_setattr_idmapped = type { i32 }
@.str = [7 x i8] c"/mnt/A\00"
@MNT_DETACH = global i32 0
@.str.1 = [5 x i8] c"/tmp\00"
define void @mount_setattr_idmapped_teardown(%struct.__test_metadata* nocapture readnone %0, %struct._test_data_mount_setattr_idmapped* nocapture readnone %1) {
%3 = load i32, i32* @MNT_DETACH
%4 = tail call i32 @umount2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @MNT_DETACH
%6 = tail call i32 @umount2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
const char *pathJoin(const char *dir, const char *file) {
  static char buffer[4096 + 1];
  buffer[0] = '\0';
  snprintf(buffer, 4096, "%s/%s", dir, file);
  return buffer;
}


x86 assembly (clang, -O0):
<pathJoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,0x2f19(%rip)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0x2f0a(%rip),%rdi
mov    $0x1000,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ef2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathJoin>:
push   %rbx
mov    %rsi,%r8
mov    %rdi,%rcx
movb   $0x0,0x2f22(%rip)
lea    0x2f1b(%rip),%rbx
lea    0xed4(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@pathJoin.buffer = internal global [4097 x i8] zeroinitializer
@.str = [6 x i8] c"%s/%s\00"
define i8* @pathJoin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 0, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0)
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @snprintf(i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0), i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@pathJoin.buffer = internal global [4097 x i8] zeroinitializer
@.str = [6 x i8] c"%s/%s\00"
define i8* @pathJoin(i8* %0, i8* %1) {
store i8 0, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0)
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0), i32 4096, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @pathJoin.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "usage: %s [-a] [cpp_options] [file]\n", name);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: %s [-a] [cpp_options] [file]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int fn8(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = b & a;
  return tem1 ^ tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int close(int);
int plt_sockClose(int fdSocket) { return close(fdSocket); }


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

x86 assembly (clang, -O2):
<plt_sockClose>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @plt_sockClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @plt_sockClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Usage: %s file b1 [b2 ...]\n", progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s file b1 [b2 ...]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s file b1 [b2 ...]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%d %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
long int codebook(long int mask, long int bitchanged, long int numbasis,
                  long int codeword, long int g, const short *d, short ddim,
                  short theta) {
  long int j;
  for (j = bitchanged + 1; j <= numbasis; j++) {
  }
  return g;
}


x86 assembly (clang, -O0):
<codebook>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%ax
mov    0x10(%rbp),%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1154 <codebook+0x54>
jmp    1143 <codebook+0x43>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1130 <codebook+0x30>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<codebook>:
mov    %r8,%rax
ret

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

LLVM IR (-O2):
define i64 @codebook(i64 %0, i64 %1, i64 %2, i64 %3, i64 returned %4, i16* nocapture readnone %5, i16 signext %6, i16 signext %7) {
ret i64 %4
}
extern long double addf(float a, double b, long double c) { return a + b + c; }


x86 assembly (clang, -O0):
<addf>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
fldl   -0x28(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addf>:
fldt   0x8(%rsp)
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rsp)
faddl  -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @addf(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %5
%10 = fadd double %8, %9
%11 = fpext double %10 to x86_fp80
%12 = load x86_fp80, x86_fp80* %6
%13 = fadd x86_fp80 %11, %12
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @addf(float %0, double %1, x86_fp80 %2) {
%4 = fpext float %0 to double
%5 = fadd double %4, %1
%6 = fpext double %5 to x86_fp80
%7 = fadd x86_fp80 %6, %2
ret x86_fp80 %7
}
unsigned int small_enough(unsigned int *p) { return *(p + 0x100); }


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

x86 assembly (clang, -O2):
<small_enough>:
mov    0x400(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @small_enough(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 256
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @small_enough(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 256
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_PEEKTEXT;
unsigned long ptrace(int /*<<< orphan*/, int /*<<< orphan*/, void *,
                     int /*<<< orphan*/ *);
unsigned long proc_read_word(pid_t pid, void *addr) {
  return ptrace(PTRACE_PEEKTEXT, pid, addr, NULL);
}


x86 assembly (clang, -O0):
<proc_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_read_word>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_PEEKTEXT = global i32 0
define i64 @proc_read_word(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @PTRACE_PEEKTEXT
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i64 @ptrace(i32 %5, i32 %6, i8* %7, i32* null)
ret i64 %8
}

LLVM IR (-O2):
@PTRACE_PEEKTEXT = global i32 0
define i64 @proc_read_word(i32 %0, i8* %1) {
%3 = load i32, i32* @PTRACE_PEEKTEXT
%4 = tail call i64 @ptrace(i32 %3, i32 %0, i8* %1, i32* null)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ pal(char *);
int main() {
  char s[100];
  gets(s);
  pal(s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <gets@plt>
mov    %rbx,%rdi
call   1040 <pal@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @pal(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @pal(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[15];
  printf("Enter a word to check if it is a palindrome\n");
  scanf("%s", word);
  check(word, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x13(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x13(%rbp),%rdi
xor    %esi,%esi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0x1(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Enter a word to check if it is a palindrome\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = call i32 @check(i8* %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [44 x i8] c"Enter a word to check if it is a palindrome\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 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 = call i32 @check(i8* %2, i32 0)
ret i32 0
}
int test_03(int a) {
  if (127 <= a)
    a = 127;
  else if (a < -128)
    a = -128;
  return a;
}


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7f,%eax
cmp    -0x4(%rbp),%eax
jg     1121 <test_03+0x21>
movl   $0x7f,-0x4(%rbp)
jmp    1137 <test_03+0x37>
cmpl   $0xffffff80,-0x4(%rbp)
jge    1132 <test_03+0x32>
movl   $0xffffff80,-0x4(%rbp)
jmp    1137 <test_03+0x37>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
cmp    $0xffffff81,%edi
mov    $0xffffff80,%ecx
cmovge %edi,%ecx
cmp    $0x7f,%ecx
mov    $0x7f,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_03(i32 %0) {
%2 = icmp sgt i32 %0, -128
%3 = select i1 %2, i32 %0, i32 -128
%4 = icmp slt i32 %3, 127
%5 = select i1 %4, i32 %3, i32 127
ret i32 %5
}
void glVertexPointer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexPointer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ polindrome();
int main() {
  polindrome();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @polindrome()
ret i32 0
}
int test111(int param) {
  int a, b, c;
  if (param) {
    a = 3;
    b = 2;
  } else {
    a = 2;
    b = 3;
  }
  c = a + b;
  if (c != 5)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<test111>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1124 <test111+0x24>
movl   $0x3,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
jmp    1132 <test111+0x32>
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
je     1151 <test111+0x51>
movl   $0x2,-0x4(%rbp)
jmp    1158 <test111+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test111(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("I am a shared library!\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"I am a shared library!\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"I am a shared library!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_make_comment_entities();
void all_make_tests() { test_make_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_make_tests() {
%1 = tail call i32 (...) @test_make_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M997_f(char *s) {
  debug("M997_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exvwarning(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ sh_exit(int);
void sh_verrx(int status, const char *fmt, va_list ap) {
  exvwarning(-1, fmt, ap);
  sh_exit(status);
}


x86 assembly (clang, -O0):
<sh_verrx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0xffffffff,%edi
call   1030 <exvwarning@plt>
mov    -0x4(%rbp),%edi
call   1040 <sh_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_verrx>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffffff,%edi
call   1030 <exvwarning@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sh_exit@plt>

LLVM IR (-O0):
define void @sh_verrx(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @exvwarning(i32 -1, i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @sh_exit(i32 %10)
ret void
}

LLVM IR (-O2):
define void @sh_verrx(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @exvwarning(i32 -1, i8* %1, i32 %2)
%5 = tail call i32 @sh_exit(i32 %0)
ret void
}
/* Type definitions */
struct fio_mutex {
  int dummy;
};

/* Variables and functions */
struct fio_mutex *fio_mutex_init(int /*<<< orphan*/);
struct fio_mutex *fio_mutex_rw_init(void) {
  return fio_mutex_init(0);
}


x86 assembly (clang, -O0):
<fio_mutex_rw_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <fio_mutex_init@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fio_mutex = type { i32 }
define %struct.fio_mutex* @fio_mutex_rw_init() {
%1 = call %struct.fio_mutex* @fio_mutex_init(i32 0)
ret %struct.fio_mutex* %1
}

LLVM IR (-O2):
%struct.fio_mutex = type { i32 }
define %struct.fio_mutex* @fio_mutex_rw_init() {
%1 = tail call %struct.fio_mutex* @fio_mutex_init(i32 0)
ret %struct.fio_mutex* %1
}
extern __attribute__((simd("inbranch"))) int simd_attr2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @simd_attr2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XScreenResourceString() {
  printf("XScreenResourceString called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"XScreenResourceString called\0A\00"
define i32 @XScreenResourceString() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"XScreenResourceString called\00"
define i32 @XScreenResourceString() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int, int, int, int);
int test_callfunc8v(char *dest, int n_args, int a1, int a2, int a3, int a4,
                    int a5, int a6, ...) {
  sprintf(dest, "%d %d %d %d %d %d %d", n_args, a1, a2, a3, a4, a5, a6);
  return n_args;
}


x86 assembly (clang, -O0):
<test_callfunc8v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%esi
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%r11d
mov    %rsp,%rax
mov    %r11d,0x10(%rax)
mov    %r10d,0x8(%rax)
mov    %esi,(%rax)
lea    0xe9c(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_callfunc8v>:
push   %rbx
mov    %r9d,%eax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
sub    $0x8,%rsp
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
push   %r11
push   %r10
push   %rax
call   1030 <sprintf@plt>
add    $0x20,%rsp
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%d %d %d %d %d %d %d\00"
define i32 @test_callfunc8v(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, ...) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %10
ret i32 %26
}

LLVM IR (-O2):
@.str = [21 x i8] c"%d %d %d %d %d %d %d\00"
define i32 @test_callfunc8v(i8* nocapture writeonly %0, i32 returned %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, ...) {
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
ret i32 %1
}
void handle_TTIN(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_TTIN(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ errno;
int fsync(int fd) {
  errno = 0;
  return 0;
}


x86 assembly (clang, -O0):
<fsync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync>:
mov    0x2ed9(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i32 @fsync(i32 %0) {
store i64 0, i64* @errno
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar_unlocked(char);
void printNewLine() { putchar_unlocked('\n'); }


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

x86 assembly (clang, -O2):
<printNewLine>:
mov    $0xa,%edi
jmp    1030 <putchar_unlocked@plt>

LLVM IR (-O0):
define void @printNewLine() {
%1 = call i32 @putchar_unlocked(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @printNewLine() {
%1 = tail call i32 @putchar_unlocked(i8 signext 10)
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void pbst_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<pbst_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <pbst_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbst_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @pbst_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @pbst_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
int bf_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c = c - 'A' + 'a';
  return c;
}


x86 assembly (clang, -O0):
<bf_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1127 <bf_tolower+0x27>
cmpl   $0x5a,-0x4(%rbp)
jg     1127 <bf_tolower+0x27>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @bf_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %5, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @bf_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int snd_hda_hwdep_add_power_sysfs(struct hda_codec *codec) { return 0; }


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

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

LLVM IR (-O0):
%struct.hda_codec = type opaque
define i32 @snd_hda_hwdep_add_power_sysfs(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
ret i32 0
}

LLVM IR (-O2):
%struct.hda_codec = type opaque
define i32 @snd_hda_hwdep_add_power_sysfs(%struct.hda_codec* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void panic(const char *message) {
  fprintf(stderr, "PANIC: %s\n", message);
  exit(2);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"PANIC: %s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int sign_extend(int value, int source_nu_bits, int target_nu_bits) {
  uint32_t sign_bit = value & (1 << (source_nu_bits - 1));
  if (!sign_bit)
    return value;
  uint32_t sign_extend_bits = 0xFFFFFFFF ^ ((1 << source_nu_bits) - 1);
  sign_extend_bits &= ((uint64_t)1 << target_nu_bits) - 1;
  return value | sign_extend_bits;
}


x86 assembly (clang, -O0):
<sign_extend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1139 <sign_extend+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <sign_extend+0x6a>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend>:
mov    %edi,%eax
lea    -0x1(%rsi),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jae    1120 <sign_extend+0x20>
mov    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
not    %edi
mov    %esi,%ecx
shr    %cl,%edi
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign_extend(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = shl i32 1, %12
%14 = and i32 %10, %13
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %3
%18 = load i32, i32* %5
store i32 %18, i32* %4
br label %32
19: ; preds = %3
%20 = load i32, i32* %6
%21 = shl i32 1, %20
%22 = sub nsw i32 %21, 1
%23 = xor i32 -1, %22
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = shl i32 1, %24
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %9
%28 = and i32 %27, %26
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = or i32 %29, %30
store i32 %31, i32* %4
br label %32
32: ; preds = %19, %17
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @sign_extend(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %0
%7 = icmp eq i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %3
%9 = shl nsw i32 -1, %1
%10 = shl nsw i32 -1, %2
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = or i32 %12, %0
br label %14
14: ; preds = %3, %8
%15 = phi i32 [ %13, %8 ], [ %0, %3 ]
ret i32 %15
}
/* Variables and functions */
int klog(char);
int /*<<< orphan*/ strcat(char, char);
int logwarn(char *warning) {
  char *warn = "Warning! : ";
  strcat(*warn, *warning);
  int ret = klog(*warn);
  return (ret);
}


x86 assembly (clang, -O0):
<logwarn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
movsbl %cl,%edi
movsbl (%rax),%esi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <klog@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logwarn>:
push   %rax
movsbl (%rdi),%esi
mov    $0x57,%edi
call   1040 <strcat@plt>
mov    $0x57,%edi
pop    %rax
jmp    1030 <klog@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Warning! : \00"
define i32 @logwarn(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = call i32 @strcat(i8 signext %6, i8 signext %8)
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @klog(i8 signext %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @logwarn(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @strcat(i8 signext 87, i8 signext %2)
%4 = tail call i32 @klog(i8 signext 87)
ret i32 %4
}
void slash2backslash(const char *in_str, char *out_str) {
  const char *r;
  char *w;
  for (r = in_str, w = out_str; *r != 0; r++, w++)
    if (*r == '/')
      *w = '\\';
    else
      *w = *r;
  *w = 0;
}


x86 assembly (clang, -O0):
<slash2backslash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <slash2backslash+0x76>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1148 <slash2backslash+0x48>
mov    -0x20(%rbp),%rax
movb   $0x5c,(%rax)
jmp    1154 <slash2backslash+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    1159 <slash2backslash+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <slash2backslash+0x1c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<slash2backslash>:
xor    %eax,%eax
jmp    1117 <slash2backslash+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %dl,(%rsi,%rax,1)
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
mov    $0x5c,%dl
cmp    $0x2f,%cl
je     1110 <slash2backslash+0x10>
test   %cl,%cl
je     112a <slash2backslash+0x2a>
mov    %ecx,%edx
jmp    1110 <slash2backslash+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @slash2backslash(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %10, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %12
i8 47, label %8
]
7: ; preds = %3
br label %8
8: ; preds = %3, %7
%9 = phi i8 [ %6, %7 ], [ 92, %3 ]
store i8 %9, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
12: ; preds = %3
store i8 0, i8* %5
ret void
}
int vp3054_i2c_probe(struct cx8802_dev *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.cx8802_dev = type opaque
define i32 @vp3054_i2c_probe(%struct.cx8802_dev* %0) {
%2 = alloca %struct.cx8802_dev*
store %struct.cx8802_dev* %0, %struct.cx8802_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.cx8802_dev = type opaque
define i32 @vp3054_i2c_probe(%struct.cx8802_dev* nocapture readnone %0) {
ret i32 0
}