xunge/DecIR huggingface dataset:
f(int *p) { int vla2[*(int *)p]; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i32, i64 %8
store i64 %8, i64* %5
%11 = load i8*, i8** %4
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 undef
}
void I2CByteSend(unsigned long ulBase, unsigned char ucData) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ucData;
}


x86 assembly (clang, -O0):
<I2CByteSend>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CByteSend>:
mov    %esi,%eax
mov    %rax,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CByteSend(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = add i64 %0, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
ret void
}
int __test() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int snprintf(char *, int, char *, int);
int main() {
  char str[100];
  int retVal = snprintf(str, 100, "%d", 1231);
  printf("%s\n", str);
  return retVal;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
lea    0xebe(%rip),%rdx
mov    $0x4cf,%ecx
call   1040 <snprintf@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
lea    0xed3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x4cf,%ecx
call   1040 <snprintf@plt>
mov    %eax,%ebp
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1231)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int term_width() {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_col;
}


x86 assembly (clang, -O0):
<term_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_width>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @term_width() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @term_width() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M28_f(char *s) {
  debug("M28_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [46 x i8] c"M28_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M28_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void free_matrix(double **m, int nrl, int nrh, int ncl, int nch) {
  double **pArray = m + nrl;
  double *pMatrix = m[nrl] + ncl;
  free(pMatrix);
  free(pArray);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %rbx
movslq %esi,%rdx
lea    (%rdi,%rdx,8),%rbx
movslq %ecx,%rax
shl    $0x3,%rax
add    (%rdi,%rdx,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double**
%12 = alloca double*
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load double**, double*** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double*, double** %13, i64 %15
store double** %16, double*** %11
%17 = load double**, double*** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double*, double** %17, i64 %19
%21 = load double*, double** %20
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double* %24, double** %12
%25 = load double*, double** %12
%26 = bitcast double* %25 to i8*
%27 = load double**, double*** %11
%28 = bitcast double** %27 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matrix(double** nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = load double*, double** %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds double, double* %8, i64 %9
%11 = bitcast double* %10 to i8*
tail call void @free(i8* %11)
%12 = bitcast double** %7 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: Normal: download ftp://<user>:<password>@<host>/<url-path>\n");
  printf("Usage: Anon: download ftp://<host>/<url-path>\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"Usage: Normal: download ftp://<user>:<password>@<host>/<url-path>\0A\00"
@.str.1 = [47 x i8] c"Usage: Anon: download ftp://<host>/<url-path>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [66 x i8] c"Usage: Normal: download ftp://<user>:<password>@<host>/<url-path>\00"
@str.2 = [46 x i8] c"Usage: Anon: download ftp://<host>/<url-path>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jimi_sleep(unsigned int);
int /*<<< orphan*/ usleep(int);
void jimi_wsleep(unsigned int millisec) {
  if (millisec != 0)
    jimi_sleep(millisec);
  else
    usleep(250);
}


x86 assembly (clang, -O0):
<jimi_wsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <jimi_wsleep+0x22>
mov    -0x4(%rbp),%edi
call   1030 <jimi_sleep@plt>
jmp    114c <jimi_wsleep+0x2c>
mov    $0xfa,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jimi_wsleep>:
test   %edi,%edi
je     1129 <jimi_wsleep+0x9>
jmp    1030 <jimi_sleep@plt>
mov    $0xfa,%edi
jmp    1040 <usleep@plt>

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

LLVM IR (-O2):
define void @jimi_wsleep(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @jimi_sleep(i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @usleep(i32 250)
br label %7
7: ; preds = %5, %3
ret void
}
unsigned char HINIBBLE(unsigned char byte) { return byte & 240; }


x86 assembly (clang, -O0):
<HINIBBLE>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HINIBBLE>:
mov    %edi,%eax
and    $0xf0,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @HINIBBLE(i8 zeroext %0) {
%2 = and i8 %0, -16
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ display();
int main(int argc, char *argv[]) {
  display();
  return 0;
}


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

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

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 (...) @display()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @display()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PSInit(int *, char ***, int, int, int, int);
void initialize_physis(int argc, char **argv, int nx, int ny, int nz) {
  PSInit(&argc, &argv, 3, nx, ny, nz);
}


x86 assembly (clang, -O0):
<initialize_physis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <PSInit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_physis>:
sub    $0x18,%rsp
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %edi,0xc(%rsp)
mov    %rsi,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <PSInit@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @initialize_physis(i32 %0, i8** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = call i32 @PSInit(i32* %6, i8*** %7, i32 3, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @initialize_physis(i32 %0, i8** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
store i32 %0, i32* %6
store i8** %1, i8*** %7
%8 = call i32 @PSInit(i32* %6, i8*** %7, i32 3, i32 %2, i32 %3, i32 %4)
ret void
}
unsigned bitcount(unsigned x) {
  int b;
  for (b = 0; x != 0; b++)
    x &= x - 1;
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
void yyerror(msg) char msg[];
{}


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

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

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

LLVM IR (-O2):
define void @yyerror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isunderscore(int);
scalar_t__ iswalpha(int);
int isident_start(int c) { return iswalpha(c) || isunderscore(c); }


x86 assembly (clang, -O0):
<isident_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <iswalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isident_start+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isunderscore@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isident_start>:
push   %rbx
mov    %edi,%ebx
call   1040 <iswalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isident_start+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isunderscore@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isident_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @iswalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isunderscore(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isident_start(i32 %0) {
%2 = tail call i64 @iswalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isunderscore(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void pcp_print_pwr_fan_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_pwr_fan_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_pwr_fan_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _dumpBytes(int /*<<< orphan*/ *, int, int);
void peekBytes(FILE *f, int length) { _dumpBytes(f, length, 1); }


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

x86 assembly (clang, -O2):
<peekBytes>:
mov    $0x1,%edx
jmp    1030 <_dumpBytes@plt>

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

LLVM IR (-O2):
define void @peekBytes(i32* %0, i32 %1) {
%3 = tail call i32 @_dumpBytes(i32* %0, i32 %1, i32 1)
ret void
}
int getPriority(char op) {
  if (op == '/' || op == '*' || op == '%')
    return 1;
  else if (op == '+' || op == '-')
    return 0;
}


x86 assembly (clang, -O0):
<getPriority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1131 <getPriority+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1131 <getPriority+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    113d <getPriority+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1168 <getPriority+0x68>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1157 <getPriority+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1163 <getPriority+0x63>
movl   $0x0,-0x4(%rbp)
jmp    1168 <getPriority+0x68>
jmp    1168 <getPriority+0x68>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPriority>:
cmp    $0x2f,%dil
ja     1120 <getPriority+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x842000000000,%rdx
bt     %rcx,%rdx
jae    1120 <getPriority+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getPriority(i8 signext %0) {
switch i8 %0, label %2 [
i8 47, label %3
i8 42, label %3
i8 37, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %2, %1, %1, %1
%4 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 0, %2 ]
ret i32 %4
}
void _M2_SYSTEM_finish(int argc, char *p) {}


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

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

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

LLVM IR (-O2):
define void @_M2_SYSTEM_finish(i32 %0, i8* nocapture %1) {
ret void
}
int count_tabs(const char *string) {
  int tabs = 0;
  while (*string) {
    if (*string++ == '\t') {
      tabs++;
    }
  }
  return tabs;
}


x86 assembly (clang, -O0):
<count_tabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <count_tabs+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1140 <count_tabs+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count_tabs+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_tabs>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_tabs+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x9,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_tabs+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_tabs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 9
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int c084(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c084() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/);
int sched_getscheduler(pid_t pid) { return syscall(157, pid); }


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

x86 assembly (clang, -O2):
<sched_getscheduler>:
mov    %edi,%esi
mov    $0x9d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @sched_getscheduler(i32 %0) {
%2 = tail call i32 @syscall(i32 157, i32 %0)
ret i32 %2
}
void session_put_commandline(char *argv[]) { return; }


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

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

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

LLVM IR (-O2):
define void @session_put_commandline(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void stop() {
  system("echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable");
  system("echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable");
}


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

x86 assembly (clang, -O2):
<stop>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.1 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
define void @stop() {
%1 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.1 = [45 x i8] c"echo 0 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
define void @stop() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ reset();
void leave(int status) {
  reset();
  exit(status);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reset@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <reset@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @leave(i32 %0) {
%2 = tail call i32 (...) @reset()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int ho2cu(double *, double *, int);
int ro2ho(double *, double *, int);
int ro2cu(double *ro, double *cu, int p) {
  double ho[3];
  int trash;
  trash = ro2ho(ro, ho, p);
  trash = ho2cu(ho, cu, p);
  return 1;
}


x86 assembly (clang, -O0):
<ro2cu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ro2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ho2cu@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ro2cu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <ro2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <ho2cu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ro2cu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ro2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2cu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ro2cu(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @ro2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2cu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t pci_get_func(uint32_t dev) { return dev; }


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

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

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

LLVM IR (-O2):
define i32 @pci_get_func(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello there\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello there\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_strcmp(char *, char *, char *, char *, char *);
void test_expect(char *expected, char *got) {
  test_strcmp(expected, got, "expected: '%s', got: '%s'", expected, got);
}


x86 assembly (clang, -O0):
<test_expect>:
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    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec9(%rip),%rdx
call   1030 <test_strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expect>:
lea    0xee9(%rip),%rdx
mov    %rdi,%rcx
mov    %rsi,%r8
jmp    1030 <test_strcmp@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"expected: '%s', got: '%s'\00"
define void @test_expect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @test_strcmp(i8* %5, i8* %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"expected: '%s', got: '%s'\00"
define void @test_expect(i8* %0, i8* %1) {
%3 = tail call i32 @test_strcmp(i8* %0, i8* %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int close(int);
int close_once(int *fdptr) {
  int fd = *fdptr;
  if (fd >= 0) {
    *fdptr = -1;
    return close(fd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1149 <close_once+0x39>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <close_once+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_once>:
mov    %rdi,%rax
mov    (%rdi),%edi
test   %edi,%edi
js     1124 <close_once+0x14>
movl   $0xffffffff,(%rax)
jmp    1030 <close@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @close_once(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
store i32 -1, i32* %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void PECIBypassDisable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000800;
}


x86 assembly (clang, -O0):
<PECIBypassDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffff7ff,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIBypassDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffff7ff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PECIBypassDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074462720
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 0
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, -2049
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @PECIBypassDisable(i64 %0) {
%2 = icmp eq i64 %0, 1074462720
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = inttoptr i64 %0 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2049
store volatile i64 %7, i64* %5
ret void
}
int dcopy(int N, double *DX, int INCX, double *DY, int INCY) {
  extern int dcopy_(int *N, double *DX, int *INCX, double *DY, int *INCY);
  return dcopy_(&N, DX, &INCX, DY, &INCY);
}


x86 assembly (clang, -O0):
<dcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <dcopy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcopy>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <dcopy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dcopy(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double*, double** %7
%12 = load double*, double** %9
%13 = call i32 @dcopy_(i32* %6, double* %11, i32* %8, double* %12, i32* %10)
ret i32 %13
}

LLVM IR (-O2):
define i32 @dcopy(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @dcopy_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ applyAIMovement();
int /*<<< orphan*/ applyItems();
int /*<<< orphan*/ applyPlayerInput();
int /*<<< orphan*/ countdownBombs();
int /*<<< orphan*/ countdownExplosions();
int /*<<< orphan*/ plantBombs();
int /*<<< orphan*/ render();
int /*<<< orphan*/ updateControls();
void debug3(void) {
  updateControls();
  applyPlayerInput();
  applyAIMovement();
  applyItems();
  countdownExplosions();
  plantBombs();
  countdownBombs();
  render();
}


x86 assembly (clang, -O0):
<debug3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <updateControls@plt>
mov    $0x0,%al
call   1090 <applyPlayerInput@plt>
mov    $0x0,%al
call   10a0 <applyAIMovement@plt>
mov    $0x0,%al
call   1070 <applyItems@plt>
mov    $0x0,%al
call   1040 <countdownExplosions@plt>
mov    $0x0,%al
call   1050 <plantBombs@plt>
mov    $0x0,%al
call   1060 <countdownBombs@plt>
mov    $0x0,%al
call   1030 <render@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug3>:
push   %rax
xor    %eax,%eax
call   1080 <updateControls@plt>
xor    %eax,%eax
call   1090 <applyPlayerInput@plt>
xor    %eax,%eax
call   10a0 <applyAIMovement@plt>
xor    %eax,%eax
call   1070 <applyItems@plt>
xor    %eax,%eax
call   1040 <countdownExplosions@plt>
xor    %eax,%eax
call   1050 <plantBombs@plt>
xor    %eax,%eax
call   1060 <countdownBombs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <render@plt>

LLVM IR (-O0):
define void @debug3() {
%1 = call i32 (...) @updateControls()
%2 = call i32 (...) @applyPlayerInput()
%3 = call i32 (...) @applyAIMovement()
%4 = call i32 (...) @applyItems()
%5 = call i32 (...) @countdownExplosions()
%6 = call i32 (...) @plantBombs()
%7 = call i32 (...) @countdownBombs()
%8 = call i32 (...) @render()
ret void
}

LLVM IR (-O2):
define void @debug3() {
%1 = tail call i32 (...) @updateControls()
%2 = tail call i32 (...) @applyPlayerInput()
%3 = tail call i32 (...) @applyAIMovement()
%4 = tail call i32 (...) @applyItems()
%5 = tail call i32 (...) @countdownExplosions()
%6 = tail call i32 (...) @plantBombs()
%7 = tail call i32 (...) @countdownBombs()
%8 = tail call i32 (...) @render()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_ill(int sig) { printf("ILL\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"ILL\00"
define void @catch_ill(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_enable_tilt_function(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 |= 0x01;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_enable_tilt_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_enable_tilt_function+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_enable_tilt_function+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_enable_tilt_function>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_enable_tilt_function+0x41>
movsbl 0xf(%rsp),%esi
or     $0x1,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_enable_tilt_function() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 1
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_enable_tilt_function() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 1
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f(int);
main() {
  if (f(2) != 4)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <f@plt>
cmp    $0x4,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <f@plt>
cmp    $0x4,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 2)
%3 = icmp ne i32 %2, 4
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = icmp eq i32 %1, 4
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void foo619(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo619(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
bool delete_map(volatile uint32_t *address) {
  munmap((void *)address, 4096);
  return true;
}


x86 assembly (clang, -O0):
<delete_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000,%esi
call   1030 <munmap@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_map>:
push   %rax
mov    $0x1000,%esi
call   1030 <munmap@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @delete_map(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @munmap(i8* %4, i32 4096)
ret i32 1
}

LLVM IR (-O2):
define i32 @delete_map(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @munmap(i8* %2, i32 4096)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ do_qsort(void **, int (*)(void const *, void const *),
                            int /*<<< orphan*/, int);
int /*<<< orphan*/ insertion(void **, int (*)(void const *, void const *),
                             int /*<<< orphan*/, int);
void sortPointers(void **vals, int total_elems,
                  int (*cmp)(const void *, const void *)) {
  do_qsort(vals, cmp, 0, total_elems - 1);
  insertion(vals, cmp, 0, total_elems - 1);
}


x86 assembly (clang, -O0):
<sortPointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <do_qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1040 <insertion@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortPointers>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
lea    -0x1(%rsi),%ebp
mov    %rdx,%rsi
xor    %edx,%edx
mov    %ebp,%ecx
call   1030 <do_qsort@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <insertion@plt>

LLVM IR (-O0):
define void @sortPointers(i8** %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32 (i8*, i8*)*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 (i8*, i8*)* %2, i32 (i8*, i8*)** %6
%7 = load i8**, i8*** %4
%8 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @do_qsort(i8** %7, i32 (i8*, i8*)* %8, i32 0, i32 %10)
%12 = load i8**, i8*** %4
%13 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %6
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call i32 @insertion(i8** %12, i32 (i8*, i8*)* %13, i32 0, i32 %15)
ret void
}

LLVM IR (-O2):
define void @sortPointers(i8** %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @do_qsort(i8** %0, i32 (i8*, i8*)* %2, i32 0, i32 %4)
%6 = tail call i32 @insertion(i8** %0, i32 (i8*, i8*)* %2, i32 0, i32 %4)
ret void
}