xunge/DecIR huggingface dataset:
/* Variables and functions */
bool is_finnish_umlaut_vowel_second_byte(int byte) {
  switch (byte) {
  case -171:
  case -172:
  case -154:
  case -139:
  case -140:
  case -122:
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_finnish_umlaut_vowel_second_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xac,%eax
sub    $0x2,%eax
jb     115a <is_finnish_umlaut_vowel_second_byte+0x5a>
jmp    1120 <is_finnish_umlaut_vowel_second_byte+0x20>
mov    -0xc(%rbp),%eax
sub    $0xffffff66,%eax
je     115a <is_finnish_umlaut_vowel_second_byte+0x5a>
jmp    1133 <is_finnish_umlaut_vowel_second_byte+0x33>
mov    -0xc(%rbp),%eax
add    $0x8c,%eax
sub    $0x2,%eax
jb     115a <is_finnish_umlaut_vowel_second_byte+0x5a>
jmp    1149 <is_finnish_umlaut_vowel_second_byte+0x49>
mov    -0xc(%rbp),%eax
sub    $0xffffff86,%eax
jne    1166 <is_finnish_umlaut_vowel_second_byte+0x66>
jmp    115a <is_finnish_umlaut_vowel_second_byte+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_finnish_umlaut_vowel_second_byte+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_finnish_umlaut_vowel_second_byte>:
add    $0xac,%edi
cmp    $0x32,%edi
ja     1121 <is_finnish_umlaut_vowel_second_byte+0x21>
mov    $0x1,%eax
movabs $0x4000300040003,%rcx
bt     %rdi,%rcx
jae    1121 <is_finnish_umlaut_vowel_second_byte+0x21>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_finnish_umlaut_vowel_second_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 -171, label %5
i32 -172, label %5
i32 -154, label %5
i32 -139, label %5
i32 -140, label %5
i32 -122, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_finnish_umlaut_vowel_second_byte(i32 %0) {
switch i32 %0, label %2 [
i32 -171, label %3
i32 -172, label %3
i32 -154, label %3
i32 -139, label %3
i32 -140, label %3
i32 -122, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x91() {
  Assert_real((isprint(145) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              730, ("isprint should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x91>:
push   %rax
mov    $0x91,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2da,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x91\00"
define void @t_isprint_0x91() {
%1 = call i64 @isprint(i32 145)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 730, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x91\00"
define void @t_isprint_0x91() {
%1 = tail call i64 @isprint(i32 145)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 730, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_7Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x7f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Fint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 127
%7 = icmp ne i64 %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_7Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 545460846592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ enter(char *);
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ out();
char symbol();
prp() {
  enter("prp");
  if (symbol() != ')')
    error(3);
  out();
}


x86 assembly (clang, -O0):
<prp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <enter@plt>
mov    $0x0,%al
call   1060 <symbol@plt>
movsbl %al,%eax
cmp    $0x29,%eax
je     1171 <prp+0x31>
mov    $0x3,%edi
call   1040 <error@plt>
mov    $0x0,%al
call   1050 <out@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prp>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <enter@plt>
xor    %eax,%eax
call   1060 <symbol@plt>
cmp    $0x29,%al
je     1162 <prp+0x22>
mov    $0x3,%edi
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <out@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"prp\00"
define i32 @prp() {
%1 = alloca i32
%2 = call i32 @enter(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @symbol()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 41
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @error(i32 3)
br label %8
8: ; preds = %6, %0
%9 = call i32 (...) @out()
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"prp\00"
define i32 @prp() {
%1 = tail call i32 @enter(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @symbol()
%3 = icmp eq i8 %2, 41
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @error(i32 3)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @out()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("%d\n%d\n", 786, -786);
  printf("%+d\n%+d\n", 786, -786);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A%d\0A\00"
@.str.1 = [9 x i8] c"%+d\0A%+d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 786, i32 -786)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 786, i32 -786)
ret i32 0
}
void *dlopen(const char *file, int mode) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
char itoc(int i) {
  if (i < 10) {
    return i + '0';
  } else {
    return i - 10 + 'a';
  }
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <itoc+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <itoc+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @itoc(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Type definitions */
struct pt_regs {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_GETREGS;
int /*<<< orphan*/ perror(char *);
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  struct pt_regs *);
int ptrace_getregs(pid_t pid, struct pt_regs *regs) {
  if (ptrace(PTRACE_GETREGS, pid, NULL, regs) < 0) {
    perror("ptrace_getregs: Can not get register values");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_getregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    116a <ptrace_getregs+0x4a>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ptrace_getregs+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_getregs>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ptrace@plt>
test   %rax,%rax
js     1141 <ptrace_getregs+0x21>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    113d <ptrace_getregs+0x1d>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
@PTRACE_GETREGS = global i32 0
@.str = [44 x i8] c"ptrace_getregs: Can not get register values\00"
define i32 @ptrace_getregs(i32 %0, %struct.pt_regs* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store %struct.pt_regs* %1, %struct.pt_regs** %5
%6 = load i32, i32* @PTRACE_GETREGS
%7 = load i32, i32* %4
%8 = load %struct.pt_regs*, %struct.pt_regs** %5
%9 = call i64 @ptrace(i32 %6, i32 %7, i32* null, %struct.pt_regs* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
@PTRACE_GETREGS = global i32 0
@.str = [44 x i8] c"ptrace_getregs: Can not get register values\00"
define i32 @ptrace_getregs(i32 %0, %struct.pt_regs* %1) {
%3 = load i32, i32* @PTRACE_GETREGS
%4 = tail call i64 @ptrace(i32 %3, i32 %0, i32* null, %struct.pt_regs* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
int counthex(const char *in) {
  int len = strlen((char *)in);
  return (len + 1) / 2;
}


x86 assembly (clang, -O0):
<counthex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counthex>:
push   %rax
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @counthex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @counthex(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PinConfigSet(unsigned long, int, int);
int /*<<< orphan*/ PinModeSet(unsigned long, unsigned long);
void PinTypeI2C(unsigned long ulPin, unsigned long ulPinMode) {
  PinModeSet(ulPin, ulPinMode);
  PinConfigSet(ulPin, 0x00000020, 0x00000110);
}


x86 assembly (clang, -O0):
<PinTypeI2C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <PinModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0x110,%edx
call   1040 <PinConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinTypeI2C>:
push   %rbx
mov    %rdi,%rbx
call   1030 <PinModeSet@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x110,%edx
pop    %rbx
jmp    1040 <PinConfigSet@plt>

LLVM IR (-O0):
define void @PinTypeI2C(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @PinModeSet(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @PinConfigSet(i64 %8, i32 32, i32 272)
ret void
}

LLVM IR (-O2):
define void @PinTypeI2C(i64 %0, i64 %1) {
%3 = tail call i32 @PinModeSet(i64 %0, i64 %1)
%4 = tail call i32 @PinConfigSet(i64 %0, i32 32, i32 272)
ret void
}
void RAWToUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RAWToUVRow_Any_NEON() {
ret void
}
char *str_upr(char *s) {
  char c;
  char *s1 = s;
  while (*s1) {
    c = *s1;
    if (c >= 'a' && c <= 'z')
      c -= ('a' - 'A');
    *s1++ = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<str_upr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <str_upr+0x63>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jl     114a <str_upr+0x4a>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
jg     114a <str_upr+0x4a>
movsbl -0x9(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1110 <str_upr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_upr>:
mov    %rdi,%rax
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <str_upr+0x33>
lea    0x1(%rax),%rcx
nopl   (%rax)
lea    -0x61(%rdx),%esi
lea    -0x20(%rdx),%edi
cmp    $0x1a,%sil
movzbl %dl,%edx
movzbl %dil,%esi
cmovae %edx,%esi
mov    %sil,-0x1(%rcx)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <str_upr+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_upr(i8* returned %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 i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
%9 = add i8 %5, -32
%10 = select i1 %8, i8 %9, i8 %5
%11 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %10, i8* %6
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_http_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_http_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stress_double_put(double const);
double __attribute__((no)) stress_funccall_double_1(const double a) {
  stress_double_put(a);
  return a;
}


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

x86 assembly (clang, -O2):
<stress_funccall_double_1>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <stress_double_put@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @stress_funccall_double_1(double returned %0) {
%2 = tail call i32 @stress_double_put(double %0)
ret double %0
}
void g_list_remove_all() {}


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

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

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

LLVM IR (-O2):
define void @g_list_remove_all() {
ret void
}
float glmMin3f(float a, float b, float c) {
  if (a < b) {
    if (a < c)
      return a;
    else
      return c;
  } else {
    if (b < c)
      return b;
    else
      return c;
  }
}


x86 assembly (clang, -O0):
<glmMin3f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1157 <glmMin3f+0x57>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1148 <glmMin3f+0x48>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1183 <glmMin3f+0x83>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1183 <glmMin3f+0x83>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1179 <glmMin3f+0x79>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1183 <glmMin3f+0x83>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMin3f>:
minss  %xmm1,%xmm0
minss  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @glmMin3f(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp olt float %0, %2
%6 = select i1 %5, float %0, float %2
%7 = fcmp olt float %1, %2
%8 = select i1 %7, float %1, float %2
%9 = select i1 %4, float %6, float %8
ret float %9
}
ourmemcmp(a, b, count) register char *a, *b;
{
  while (count--)
    if (*a++ != *b++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ourmemcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1160 <ourmemcmp+0x60>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115b <ourmemcmp+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1167 <ourmemcmp+0x67>
jmp    110f <ourmemcmp+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourmemcmp>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ecx,%r8d
je     1128 <ourmemcmp+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <ourmemcmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ourmemcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
char lpc_uart_reg_read(int /*<<< orphan*/);
scalar_t__ lpc_uart_rx_empty();
char lpc_uart_read(void) {
  while (lpc_uart_rx_empty())
    ;
  return lpc_uart_reg_read(0);
}


x86 assembly (clang, -O0):
<lpc_uart_read>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <lpc_uart_read+0x9>
mov    $0x0,%al
call   1040 <lpc_uart_rx_empty@plt>
cmp    $0x0,%rax
je     113f <lpc_uart_read+0x1f>
jmp    1129 <lpc_uart_read+0x9>
xor    %edi,%edi
call   1030 <lpc_uart_reg_read@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpc_uart_read>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <lpc_uart_rx_empty@plt>
test   %rax,%rax
jne    1130 <lpc_uart_read+0x10>
xor    %edi,%edi
pop    %rax
jmp    1030 <lpc_uart_reg_read@plt>

LLVM IR (-O0):
define signext i8 @lpc_uart_read() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @lpc_uart_rx_empty()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call signext i8 @lpc_uart_reg_read(i32 0)
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @lpc_uart_read() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @lpc_uart_rx_empty()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call signext i8 @lpc_uart_reg_read(i32 0)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_rf(void) { printf("rs\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"rs\00"
define void @arg_rf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function2();
void function() { function2(); }


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

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

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

LLVM IR (-O2):
define void @function() {
%1 = tail call i32 (...) @function2()
ret void
}
int ones(int n) {
  switch (n) {
  case '0':
    return 0;
  case '1':
    return 3;
  case '2':
    return 3;
  case '3':
    return 5;
  case '4':
    return 4;
  case '5':
    return 4;
  case '6':
    return 3;
  case '7':
    return 5;
  case '8':
    return 5;
  case '9':
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11a8 <ones+0xa8>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x3,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x3,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x5,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x4,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x4,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x3,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x5,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x5,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x4,-0x4(%rbp)
jmp    11af <ones+0xaf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
add    $0xffffffcf,%edi
xor    %eax,%eax
cmp    $0x8,%edi
ja     1117 <ones+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ones(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 48, label %5
i32 49, label %6
i32 50, label %7
i32 51, label %8
i32 52, label %9
i32 53, label %10
i32 54, label %11
i32 55, label %12
i32 56, label %13
i32 57, label %14
]
5: ; preds = %1
store i32 0, i32* %2
br label %16
6: ; preds = %1
store i32 3, i32* %2
br label %16
7: ; preds = %1
store i32 3, i32* %2
br label %16
8: ; preds = %1
store i32 5, i32* %2
br label %16
9: ; preds = %1
store i32 4, i32* %2
br label %16
10: ; preds = %1
store i32 4, i32* %2
br label %16
11: ; preds = %1
store i32 3, i32* %2
br label %16
12: ; preds = %1
store i32 5, i32* %2
br label %16
13: ; preds = %1
store i32 5, i32* %2
br label %16
14: ; preds = %1
store i32 4, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table.ones = [9 x i32] [i32 3, i32 3, i32 5, i32 4, i32 4, i32 3, i32 5, i32 5, i32 4]
define i32 @ones(i32 %0) {
%2 = add i32 %0, -49
%3 = icmp ult i32 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.ones, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HWPBC_SignalHandler(int sig) {
  { printf("get HW_PBC signal from driver\n"); }
}


x86 assembly (clang, -O0):
<HWPBC_SignalHandler>:
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):
<HWPBC_SignalHandler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"get HW_PBC signal from driver\0A\00"
define void @HWPBC_SignalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"get HW_PBC signal from driver\00"
define void @HWPBC_SignalHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ rmdir(char *);
int main(void) {
  if (0 > rmdir("see.emily.play"))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <rmdir@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    114a <main+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <main+0x46>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <rmdir@plt>
test   %rax,%rax
jns    112b <main+0x1b>
mov    0x2eb7(%rip),%rax
jmp    1132 <main+0x22>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"see.emily.play\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @rmdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"see.emily.play\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @rmdir(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
%3 = load i32, i32* @EXIT_FAILURE
%4 = load i32, i32* @EXIT_SUCCESS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  int *p_index, *p_pass;
  if (argc != 2) {
    return 0;
  }
  p_index = (int *)malloc(0xff);
  *p_index = 100;
  free(p_index);
  int val = *p_index;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    $0xff,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1142 <main+0x22>
push   %rax
mov    $0xff,%edi
call   1040 <malloc@plt>
movl   $0x64,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %20
12: ; preds = %2
%13 = call i64 @malloc(i32 255)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %6
%15 = load i32*, i32** %6
store i32 100, i32* %15
%16 = load i32*, i32** %6
%17 = call i32 @free(i32* %16)
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
store i32 %19, i32* %8
store i32 0, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @malloc(i32 255)
%6 = inttoptr i64 %5 to i32*
store i32 100, i32* %6
%7 = tail call i32 @free(i32* %6)
br label %8
8: ; preds = %2, %4
ret i32 0
}
/* Variables and functions */
int alarm(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int ret = -1;
  ret = alarm(5);
  printf("I have been awaken up\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <alarm@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"I have been awaken up\00"
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo_2_1_1_2_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_1_2_2() {
ret void
}
int withinSameBlock(int *ptr1, int *ptr2) {
  int cptr1 = ptr1;
  int cptr2 = ptr2;
  int mask = 0xFF;
  mask = (mask << 8) + 0xFF;
  mask = (mask << 8) + 0xFF;
  mask = (mask << 8) + 0xC0;
  cptr1 = cptr1 & mask;
  cptr2 = cptr2 & mask;
  return cptr1 == cptr2;
}


x86 assembly (clang, -O0):
<withinSameBlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
movl   $0xff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x8,%eax
add    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x8,%eax
add    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x8,%eax
add    $0xc0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<withinSameBlock>:
xor    %edi,%esi
xor    %eax,%eax
test   $0xffffffc0,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @withinSameBlock(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = ptrtoint i32* %8 to i32
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
store i32 %11, i32* %6
store i32 255, i32* %7
%12 = load i32, i32* %7
%13 = shl i32 %12, 8
%14 = add nsw i32 %13, 255
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = shl i32 %15, 8
%17 = add nsw i32 %16, 255
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = shl i32 %18, 8
%20 = add nsw i32 %19, 192
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = and i32 %21, %22
store i32 %23, i32* %5
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = and i32 %24, %25
store i32 %26, i32* %6
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = icmp eq i32 %27, %28
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @withinSameBlock(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = xor i64 %4, %3
%6 = and i64 %5, 4294967232
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printconsts();
int /*<<< orphan*/ printsizes();
int main(int argc, char *argv[]) {
  printsizes();
  if (argc > 1) {
    if (true) {
      printconsts();
    }
  }
  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   1040 <printsizes@plt>
cmpl   $0x1,-0x8(%rbp)
jle    114e <main+0x2e>
mov    $0x0,%al
call   1030 <printconsts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <printsizes@plt>
cmp    $0x2,%ebx
jl     1136 <main+0x16>
xor    %eax,%eax
call   1030 <printconsts@plt>
xor    %eax,%eax
pop    %rbx
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 (...) @printsizes()
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @printconsts()
br label %11
11: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printsizes()
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @printconsts()
br label %7
7: ; preds = %5, %2
ret i32 0
}
double _swapd(double d) {
  double r[2];
  register char *p, *q;
  register int n;
  p = (char *)&r[1];
  q = (char *)&d;
  for (n = sizeof(double) + 1; --n; *--p = *q++)
    ;
  return r[0];
}


x86 assembly (clang, -O0):
<_swapd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x9,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
je     1163 <_swapd+0x63>
jmp    113b <_swapd+0x3b>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,-0x1(%rax)
jmp    1124 <_swapd+0x24>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swapd>:
movq   %xmm0,%rax
bswap  %rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
define double @_swapd(double %0) {
%2 = alloca double
%3 = alloca [2 x double]
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store double %0, double* %2
%7 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%8 = bitcast double* %7 to i8*
store i8* %8, i8** %4
%9 = bitcast double* %2 to i8*
store i8* %9, i8** %5
store i32 9, i32* %6
br label %10
10: ; preds = %15, %1
%11 = load i32, i32* %6
%12 = add nsw i32 %11, -1
store i32 %12, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
%18 = load i8, i8* %16
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 -1
store i8* %20, i8** %4
store i8 %18, i8* %20
br label %10
21: ; preds = %10
%22 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%23 = load double, double* %22
ret double %23
}

LLVM IR (-O2):
define double @_swapd(double %0) {
%2 = bitcast double %0 to i64
%3 = call i64 @llvm.bswap.i64(i64 %2)
%4 = bitcast i64 %3 to double
ret double %4
}
void XGrabPointer() {}


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

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

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

LLVM IR (-O2):
define void @XGrabPointer() {
ret void
}
int leapYear(int y) {
  if (y % 4 == 0) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<leapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <leapYear+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <leapYear+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapYear>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @leapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
char *allocateString() {
  char *leakString;
  leakString = malloc(3);
  return leakString;
}


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

x86 assembly (clang, -O2):
<allocateString>:
mov    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @allocateString() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 3)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @allocateString() {
%1 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
ret i8* %1
}
long echo_wait(string, flag)
char *string[];
long *flag;
{
  *flag = 2L;
  return (1);
}


x86 assembly (clang, -O0):
<echo_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_wait>:
movq   $0x2,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @echo_wait(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
store i64 2, i64* %5
ret i64 1
}

LLVM IR (-O2):
define i64 @echo_wait(i8** nocapture readnone %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
ret i64 1
}
void dd_copy(const double *a, double *b) {
  b[0] = a[0];
  b[1] = a[1];
}


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

x86 assembly (clang, -O2):
<dd_copy>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @dd_copy(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @dd_copy(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
ret void
}