xunge/DecIR huggingface dataset:
int test_imm_39int16_reg(short val) {
  return ((val) & (-0x39 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_39int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_39int16_reg>:
test   $0xffc7,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_39int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -57
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_39int16_reg(i16 signext %0) {
%2 = and i16 %0, -57
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
longjmperror() { write(2, "longjmp botch\n", sizeof("longjmp botch\n")); }


x86 assembly (clang, -O0):
<longjmperror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
lea    0xedc(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longjmperror>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0xf,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"longjmp botch\0A\00"
define i32 @longjmperror() {
%1 = alloca i32
%2 = call i32 @write(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"longjmp botch\0A\00"
define i32 @longjmperror() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 undef
}
void EVP_DecryptInit_ex(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_subb_data(FILE *stream, uint8_t data) {
  fprintf(stream,
          "SUBB  A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<fprint_subb_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_subb_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"SUBB A,x%02X \00"
define void @fprint_subb_data(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 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"SUBB A,x%02X \00"
define void @fprint_subb_data(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
ttflush() {}


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

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

LLVM IR (-O0):
define i32 @ttflush() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @ttflush() {
ret i32 undef
}
int test_imm_1Fint16_mem(short *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x1f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fint16_mem>:
testb  $0x1f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 31
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_1Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 31
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_basename(char *path) {
  char *s;
  s = strrchr(path, '/');
  if (s != NULL) {
    return s + 1;
  } else {
    return path;
  }
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <get_basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <get_basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int Cyc_Core_true_f(void *x) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_Core_true_f(i8* nocapture readnone %0) {
ret i32 1
}
int test(int *matr) {
  matr[0] += 1;
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32 1
}
int grandparent(int i) { return ((i + 1) / 4) - 1; }


x86 assembly (clang, -O0):
<grandparent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grandparent>:
lea    0x1(%rdi),%ecx
lea    0x4(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @grandparent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, 4
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @grandparent(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 4
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void OutputDebugString(char *lpOutputString) { fputs(lpOutputString, stderr); }


x86 assembly (clang, -O0):
<OutputDebugString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutputDebugString>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @OutputDebugString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @OutputDebugString(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *accept_input() {
  char *s = malloc(256);
  printf("Type your string here > ");
  fgets(s, 256, stdin);
  s[strlen(s) - 1] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<accept_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_input>:
push   %rbx
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Type your string here > \00"
@stdin = global i32 0
define i8* @accept_input() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 256)
store i8* %2, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 256, i32 %5)
%7 = load i8*, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"Type your string here > \00"
@stdin = global i32 0
define i8* @accept_input() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %1, i32 256, i32 %3)
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
ret i8* %1
}
/* Variables and functions */
int bar(int);
int foo(int v) { return bar(v - 1); }


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

x86 assembly (clang, -O2):
<foo>:
add    $0xffffffff,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = call i32 @bar(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @bar(i32 %2)
ret i32 %3
}
__attribute__((always_)) void cl_read_ntq(void *p) {
  asm volatile("movntdqa (%0), %%xmm1\n\t"
               "movntdqa 16(%0), %%xmm1\n\t"
               "movntdqa 32(%0), %%xmm1\n\t"
               "movntdqa 48(%0), %%xmm1\n\t"
               :
               : "r"(p)
               : "%xmm1", "memory");
}


x86 assembly (clang, -O0):
<cl_read_ntq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movntdqa (%rax),%xmm1
movntdqa 0x10(%rax),%xmm1
movntdqa 0x20(%rax),%xmm1
movntdqa 0x30(%rax),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_read_ntq>:
movntdqa (%rdi),%xmm1
movntdqa 0x10(%rdi),%xmm1
movntdqa 0x20(%rdi),%xmm1
movntdqa 0x30(%rdi),%xmm1
ret

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

LLVM IR (-O2):
define void @cl_read_ntq(i8* %0) {
tail call void asm sideeffect "movntdqa ($0), %xmm1\0A\09movntdqa 16($0), %xmm1\0A\09movntdqa 32($0), %xmm1\0A\09movntdqa 48($0), %xmm1\0A\09", "r,~{xmm1},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void convertPCGametypeToHybrid(void *gametype) {
  memcpy(gametype + 0xD4, gametype + 0x94, 0x08);
  memcpy(gametype + 0x9C, gametype + 0x7C, 0x18);
}


x86 assembly (clang, -O0):
<convertPCGametypeToHybrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xd4,%rdi
mov    -0x8(%rbp),%rsi
add    $0x94,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x9c,%rdi
mov    -0x8(%rbp),%rsi
add    $0x7c,%rsi
mov    $0x18,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertPCGametypeToHybrid>:
push   %rbx
mov    %rdi,%rbx
add    $0xd4,%rdi
lea    0x94(%rbx),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
lea    0x9c(%rbx),%rdi
add    $0x7c,%rbx
mov    %rbx,%rsi
mov    $0x18,%edx
pop    %rbx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @convertPCGametypeToHybrid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 212
%5 = load i8*, i8** %2
%6 = getelementptr i8, i8* %5, i64 148
%7 = call i32 @memcpy(i8* %4, i8* %6, i32 8)
%8 = load i8*, i8** %2
%9 = getelementptr i8, i8* %8, i64 156
%10 = load i8*, i8** %2
%11 = getelementptr i8, i8* %10, i64 124
%12 = call i32 @memcpy(i8* %9, i8* %11, i32 24)
ret void
}

LLVM IR (-O2):
define void @convertPCGametypeToHybrid(i8* %0) {
%2 = getelementptr i8, i8* %0, i64 212
%3 = getelementptr i8, i8* %0, i64 148
%4 = tail call i32 @memcpy(i8* %2, i8* %3, i32 8)
%5 = getelementptr i8, i8* %0, i64 156
%6 = getelementptr i8, i8* %0, i64 124
%7 = tail call i32 @memcpy(i8* %5, i8* %6, i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M3_profile(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void M3_ProfileFinalize(void) {
#pragma omp master
  {
    static int firstCall = 1;
    if (firstCall) {
      M3_profile(0, NULL, 1);
      firstCall = 0;
    }
  }
}


x86 assembly (clang, -O0):
<M3_ProfileFinalize>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
je     113b <M3_ProfileFinalize+0x2b>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <M3_profile@plt>
movl   $0x0,0x2eed(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3_ProfileFinalize>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    112f <M3_ProfileFinalize+0x1f>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <M3_profile@plt>
movb   $0x1,0x2efd(%rip)
pop    %rax
ret

LLVM IR (-O0):
@M3_ProfileFinalize.firstCall = internal global i32 1
define void @M3_ProfileFinalize() {
%1 = load i32, i32* @M3_ProfileFinalize.firstCall
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @M3_profile(i32 0, i32* null, i32 1)
store i32 0, i32* @M3_ProfileFinalize.firstCall
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@M3_ProfileFinalize.firstCall = internal unnamed_addr global i1 false
define void @M3_ProfileFinalize() {
%1 = load i1, i1* @M3_ProfileFinalize.firstCall
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 @M3_profile(i32 0, i32* null, i32 1)
store i1 true, i1* @M3_ProfileFinalize.firstCall
br label %4
4: ; preds = %2, %0
ret void
}
void ConvertPath(char *path) {
  while (*path) {
    if (*path == '/' || *path == '\\') {
      *path = '/';
    }
    path++;
  }
}


x86 assembly (clang, -O0):
<ConvertPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <ConvertPath+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1135 <ConvertPath+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    113c <ConvertPath+0x3c>
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ConvertPath+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertPath>:
jmp    1117 <ConvertPath+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <ConvertPath+0x10>
cmp    $0x5c,%al
je     1110 <ConvertPath+0x10>
test   %al,%al
jne    1113 <ConvertPath+0x13>
ret

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

LLVM IR (-O2):
define void @ConvertPath(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 47, label %5
i8 92, label %5
]
5: ; preds = %2, %2
store i8 47, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void clear_standard_input_line(void) {
  int ch;
  while ((ch = getchar()) != '\n' && ch != EOF)
    ;
}


x86 assembly (clang, -O0):
<clear_standard_input_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <clear_standard_input_line+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <clear_standard_input_line+0x44>
jmp    1159 <clear_standard_input_line+0x49>
jmp    1118 <clear_standard_input_line+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_standard_input_line>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clear_standard_input_line+0x20>
cmp    (%rbx),%eax
jne    1120 <clear_standard_input_line+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clear_standard_input_line() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clear_standard_input_line() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fileerror(const char *filename, FILE *file) {
  fclose(file);
  fprintf(stderr, "error reading file %s\n", filename);
  exit(4);
}


x86 assembly (clang, -O0):
<fileerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fileerror>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <fclose@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x4,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"error reading file %s\0A\00"
define void @fileerror(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 = call i32 @fclose(i32* %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"error reading file %s\0A\00"
define void @fileerror(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fclose(i32* %1)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 4)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
void *n_malloc(int size, const char *file, int line) {
  void *x;
  x = (void *)malloc(size);
  return x;
}


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

x86 assembly (clang, -O2):
<n_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i8* @n_malloc(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i64 @malloc(i32 %0)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _hubris_main();
int main() {
  _hubris_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @_hubris_main()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log2(unsigned int const);
unsigned int getIndex2(const unsigned int input) {
  assert(input >= 0);
  return (unsigned int)ceil(log2(input));
}


x86 assembly (clang, -O0):
<getIndex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex2>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
call   1030 <log2@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <ceil@plt>

LLVM IR (-O0):
define i32 @getIndex2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @log2(i32 %7)
%9 = call i64 @ceil(i32 %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @getIndex2(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @log2(i32 %0)
%4 = tail call i64 @ceil(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void preinit_0(void) { write(STDOUT_FILENO, "preinit array 0\n", 16); }


x86 assembly (clang, -O0):
<preinit_0>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<preinit_0>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x10,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [17 x i8] c"preinit array 0\0A\00"
define void @preinit_0() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [17 x i8] c"preinit array 0\0A\00"
define void @preinit_0() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
ret void
}
void gdk_devices_list() {}


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

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

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

LLVM IR (-O2):
define void @gdk_devices_list() {
ret void
}
void mock_cleanup(struct i915_address_space *vm) {}


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

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

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

LLVM IR (-O2):
%struct.i915_address_space = type opaque
define void @mock_cleanup(%struct.i915_address_space* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long parent;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcirculaterequest_parent(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcirculaterequest.parent = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcirculaterequest_parent(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcirculaterequest_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int random();
int random_level(void) {
  int level = 1;
  while ((random() & 0xFFFF) < (0.25 * 0xFFFF)) {
    level += 1;
  }
  return (level < 32) ? level : 32;
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <random_level+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <random_level+0xf>
cmpl   $0x20,-0x4(%rbp)
jge    1164 <random_level+0x54>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <random_level+0x61>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <random_level+0x61>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <random_level+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_level() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = call i32 (...) @random()
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x40CFFFE000000000
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %1
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 32, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @random_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helpMe(void) {
  printf("I don't care about your problem dude, fix it yourself!!!\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"I don't care about your problem dude, fix it yourself!!!\0A\00"
define void @helpMe() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"I don't care about your problem dude, fix it yourself!!!\00"
define void @helpMe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret void
}
void extern_prepostdeclared(void) {}


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

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

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

LLVM IR (-O2):
define void @extern_prepostdeclared() {
ret void
}
__attribute__((always_)) unsigned short foo(unsigned short v) {
  return (v << 8) | (v >> 8);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @foo(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
scalar_t__ increase_insults(int);
int /*<<< orphan*/ say_comment_5();
int haggle_insults(int store_index) {
  if (increase_insults(store_index))
    return (1);
  say_comment_5();
  return (0);
}


x86 assembly (clang, -O0):
<haggle_insults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <increase_insults@plt>
cmp    $0x0,%rax
je     1149 <haggle_insults+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1157 <haggle_insults+0x37>
mov    $0x0,%al
call   1040 <say_comment_5@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haggle_insults>:
push   %rbx
call   1030 <increase_insults@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1139 <haggle_insults+0x19>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <say_comment_5@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @haggle_insults(i32 %0) {
%2 = tail call i64 @increase_insults(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @say_comment_5()
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void I2SIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(0x40021000 + 0x0000007C))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<I2SIntClear>:
mov    %rsi,0x4002107c
40
ret

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

LLVM IR (-O2):
define void @I2SIntClear(i64 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1073877116 to i64*)
ret void
}
void w7(void *x, long long y) { *(long long *)(x + 32761) = y; }


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

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

LLVM IR (-O0):
define void @w7(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32761
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w7(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32761
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
void talloc_free(void *ptr) { talloc_free(ptr); }


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

x86 assembly (clang, -O2):
<talloc_free>:
jmp    1100 <talloc_free>

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

LLVM IR (-O2):
define void @talloc_free(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct uuid {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int printf(char *, char *);
int /*<<< orphan*/ snprintf_uuid(char *, int, struct uuid *);
int __attribute__(()) printf_uuid(struct uuid *uuid) {
  char buf[38];
  snprintf_uuid(buf, sizeof(buf), uuid);
  return (printf("%s", buf));
}


x86 assembly (clang, -O0):
<printf_uuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x26,%esi
call   1040 <snprintf_uuid@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_uuid>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x26,%esi
call   1040 <snprintf_uuid@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.uuid = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @printf_uuid(%struct.uuid* %0) {
%2 = alloca %struct.uuid*
%3 = alloca [38 x i8]
store %struct.uuid* %0, %struct.uuid** %2
%4 = getelementptr inbounds [38 x i8], [38 x i8]* %3, i64 0, i64 0
%5 = load %struct.uuid*, %struct.uuid** %2
%6 = call i32 @snprintf_uuid(i8* %4, i32 38, %struct.uuid* %5)
%7 = getelementptr inbounds [38 x i8], [38 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.uuid = type { i32 }
@.str = [3 x i8] c"%s\00"
define i32 @printf_uuid(%struct.uuid* %0) {
%2 = alloca [38 x i8]
%3 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf_uuid(i8* %3, i32 38, %struct.uuid* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_debug(char *);
int /*<<< orphan*/ print_debug_char(char);
int /*<<< orphan*/ print_debug_hex8(unsigned int);
void print_debug_pci_dev(unsigned dev) {
  print_debug("PCI: ");
  print_debug_hex8((dev >> 16) & 0xff);
  print_debug_char(':');
  print_debug_hex8((dev >> 11) & 0x1f);
  print_debug_char('.');
  print_debug_hex8((dev >> 8) & 7);
}


x86 assembly (clang, -O0):
<print_debug_pci_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <print_debug@plt>
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
and    $0xff,%edi
call   1030 <print_debug_hex8@plt>
mov    $0x3a,%edi
call   1050 <print_debug_char@plt>
mov    -0x4(%rbp),%edi
shr    $0xb,%edi
and    $0x1f,%edi
call   1030 <print_debug_hex8@plt>
mov    $0x2e,%edi
call   1050 <print_debug_char@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0x7,%edi
call   1030 <print_debug_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_pci_dev>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <print_debug@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <print_debug_hex8@plt>
mov    $0x3a,%edi
call   1050 <print_debug_char@plt>
mov    %ebx,%edi
shr    $0xb,%edi
and    $0x1f,%edi
call   1030 <print_debug_hex8@plt>
mov    $0x2e,%edi
call   1050 <print_debug_char@plt>
shr    $0x8,%ebx
and    $0x7,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_debug_hex8@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"PCI: \00"
define void @print_debug_pci_dev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @print_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = lshr i32 %4, 16
%6 = and i32 %5, 255
%7 = call i32 @print_debug_hex8(i32 %6)
%8 = call i32 @print_debug_char(i8 signext 58)
%9 = load i32, i32* %2
%10 = lshr i32 %9, 11
%11 = and i32 %10, 31
%12 = call i32 @print_debug_hex8(i32 %11)
%13 = call i32 @print_debug_char(i8 signext 46)
%14 = load i32, i32* %2
%15 = lshr i32 %14, 8
%16 = and i32 %15, 7
%17 = call i32 @print_debug_hex8(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"PCI: \00"
define void @print_debug_pci_dev(i32 %0) {
%2 = tail call i32 @print_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = tail call i32 @print_debug_hex8(i32 %4)
%6 = tail call i32 @print_debug_char(i8 signext 58)
%7 = lshr i32 %0, 11
%8 = and i32 %7, 31
%9 = tail call i32 @print_debug_hex8(i32 %8)
%10 = tail call i32 @print_debug_char(i8 signext 46)
%11 = lshr i32 %0, 8
%12 = and i32 %11, 7
%13 = tail call i32 @print_debug_hex8(i32 %12)
ret void
}
/* Variables and functions */
char *frob();
int /*<<< orphan*/ oof();
test_3(int code) {
  char *temp = frob();
  int rotate = (code == 22);
  if (!rotate || temp == 0)
    oof();
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <frob@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x16,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115a <test_3+0x3a>
cmpq   $0x0,-0x10(%rbp)
jne    1161 <test_3+0x41>
mov    $0x0,%al
call   1030 <oof@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <frob@plt>
cmp    $0x16,%ebx
jne    1136 <test_3+0x16>
test   %rax,%rax
je     1136 <test_3+0x16>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
%6 = call i8* (...) @frob()
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 22
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12, %1
%16 = call i32 (...) @oof()
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_3(i32 %0) {
%2 = tail call i8* (...) @frob()
%3 = icmp ne i32 %0, 22
%4 = icmp eq i8* %2, null
%5 = select i1 %3, i1 true, i1 %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %1, %6
ret i32 undef
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar() { return fgetc(stdin); }


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @fgetc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
ret i32 %2
}
void initialise_monitor_handles() {}


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

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

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

LLVM IR (-O2):
define void @initialise_monitor_handles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fsub_preg32_qword(int reg32) {
  put8(0xDC);
  put8(0x20 + reg32);
}


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

x86 assembly (clang, -O2):
<fsub_preg32_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdc,%edi
call   1030 <put8@plt>
add    $0x20,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fsub_preg32_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 220)
%4 = load i32, i32* %2
%5 = add nsw i32 32, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fsub_preg32_qword(i32 %0) {
%2 = tail call i32 @put8(i32 220)
%3 = add nsw i32 %0, 32
%4 = tail call i32 @put8(i32 %3)
ret void
}
int test_imm_9Euint16_reg(unsigned short val) {
  return ((val) & (0x9E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Euint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x9e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Euint16_reg>:
test   $0x9e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Euint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 158
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_9Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 158
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int md4_tests();
int md5_tests();
int sha_tests();
int main(void) { return md4_tests() + md5_tests() + sha_tests(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <md4_tests@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <md5_tests@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <sha_tests@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <md4_tests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <md5_tests@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1050 <sha_tests@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @md4_tests()
%3 = call i32 (...) @md5_tests()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @sha_tests()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @md4_tests()
%2 = tail call i32 (...) @md5_tests()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @sha_tests()
%5 = add nsw i32 %3, %4
ret i32 %5
}
void exit2(int t) { (void)(t); }


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

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

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

LLVM IR (-O2):
define void @exit2(i32 %0) {
ret void
}
unsigned int f44(unsigned int x, int y __attribute__((unused))) {
  return (x >> ((-1) & (8 * sizeof(unsigned int) - 1))) | (x << 1);
}


x86 assembly (clang, -O0):
<f44>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f44(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 = lshr i32 %5, 31
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f44(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
void gdk_window_foreign_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_foreign_new() {
ret void
}
void modif_rear_unit2MODIF_O() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_unit2MODIF_O() {
ret void
}