xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void sensors_default_parse_error(const char *err, int lineno) {
  if (lineno)
    fprintf(stderr, "Error: Line %d: %s\n", lineno, err);
  else
    fprintf(stderr, "Error: %s\n", err);
}


x86 assembly (clang, -O0):
<sensors_default_parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <sensors_default_parse_error+0x3c>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1167 <sensors_default_parse_error+0x57>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sensors_default_parse_error>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
test   %esi,%esi
je     1130 <sensors_default_parse_error+0x20>
mov    %esi,%edx
lea    0xed7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
lea    0xedd(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Error: Line %d: %s\0A\00"
@.str.1 = [11 x i8] c"Error: %s\0A\00"
define void @sensors_default_parse_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
br label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Error: Line %d: %s\0A\00"
@.str.1 = [11 x i8] c"Error: %s\0A\00"
define void @sensors_default_parse_error(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stderr
br i1 %3, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
double floor(double);
double tam_sayiya_yuvarla(double girilen_sayi) {
  double yuvarlanan_sayi;
  yuvarlanan_sayi = floor(girilen_sayi + .5);
  return yuvarlanan_sayi;
}


x86 assembly (clang, -O0):
<tam_sayiya_yuvarla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tam_sayiya_yuvarla>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @tam_sayiya_yuvarla(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = call double @llvm.floor.f64(double %5)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @tam_sayiya_yuvarla(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
void reverse_ivector(int *v, unsigned int n) {
  int swap;
  for (int a = 0; a < --n; a++) {
    swap = v[a];
    v[a] = v[n];
    v[n] = swap;
  }
}


x86 assembly (clang, -O0):
<reverse_ivector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
jae    1164 <reverse_ivector+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <reverse_ivector+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_ivector>:
add    $0xffffffff,%esi
je     112d <reverse_ivector+0x2d>
mov    %esi,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
nopl   (%rax)
mov    (%rdi,%rcx,4),%edx
mov    0x4(%rdi,%rax,4),%esi
mov    %esi,(%rdi,%rcx,4)
mov    %edx,0x4(%rdi,%rax,4)
add    $0x1,%rcx
mov    %eax,%edx
add    $0xffffffffffffffff,%rax
cmp    %rdx,%rcx
jb     1110 <reverse_ivector+0x10>
ret

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

LLVM IR (-O2):
define void @reverse_ivector(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
store i32 %14, i32* %11
store i32 %12, i32* %13
%15 = add nuw nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = and i64 %16, 4294967295
%18 = icmp ult i64 %15, %17
br i1 %18, label %8, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 0;
  printf("%d\n", sizeof(x));
}


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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
long long ssss() { return 0xffffffffffffffffLL; }


x86 assembly (clang, -O0):
<ssss>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssss>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @ssss() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @ssss() {
ret i64 -1
}
t(unsigned int a, unsigned int b) { return (a <= b ? 5 : -5); }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0xfffffffb,%eax
mov    $0x5,%ecx
cmp    %esi,%edx
cmovbe %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
cmp    %esi,%edi
mov    $0xfffffffb,%ecx
mov    $0x5,%eax
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ule i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 5, i32 -5
ret i32 %9
}

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 -5, i32 5
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void nil_icub(int nx, int ny, int nz, int ***p) {
  memset(**p, 0, sizeof(int) * nx * ny * nz);
}


x86 assembly (clang, -O0):
<nil_icub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
movslq -0xc(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nil_icub>:
mov    (%rcx),%rax
mov    (%rax),%rax
imul   %esi,%edi
imul   %edi,%edx
shl    $0x2,%edx
mov    %rax,%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nil_icub(i32 %0, i32 %1, i32 %2, i32*** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32***
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32*** %3, i32**** %8
%9 = load i32***, i32**** %8
%10 = load i32**, i32*** %9
%11 = load i32*, i32** %10
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = mul i64 4, %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = mul i64 %14, %16
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = mul i64 %17, %19
%21 = trunc i64 %20 to i32
%22 = call i32 @memset(i32* %11, i32 0, i32 %21)
ret void
}

LLVM IR (-O2):
define void @nil_icub(i32 %0, i32 %1, i32 %2, i32*** nocapture %3) {
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
%7 = shl i32 %0, 2
%8 = mul i32 %7, %1
%9 = mul i32 %8, %2
%10 = tail call i32 @memset(i32* %6, i32 0, i32 %9)
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/assert.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/assert.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/assert.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
scalar_t__ getSeparator(char *);
void getDirName(char *szFilename) {
  char *pSeparator = (char *)getSeparator(szFilename);
  if (pSeparator) {
    *pSeparator = '\0';
  }
}


x86 assembly (clang, -O0):
<getDirName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getSeparator@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <getDirName+0x2b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDirName>:
push   %rax
call   1030 <getSeparator@plt>
test   %rax,%rax
je     111e <getDirName+0xe>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @getDirName(i8* %0) {
%2 = tail call i64 @getSeparator(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
store i8 0, i8* %5
br label %6
6: ; preds = %4, %1
ret void
}
int main(int argc, char *argv[]) {
  int a;
  char *names[] = {"josh", "phil"};
  printf("address for a in memory: %d\n", &a);
  printf("address for names: %d", &names);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2ce7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xece(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"josh\00"
@.str.1 = [5 x i8] c"phil\00"
@__const.main.names = [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [29 x i8] c"address for a in memory: %d\0A\00"
@.str.3 = [22 x i8] c"address for names: %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [2 x i8*]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), [2 x i8*]* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"josh\00"
@.str.1 = [5 x i8] c"phil\00"
@__const.main.names = [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [29 x i8] c"address for a in memory: %d\0A\00"
@.str.3 = [22 x i8] c"address for names: %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [2 x i8*]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [2 x i8*]* %4 to i8*
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), [2 x i8*]* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REVOKED;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_REVOKED_it;
int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REVOKED_it);
}


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

x86 assembly (clang, -O2):
<i2d_X509_REVOKED>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_REVOKED_it = global i32 0
define i32 @i2d_X509_REVOKED(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_REVOKED_it)
ret i32 %3
}
void setsocket(short newsocket) {}


x86 assembly (clang, -O0):
<setsocket>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @setsocket(i16 signext %0) {
ret void
}
void yydestruct(const char *yymsg, int yytype, const char **yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;
  switch (yytype) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <yydestruct+0x2a>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, i8** nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ _send_to_socket(int, void *, int);
int64_t _send_msg(int s, void *data, int64_t length) {
  _send_to_socket(s, &length, sizeof(int64_t));
  return _send_to_socket(s, data, length);
}


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

x86 assembly (clang, -O2):
<_send_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <_send_to_socket@plt>
mov    0x4(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <_send_to_socket@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_send_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = bitcast i32* %6 to i8*
%9 = call i32 @_send_to_socket(i32 %7, i8* %8, i32 4)
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @_send_to_socket(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @_send_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = call i32 @_send_to_socket(i32 %0, i8* %5, i32 4)
%7 = load i32, i32* %4
%8 = call i32 @_send_to_socket(i32 %0, i8* %1, i32 %7)
ret i32 %8
}
int numbergen() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numbergen() {
ret i32 0
}
double SFMKTSToMPH(double kts) { return (kts * 1.15151515); }


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

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

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

LLVM IR (-O2):
define double @SFMKTSToMPH(double %0) {
%2 = fmul double %0, 0x3FF26C9B26619399
ret double %2
}
/* Variables and functions */
double floor(double);
__attribute__((visibility("hidden"))) double conv_double_to_int_safe(double x) {
  return floor(x + 0.5);
}


x86 assembly (clang, -O0):
<conv_double_to_int_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_double_to_int_safe>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define hidden double @conv_double_to_int_safe(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define hidden double @conv_double_to_int_safe(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
void I2CIdleModeSelect(unsigned int baseAdd, unsigned int flag) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~((0x00000018u));
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= flag;
}


x86 assembly (clang, -O0):
<I2CIdleModeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffe7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CIdleModeSelect>:
add    $0x10,%edi
andl   $0xffffffe7,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CIdleModeSelect(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 16
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -25
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 16
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @I2CIdleModeSelect(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -25
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[10000];
  while (gets(str)) {
    printf("%s\n", str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
call   1040 <gets@plt>
cmp    $0x0,%rax
je     1160 <main+0x40>
lea    -0x2720(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1168 <main+0x48>
lea    0xec2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%5 = call i64 @gets(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i64 @gets(i8* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret i32 0
}
void RTStrmOpen(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmOpen() {
ret void
}
/* Type definitions */
struct notifier_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcipcwd_stop();
int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code,
                       void *unused) {
  {
    if (code == 1UL) {
      pcipcwd_stop();
    } else if (code == 2UL) {
      pcipcwd_stop();
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<pcipcwd_notify_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    113b <pcipcwd_notify_sys+0x2b>
mov    $0x0,%al
call   1030 <pcipcwd_stop@plt>
jmp    1152 <pcipcwd_notify_sys+0x42>
cmpq   $0x2,-0x10(%rbp)
jne    114d <pcipcwd_notify_sys+0x3d>
mov    $0x0,%al
call   1030 <pcipcwd_stop@plt>
jmp    1152 <pcipcwd_notify_sys+0x42>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcipcwd_notify_sys>:
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1126 <pcipcwd_notify_sys+0x16>
push   %rax
xor    %eax,%eax
call   1030 <pcipcwd_stop@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.notifier_block = type { i32 }
define i32 @pcipcwd_notify_sys(%struct.notifier_block* %0, i64 %1, i8* %2) {
%4 = alloca %struct.notifier_block*
%5 = alloca i64
%6 = alloca i8*
store %struct.notifier_block* %0, %struct.notifier_block** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @pcipcwd_stop()
br label %17
11: ; preds = %3
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @pcipcwd_stop()
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %9
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type { i32 }
define i32 @pcipcwd_notify_sys(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = add i64 %1, -1
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @pcipcwd_stop()
br label %8
8: ; preds = %3, %6
ret i32 0
}
/* Variables and functions */
char *c_malloc(int);
int /*<<< orphan*/ init(char *);
char *malloc(int);
int main() {
  char *p, *q;
  init(p);
  q = malloc(42);
  p = c_malloc(42);
  p[0] = '\n';
  q[0] = '\n';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1040 <init@plt>
mov    $0x2a,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x2a,%edi
call   1030 <c_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init@plt>
mov    $0x2a,%edi
call   1030 <c_malloc@plt>
movb   $0xa,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = call i32 @init(i8* %3)
%5 = call i8* @malloc(i32 42)
store i8* %5, i8** %2
%6 = call i8* @c_malloc(i32 42)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 10, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 10, i8* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init(i8* undef)
%2 = tail call i8* @c_malloc(i32 42)
store i8 10, i8* %2
ret i32 0
}
void cable_set_uart_switch(int path) { return; }


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

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

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

LLVM IR (-O2):
define void @cable_set_uart_switch(i32 %0) {
ret void
}
__attribute__((always_)) int pci_get_legacy_ide_irq(struct pci_dev *dev,
                                                    int channel) {
  return channel ? 15 : 14;
}


x86 assembly (clang, -O0):
<pci_get_legacy_ide_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xe,%eax
mov    $0xf,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_get_legacy_ide_irq>:
cmp    $0x1,%esi
mov    $0xf,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_get_legacy_ide_irq(%struct.pci_dev* %0, i32 %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 15, i32 14
ret i32 %8
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_get_legacy_ide_irq(%struct.pci_dev* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 14, i32 15
ret i32 %4
}
/* Type definitions */
struct time {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strptime(char *, char *, struct time *);
void time_init_str(struct time *t, char *str, char *fmt) {
  strptime(str, fmt, t);
}


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

x86 assembly (clang, -O2):
<time_init_str>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <strptime@plt>

LLVM IR (-O0):
%struct.time = type { i32 }
define void @time_init_str(%struct.time* %0, i8* %1, i8* %2) {
%4 = alloca %struct.time*
%5 = alloca i8*
%6 = alloca i8*
store %struct.time* %0, %struct.time** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = load %struct.time*, %struct.time** %4
%10 = call i32 @strptime(i8* %7, i8* %8, %struct.time* %9)
ret void
}

LLVM IR (-O2):
%struct.time = type { i32 }
define void @time_init_str(%struct.time* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strptime(i8* %1, i8* %2, %struct.time* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_sockinfo(int, char **, int *);
char *get_sockaddr(int sock) {
  char *addr;
  int port;
  get_sockinfo(sock, &addr, &port);
  return addr;
}


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

x86 assembly (clang, -O2):
<get_sockaddr>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
call   1030 <get_sockinfo@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i8* @get_sockaddr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = bitcast i8** %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @get_sockinfo(i32 %0, i8** %2, i32* %3)
%7 = load i8*, i8** %2
ret i8* %7
}
void gtk_dialog_run() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dialog_run() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_cui_mouse_reset_handler_tab();
int /*<<< orphan*/ draw_all_mbr_stat();
int /*<<< orphan*/ draw_stat_bar();
int /*<<< orphan*/ redraw_map();
int /*<<< orphan*/ redraw_msg();
int /*<<< orphan*/ set_cui_mouse_add_handler_map();
int /*<<< orphan*/ set_cui_mouse_add_handler_msg();
int /*<<< orphan*/ set_cui_mouse_add_handler_stat();
int /*<<< orphan*/ wipe_all();
void redraw_all(void) {
  wipe_all();
  redraw_map();
  draw_all_mbr_stat();
  redraw_msg();
  draw_stat_bar();
  call_cui_mouse_reset_handler_tab();
  set_cui_mouse_add_handler_map();
  set_cui_mouse_add_handler_msg();
  set_cui_mouse_add_handler_stat();
}


x86 assembly (clang, -O0):
<redraw_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wipe_all@plt>
mov    $0x0,%al
call   10b0 <redraw_map@plt>
mov    $0x0,%al
call   1040 <draw_all_mbr_stat@plt>
mov    $0x0,%al
call   1090 <redraw_msg@plt>
mov    $0x0,%al
call   1050 <draw_stat_bar@plt>
mov    $0x0,%al
call   1060 <call_cui_mouse_reset_handler_tab@plt>
mov    $0x0,%al
call   1080 <set_cui_mouse_add_handler_map@plt>
mov    $0x0,%al
call   10a0 <set_cui_mouse_add_handler_msg@plt>
mov    $0x0,%al
call   1070 <set_cui_mouse_add_handler_stat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_all>:
push   %rax
xor    %eax,%eax
call   1030 <wipe_all@plt>
xor    %eax,%eax
call   10b0 <redraw_map@plt>
xor    %eax,%eax
call   1040 <draw_all_mbr_stat@plt>
xor    %eax,%eax
call   1090 <redraw_msg@plt>
xor    %eax,%eax
call   1050 <draw_stat_bar@plt>
xor    %eax,%eax
call   1060 <call_cui_mouse_reset_handler_tab@plt>
xor    %eax,%eax
call   1080 <set_cui_mouse_add_handler_map@plt>
xor    %eax,%eax
call   10a0 <set_cui_mouse_add_handler_msg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <set_cui_mouse_add_handler_stat@plt>

LLVM IR (-O0):
define void @redraw_all() {
%1 = call i32 (...) @wipe_all()
%2 = call i32 (...) @redraw_map()
%3 = call i32 (...) @draw_all_mbr_stat()
%4 = call i32 (...) @redraw_msg()
%5 = call i32 (...) @draw_stat_bar()
%6 = call i32 (...) @call_cui_mouse_reset_handler_tab()
%7 = call i32 (...) @set_cui_mouse_add_handler_map()
%8 = call i32 (...) @set_cui_mouse_add_handler_msg()
%9 = call i32 (...) @set_cui_mouse_add_handler_stat()
ret void
}

LLVM IR (-O2):
define void @redraw_all() {
%1 = tail call i32 (...) @wipe_all()
%2 = tail call i32 (...) @redraw_map()
%3 = tail call i32 (...) @draw_all_mbr_stat()
%4 = tail call i32 (...) @redraw_msg()
%5 = tail call i32 (...) @draw_stat_bar()
%6 = tail call i32 (...) @call_cui_mouse_reset_handler_tab()
%7 = tail call i32 (...) @set_cui_mouse_add_handler_map()
%8 = tail call i32 (...) @set_cui_mouse_add_handler_msg()
%9 = tail call i32 (...) @set_cui_mouse_add_handler_stat()
ret void
}
/* Variables and functions */
int ksft_exit_pass();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ ksft_set_plan(int);
int /*<<< orphan*/ test_pidfd_wait_simple();
int /*<<< orphan*/ test_pidfd_wait_states();
int main(int argc, char **argv) {
  ksft_print_header();
  ksft_set_plan(2);
  test_pidfd_wait_simple();
  test_pidfd_wait_states();
  return ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <ksft_print_header@plt>
mov    $0x2,%edi
call   1050 <ksft_set_plan@plt>
mov    $0x0,%al
call   1040 <test_pidfd_wait_simple@plt>
mov    $0x0,%al
call   1030 <test_pidfd_wait_states@plt>
mov    $0x0,%al
call   1060 <ksft_exit_pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <ksft_print_header@plt>
mov    $0x2,%edi
call   1050 <ksft_set_plan@plt>
xor    %eax,%eax
call   1040 <test_pidfd_wait_simple@plt>
xor    %eax,%eax
call   1030 <test_pidfd_wait_states@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <ksft_exit_pass@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ksft_print_header()
%7 = call i32 @ksft_set_plan(i32 2)
%8 = call i32 (...) @test_pidfd_wait_simple()
%9 = call i32 (...) @test_pidfd_wait_states()
%10 = call i32 (...) @ksft_exit_pass()
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 @ksft_set_plan(i32 2)
%5 = tail call i32 (...) @test_pidfd_wait_simple()
%6 = tail call i32 (...) @test_pidfd_wait_states()
%7 = tail call i32 (...) @ksft_exit_pass()
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ a_dimension(int /*<<< orphan*/, int /*<<< orphan*/);
void op_dimlcl() { a_dimension(0, 0); }


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

x86 assembly (clang, -O2):
<op_dimlcl>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <a_dimension@plt>

LLVM IR (-O0):
define void @op_dimlcl() {
%1 = call i32 @a_dimension(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @op_dimlcl() {
%1 = tail call i32 @a_dimension(i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int ispunct(int /*<<< orphan*/);
int iswpunct(wint_t wc) { return ispunct(wc); }


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

x86 assembly (clang, -O2):
<iswpunct>:
jmp    1030 <ispunct@plt>

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

LLVM IR (-O2):
define i32 @iswpunct(i32 %0) {
%2 = tail call i32 @ispunct(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ insert_str_in_file(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: %s [name]\n", argv[0]);
    return 1;
  }
  insert_str_in_file(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <insert_str_in_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <insert_str_in_file@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [name]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @insert_str_in_file(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int toshort(char *);
unsigned long tolong(char *data) {
  return toshort(data) | (toshort(data + 2) << 16);
}


x86 assembly (clang, -O0):
<tolong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <toshort@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <toshort@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolong>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <toshort@plt>
mov    %eax,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <toshort@plt>
shl    $0x10,%eax
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @tolong(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @toshort(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = call i32 @toshort(i8* %6)
%8 = shl i32 %7, 16
%9 = or i32 %4, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @tolong(i8* %0) {
%2 = tail call i32 @toshort(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @toshort(i8* %3)
%5 = shl i32 %4, 16
%6 = or i32 %5, %2
%7 = sext i32 %6 to i64
ret i64 %7
}
int do_744() { return 744; }


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

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

LLVM IR (-O0):
define i32 @do_744() {
ret i32 744
}

LLVM IR (-O2):
define i32 @do_744() {
ret i32 744
}
void best_fit_dealloc(void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @best_fit_dealloc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nop();
void FN_unreachable_statement_return_bad() {
  return;
  nop();
}


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

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

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

LLVM IR (-O2):
define void @FN_unreachable_statement_return_bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ logprintf(unsigned int, char *, char const *,
                             int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void logerr(unsigned int level, const char *st) {
  logprintf(level, "%s: %s (%d)\n", st, strerror(errno), errno);
}


x86 assembly (clang, -O0):
<logerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
mov    0x2e85(%rip),%rax
mov    (%rax),%r8d
lea    0xe9b(%rip),%rsi
call   1040 <logprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logerr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb0(%rip),%r14
mov    (%r14),%edi
call   1030 <strerror@plt>
mov    (%r14),%r8d
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <logprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s: %s (%d)\0A\00"
@errno = global i32 0
define void @logerr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = load i32, i32* @errno
%10 = call i32 @logprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s: %s (%d)\0A\00"
@errno = global i32 0
define void @logerr(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = load i32, i32* @errno
%6 = tail call i32 @logprintf(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4, i32 %5)
ret void
}