xunge/DecIR huggingface dataset:
unsigned short read16u(const unsigned char *s, int bigendian) {
  if (bigendian) {
    return (s[1] << 8) + s[0];
  } else {
    return (s[0] << 8) + s[1];
  }
}


x86 assembly (clang, -O0):
<read16u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1132 <read16u+0x32>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
jmp    114a <read16u+0x4a>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16u>:
xor    %eax,%eax
xor    %ecx,%ecx
test   %esi,%esi
setne  %al
sete   %cl
movzbl (%rdi,%rax,1),%edx
shl    $0x8,%edx
movzbl (%rdi,%rcx,1),%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @read16u(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = select i1 %3, i8* %4, i8* %0
%6 = select i1 %3, i8* %0, i8* %4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = shl nuw i16 %8, 8
%10 = load i8, i8* %5
%11 = zext i8 %10 to i16
%12 = or i16 %9, %11
ret i16 %12
}
const char *skip(const char *in) {
  while (in && (unsigned char)*in <= 32) {
    in++;
  }
  return in;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <skip+0x28>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1138 <skip+0x38>
jmp    1149 <skip+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
test   %rdi,%rdi
je     111e <skip+0x1e>
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
lea    0x1(%rdi),%rax
cmpb   $0x21,0x1(%rdi)
mov    %rax,%rdi
jb     1110 <skip+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @skip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %13, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 32
br label %11
11: ; preds = %6, %3
%12 = phi i1 [ false, %3 ], [ %10, %6 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %11
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @skip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp ult i8 %5, 33
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fatal(char *);
int *ivector(int n) {
  int *v;
  v = (int *)calloc(n, sizeof(int));
  if (!v)
    fatal("allocation failure in ivector()\n");
  return v;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <ivector+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbx
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <ivector+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in ivector()\0A\00"
define i32* @ivector(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in ivector()\0A\00"
define i32* @ivector(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i32*
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_emptyFbuffer();
void empty_fbuffer(void) { twoDsim_emptyFbuffer(); }


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

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

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

LLVM IR (-O2):
define void @empty_fbuffer() {
%1 = tail call i32 (...) @twoDsim_emptyFbuffer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  int j;
  j = 1;
  while (j < argc) {
    ft_putstr(argv[j]);
    ft_putchar('\n');
    j++;
  }
  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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     115c <main+0x3c>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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 1, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @ft_putstr(i8* %16)
%18 = call i32 @ft_putchar(i8 signext 10)
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
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 [ 1, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @ft_putstr(i8* %9)
%11 = tail call i32 @ft_putchar(i8 signext 10)
%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
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char inputs[1];
  system("java -version");
  scanf("%s", inputs);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
lea    0xeda(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"java -version\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8]
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1 x i8], [1 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)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"java -version\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 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)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x86() {
  Assert_real((isupper(134) == 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_isupper.c",
              675, ("isupper should be 0 for 0x86"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x86>:
push   %rax
mov    $0x86,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a3,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x86\00"
define void @t_isupper_0x86() {
%1 = call i64 @isupper(i32 134)
%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 675, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x86\00"
define void @t_isupper_0x86() {
%1 = tail call i64 @isupper(i32 134)
%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 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int dquot_disable(struct super_block *sb, int type, unsigned int flags) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @dquot_disable(%struct.super_block* %0, i32 %1, i32 %2) {
%4 = alloca %struct.super_block*
%5 = alloca i32
%6 = alloca i32
store %struct.super_block* %0, %struct.super_block** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @dquot_disable(%struct.super_block* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
double deg2rad(double deg) { return (double)(deg * (3.14159265359 / 180.0)); }


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

x86 assembly (clang, -O2):
<deg2rad>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @deg2rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529E84
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double, char const *);
char *time_units(double *);
void time_str(int buflen, char *buf, double secs) {
  const char *suffix;
  suffix = time_units(&secs);
  snprintf(buf, buflen, "%.2f%s", secs, suffix);
}


x86 assembly (clang, -O0):
<time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <time_units@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rcx
lea    0xea8(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <time_units@plt>
movsd  (%rsp),%xmm0
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.2f%s\00"
define void @time_str(i32 %0, i8* %1, double %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = call i8* @time_units(double* %6)
store i8* %8, i8** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = load double, double* %6
%12 = load i8*, i8** %7
%13 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.2f%s\00"
define void @time_str(i32 %0, i8* %1, double %2) {
%4 = alloca double
store double %2, double* %4
%5 = call i8* @time_units(double* %4)
%6 = load double, double* %4
%7 = call i32 @snprintf(i8* %1, i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %6, i8* %5)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int *, int *);
int /*<<< orphan*/ stderr;
int64_t fact(int n) {
  int one = 1;
  fprintf(stderr, "--fact arg: %p stackvar: %p\n", &n, &one);
  if (n == 1) {
    return 1;
  }
  return n * fact(n - 1);
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <fprintf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1165 <fact+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1181 <fact+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fact@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <fprintf@plt>
mov    0x8(%rsp),%ebx
mov    $0x1,%eax
cmp    $0x1,%ebx
je     1169 <fact+0x49>
lea    -0x1(%rbx),%edi
call   1040 <fact@plt>
imul   %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"--fact arg: %p stackvar: %p\0A\00"
define i32 @fact(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %16
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @fact(i32 %13)
%15 = mul nsw i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"--fact arg: %p stackvar: %p\0A\00"
define i32 @fact(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = add nsw i32 %7, -1
%11 = call i32 @fact(i32 %10)
%12 = mul nsw i32 %11, %7
br label %13
13: ; preds = %1, %9
%14 = phi i32 [ %12, %9 ], [ 1, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void quit(char mes[]) {
  puts(mes);
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf2(char *, char *);
void GenPrintLabel(char *Label) {
  {
    if (isdigit(*Label))
      printf2(".L%s", Label);
    else
      printf2("._%s", Label);
  }
}


x86 assembly (clang, -O0):
<GenPrintLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     1157 <GenPrintLabel+0x37>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf2@plt>
jmp    1167 <GenPrintLabel+0x47>
mov    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenPrintLabel>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
lea    0xecf(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf2@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".L%s\00"
@.str.1 = [5 x i8] c"._%s\00"
define void @GenPrintLabel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @printf2(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".L%s\00"
@.str.1 = [5 x i8] c"._%s\00"
define void @GenPrintLabel(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf2(i8* %5, i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  int member_0;
  int member_1;
};
struct TYPE_5__ {
  int member_0;
  int member_1;
};
struct TYPE_4__ {
  int member_0;
  int member_1;
};

/* Variables and functions */
int /*<<< orphan*/ printid(int ***);
void main() {
  int A[2][3][2] = {{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}, {11, 12}}};
  printid(A);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <printid@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <printid@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [2 x [3 x [2 x i32]]] [[3 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6]], [3 x [2 x i32]] [[2 x i32] [i32 7, i32 8], [2 x i32] [i32 9, i32 10], [2 x i32] [i32 11, i32 12]]]
define void @main() {
%1 = alloca [2 x [3 x [2 x i32]]]
%2 = bitcast [2 x [3 x [2 x i32]]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %1, i64 0, i64 0
%4 = bitcast [3 x [2 x i32]]* %3 to i32***
%5 = call i32 @printid(i32*** %4)
ret void
}

LLVM IR (-O2):
@__const.main.A = [2 x [3 x [2 x i32]]] [[3 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6]], [3 x [2 x i32]] [[2 x i32] [i32 7, i32 8], [2 x i32] [i32 9, i32 10], [2 x i32] [i32 11, i32 12]]]
define void @main() {
%1 = alloca [2 x [3 x [2 x i32]]]
%2 = bitcast [2 x [3 x [2 x i32]]]* %1 to i8*
%3 = bitcast [2 x [3 x [2 x i32]]]* %1 to i32***
%4 = call i32 @printid(i32*** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void *print_it(void *data) {
  printf("Hello from %s!\n", (const char *)data);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from %s!\0A\00"
define i8* @print_it(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from %s!\0A\00"
define noalias i8* @print_it(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int i = 10;
  int *x = (int *)malloc(i * sizeof(int));
  while (i--) {
    ++x;
    *x = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1168 <main+0x58>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1139 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1030 <malloc@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x4(%rax)
movups %xmm0,0x14(%rax)
movq   $0x0,0x24(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
br label %10
10: ; preds = %14, %0
%11 = load i32, i32* %2
%12 = add nsw i32 %11, -1
store i32 %12, i32* %2
%13 = icmp ne i32 %11, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %3
%17 = load i32*, i32** %3
store i32 0, i32* %17
br label %10
18: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40)
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr i32, i32* %2, i64 1
%4 = bitcast i32* %3 to i8*
ret i32 0
}
void ff_hevc_put_hevc_bi_w_qpel_v32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v32_12_sse4() {
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSSDT(const char *the_title) { return any_decrqss(the_title, "$~"); }


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

x86 assembly (clang, -O2):
<rpt_DECSSDT>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"$~\00"
define i32 @rpt_DECSSDT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"$~\00"
define i32 @rpt_DECSSDT(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*((volatile unsigned long *)0x7E00F120)) &= ~(1 << 1);
  (*((volatile unsigned long *)0x70200000)) &=
      ~((1 << 30) | (7 << 12) | (7 << 8) | (7 << 4));
  (*((volatile unsigned long *)0x70200000)) |=
      ((0 << 12) | (3 << 8) | (1 << 4));
  (*((volatile unsigned long *)0x70200004)) |= 1;
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00f120,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x7e00f120,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
and    $0xffffffffbfff888f,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
or     $0x310,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
andq   $0xfffffffffffffffd,0x7e00f120
7e fd
andq   $0xffffffffbfff888f,0x70200000
70 8f 88 ff bf
orq    $0x310,0x70200000
orq    $0x1,0x70200004
70 01
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 784
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 784
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = tail call i32 (...) @nand_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetWireToEvent() {
  printf("XESetWireToEvent called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"XESetWireToEvent called\00"
define i32 @XESetWireToEvent() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *SCE_Mem_LocateAllocFromPointer(void *);
int SCE_Mem_IsValid(void *p) {
  return (SCE_Mem_LocateAllocFromPointer(p) != NULL);
}


x86 assembly (clang, -O0):
<SCE_Mem_IsValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SCE_Mem_LocateAllocFromPointer@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_Mem_IsValid>:
push   %rax
call   1030 <SCE_Mem_LocateAllocFromPointer@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SCE_Mem_IsValid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @SCE_Mem_LocateAllocFromPointer(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @SCE_Mem_IsValid(i8* %0) {
%2 = tail call i32* @SCE_Mem_LocateAllocFromPointer(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ function_with_leak3(int);
void use_function_with_leak3(int y) { function_with_leak3(y); }


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

x86 assembly (clang, -O2):
<use_function_with_leak3>:
jmp    1030 <function_with_leak3@plt>

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

LLVM IR (-O2):
define void @use_function_with_leak3(i32 %0) {
%2 = tail call i32 @function_with_leak3(i32 %0)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void PWMSyncUpdate(uint32_t ui32Base, uint32_t ui32GenBits) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000000))) = ui32GenBits;
}


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

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

LLVM IR (-O0):
define void @PWMSyncUpdate(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @PWMSyncUpdate(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
void cl_rhash_table_debug_entry(struct cl_rhash_table *tbl, const char *prefix,
                                void **ent) {}


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

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

LLVM IR (-O0):
%struct.cl_rhash_table = type opaque
define void @cl_rhash_table_debug_entry(%struct.cl_rhash_table* %0, i8* %1, i8** %2) {
%4 = alloca %struct.cl_rhash_table*
%5 = alloca i8*
%6 = alloca i8**
store %struct.cl_rhash_table* %0, %struct.cl_rhash_table** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
%struct.cl_rhash_table = type opaque
define void @cl_rhash_table_debug_entry(%struct.cl_rhash_table* nocapture %0, i8* nocapture %1, i8** nocapture %2) {
ret void
}
unsigned int atomic_load_u32(unsigned int *p) {
  return __atomic_load_n((p), 0);
}


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

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

LLVM IR (-O0):
define i32 @atomic_load_u32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load atomic i32, i32* %4 monotonic
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @atomic_load_u32(i32* nocapture %0) {
%2 = load atomic i32, i32* %0 monotonic
ret i32 %2
}
void foo035(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo035(i32 %0) {
ret void
}
int intEqual(int left, int right) {
  if (left == right)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<intEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <intEqual+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1129 <intEqual+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intEqual>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @intEqual(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ kill_this_task();
void disarm(void) {
  debug("but disarmed.");
  kill_this_task();
}


x86 assembly (clang, -O0):
<disarm>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <debug@plt>
mov    $0x0,%al
call   1030 <kill_this_task@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disarm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kill_this_task@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"but disarmed.\00"
define void @disarm() {
%1 = call i32 @debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @kill_this_task()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"but disarmed.\00"
define void @disarm() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @kill_this_task()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void glmGenerateZeroMatrix2f(float m[4]) { memset(m, 0, 4 * sizeof(float)); }


x86 assembly (clang, -O0):
<glmGenerateZeroMatrix2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateZeroMatrix2f>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @glmGenerateZeroMatrix2f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 16)
ret void
}

LLVM IR (-O2):
define void @glmGenerateZeroMatrix2f(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doSleep(int);
int get_a(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a = get_a(argc);
  printf("%i\n", a);
  while (1) {
    printf("%i\n", a);
    doSleep(1);
    a += 1;
  }
}


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)
mov    -0x8(%rbp),%edi
call   1040 <get_a@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <doSleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
jmp    1160 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
call   1040 <get_a@plt>
mov    %eax,%ebx
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <doSleep@plt>
add    $0x1,%ebx
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\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
%7 = load i32, i32* %4
%8 = call i32 @get_a(i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %2, %11
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @doSleep(i32 1)
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
br label %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @get_a(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %3, %2 ], [ %9, %5 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @doSleep(i32 1)
%9 = add nsw i32 %6, 1
br label %5
}
float fmodf(float x, float y) {
  float res = 0.0F;
  asm volatile("1:\tfprem\n\t"
               "fstsw   %%ax\n\t"
               "sahf\n\t"
               "jp      1b\n\t"
               "fstp    %%st(1)"
               : "=t"(res)
               : "0"(x), "u"(y)
               : "ax", "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     1132 <fmodf+0x32>
fstp   %st(1)
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
movss  %xmm0,-0x4(%rsp)
movss  %xmm1,-0x8(%rsp)
flds   -0x4(%rsp)
flds   -0x8(%rsp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     1116 <fmodf+0x16>
fstp   %st(1)
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float asm sideeffect "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call float asm sideeffect "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %0, float %1)
ret float %3
}
/* Variables and functions */
char *getSingleLevelBasenameExt(int, char *);
char *getSingleLevelBasename(int nr) {
  return getSingleLevelBasenameExt(nr, "level");
}


x86 assembly (clang, -O0):
<getSingleLevelBasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <getSingleLevelBasenameExt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSingleLevelBasename>:
lea    0xee9(%rip),%rsi
jmp    1030 <getSingleLevelBasenameExt@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"level\00"
define i8* @getSingleLevelBasename(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @getSingleLevelBasenameExt(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"level\00"
define i8* @getSingleLevelBasename(i32 %0) {
%2 = tail call i8* @getSingleLevelBasenameExt(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void port_sl_in(unsigned short port, void *buf, unsigned int nr) {
  __asm__("cld;rep;insl\n\t" ::"d"(port), "D"(buf), "c"(nr));
}


x86 assembly (clang, -O0):
<port_sl_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
rep insl (%dx),%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_sl_in>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @port_sl_in(i16 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @port_sl_in(i16 zeroext %0, i8* %1, i32 %2) {
tail call void asm sideeffect "cld;rep;insl\0A\09", "{dx},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 1;
  int b = 9;
  int c = 0;
  c = a;
  a = b;
  b = c;
  printf("a = %d, b = %d\n", a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 9, i32 1)
ret i32 0
}
void check_events(void) {}


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

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

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

LLVM IR (-O2):
define void @check_events() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void csapp_pthread_exit(void *retval) { pthread_exit(retval); }


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

x86 assembly (clang, -O2):
<csapp_pthread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @csapp_pthread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeFile(FILE **fp) {
  if (*fp != NULL) {
    fclose(*fp);
    *fp = NULL;
  } else {
  }
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1146 <closeFile+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    114b <closeFile+0x3b>
jmp    114b <closeFile+0x3b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <closeFile+0x18>
call   1030 <fclose@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @closeFile(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = call i32 @fclose(i32* %8)
%10 = load i32**, i32*** %2
store i32* null, i32** %10
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
define void @closeFile(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
store i32* null, i32** %0
br label %6
6: ; preds = %1, %4
ret void
}