xunge/DecIR huggingface dataset:
char TestS() {
  char r, res = 1;
  __asm__("addb $128, %1" : "=@ccs"(r), "+r"(res));
  if (r) {
    __asm__("subb $128, %1" : "=@ccns"(r), "+r"(res));
    if (r)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestS>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x3(%rbp)
mov    -0x3(%rbp),%al
add    $0x80,%al
sets   %cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1146 <TestS+0x46>
mov    -0x3(%rbp),%al
sub    $0x80,%al
setns  %cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1141 <TestS+0x41>
movb   $0x1,-0x1(%rbp)
jmp    114a <TestS+0x4a>
jmp    1146 <TestS+0x46>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestS>:
mov    $0x1,%al
mov    $0x1,%cl
add    $0x80,%cl
jns    110f <TestS+0xf>
sub    $0x80,%cl
js     110f <TestS+0xf>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestS() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 1, i8* %3
%4 = load i8, i8* %3
%5 = call { i8, i8 } asm "addb $$128, $1", "={@ccs},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %4)
%6 = extractvalue { i8, i8 } %5, 0
%7 = extractvalue { i8, i8 } %5, 1
store i8 %6, i8* %2
store i8 %7, i8* %3
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %0
%11 = load i8, i8* %3
%12 = call { i8, i8 } asm "subb $$128, $1", "={@ccns},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %11)
%13 = extractvalue { i8, i8 } %12, 0
%14 = extractvalue { i8, i8 } %12, 1
store i8 %13, i8* %2
store i8 %14, i8* %3
%15 = load i8, i8* %2
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
store i8 1, i8* %1
br label %20
18: ; preds = %10
br label %19
19: ; preds = %18, %0
store i8 0, i8* %1
br label %20
20: ; preds = %19, %17
%21 = load i8, i8* %1
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @TestS() {
%1 = tail call { i8, i8 } asm "addb $$128, $1", "={@ccs},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 1)
%2 = extractvalue { i8, i8 } %1, 0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = extractvalue { i8, i8 } %1, 1
%6 = tail call { i8, i8 } asm "subb $$128, $1", "={@ccns},=r,1,~{dirflag},~{fpsr},~{flags}"(i8 %5)
%7 = extractvalue { i8, i8 } %6, 0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4, %0
br label %10
10: ; preds = %4, %9
%11 = phi i8 [ 0, %9 ], [ 1, %4 ]
ret i8 %11
}
/* Variables and functions */
char *string_array_replace(char **, scalar_t__, int /*<<< orphan*/ *);
scalar_t__ string_array_size(char **);
char *string_array_pop(char **array) {
  return string_array_replace(array, string_array_size(array) - 1, NULL);
}


x86 assembly (clang, -O0):
<string_array_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_array_size@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <string_array_replace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_pop>:
push   %rbx
mov    %rdi,%rbx
call   1040 <string_array_size@plt>
lea    -0x1(%rax),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1030 <string_array_replace@plt>

LLVM IR (-O0):
define i8* @string_array_pop(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i64 @string_array_size(i8** %4)
%6 = sub nsw i64 %5, 1
%7 = call i8* @string_array_replace(i8** %3, i64 %6, i32* null)
ret i8* %7
}

LLVM IR (-O2):
define i8* @string_array_pop(i8** %0) {
%2 = tail call i64 @string_array_size(i8** %0)
%3 = add nsw i64 %2, -1
%4 = tail call i8* @string_array_replace(i8** %0, i64 %3, i32* null)
ret i8* %4
}
void GPMCPrefetchRRArbitrationConfig(unsigned int baseAddr,
                                     unsigned int configVal) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x00800000u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((configVal << (0x00000017u)) & (0x00800000u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchRRArbitrationConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xff7fffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x17,%edx
and    $0x800000,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchRRArbitrationConfig>:
add    $0x1e0,%edi
andl   $0xff7fffff,(%rdi)
and    $0x1,%esi
shl    $0x17,%esi
or     %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @GPMCPrefetchRRArbitrationConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -8388609
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 23
%9 = and i32 %8, 8388608
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
int z2i(unsigned long z) { return (int)z; }


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

x86 assembly (clang, -O2):
<z2i>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @z2i(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @z2i(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
void execRm(char **options, int argc) {}


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

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

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

LLVM IR (-O2):
define void @execRm(i8** nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int f118(int *);
int f119(int *p) { return f118(p); }


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

x86 assembly (clang, -O2):
<f119>:
jmp    1030 <f118@plt>

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

LLVM IR (-O2):
define i32 @f119(i32* %0) {
%2 = tail call i32 @f118(i32* %0)
ret i32 %2
}
void __delay() {
  int i;
  for (i = 0; i < 1000000; i++)
    ;
}


x86 assembly (clang, -O0):
<__delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    112b <__delay+0x2b>
jmp    111d <__delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <__delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @__delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
unsigned long SSIIntNumberGet(unsigned long);
void SSIIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = SSIIntNumberGet(ulBase);
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<SSIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntUnregister>:
push   %rbx
call   1040 <SSIIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @SSIIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @SSIIntNumberGet(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @IntDisable(i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @IntUnregister(i64 %8)
ret void
}

LLVM IR (-O2):
define void @SSIIntUnregister(i64 %0) {
%2 = tail call i64 @SSIIntNumberGet(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x9a() {
  Assert_real((isprint(154) == 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",
              775, ("isprint should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x307,%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 0x9a\00"
define void @t_isprint_0x9a() {
%1 = call i64 @isprint(i32 154)
%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 775, 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 0x9a\00"
define void @t_isprint_0x9a() {
%1 = tail call i64 @isprint(i32 154)
%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 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_switch_side(int side) {
  assert(side >= 0 && side <= 1);
  return 1 ^ side;
}


x86 assembly (clang, -O0):
<chess_switch_side>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <chess_switch_side+0x24>
cmpl   $0x1,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_switch_side>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x2,%ebx
setb   %dil
call   1030 <assert@plt>
xor    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chess_switch_side(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = xor i32 1, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @chess_switch_side(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = xor i32 %0, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ wfile_goodpath(char *, char *);
void wfile_addwild(char *dst, char *src) {
  wfile_goodpath(dst, src);
  strcat(dst, "*");
}


x86 assembly (clang, -O0):
<wfile_addwild>:
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 <wfile_goodpath@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_addwild>:
push   %rbx
mov    %rdi,%rbx
call   1030 <wfile_goodpath@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
define void @wfile_addwild(i8* %0, i8* %1) {
%3 = tail call i32 @wfile_goodpath(i8* %0, i8* %1)
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void NOP(void) { asm("nop"); }


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

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

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

LLVM IR (-O2):
define void @NOP() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void tlvCleanupLLDP() {}


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

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

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

LLVM IR (-O2):
define void @tlvCleanupLLDP() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void onWrite(int socket) { printf("onWrite: socket: %i\n", socket); }


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

x86 assembly (clang, -O2):
<onWrite>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"onWrite: socket: %i\0A\00"
define void @onWrite(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void remove_elem(int *map, int cols, int row, int col) {
  map[row * cols + col] = 0x00;
}


x86 assembly (clang, -O0):
<remove_elem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_elem>:
imul   %edx,%esi
add    %ecx,%esi
movslq %esi,%rax
movl   $0x0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @remove_elem(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %8
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %9, i64 %15
store i32 0, i32* %16
ret void
}

LLVM IR (-O2):
define void @remove_elem(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 0, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, unsigned int);
int bh_memcpy(char *dest, const char *src, unsigned numtocopy,
              unsigned maxdestlen) {
  int ret = 0;
  if (numtocopy > maxdestlen) {
    ret = numtocopy - maxdestlen;
    numtocopy = maxdestlen;
  }
  memcpy(dest, src, numtocopy);
  return ret;
}


x86 assembly (clang, -O0):
<bh_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jbe    1148 <bh_memcpy+0x38>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bh_memcpy>:
push   %rbx
xor    %eax,%eax
mov    %edx,%ebx
sub    %ecx,%ebx
cmova  %ecx,%edx
cmovb  %eax,%ebx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bh_memcpy(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = icmp ugt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = sub i32 %14, %15
store i32 %16, i32* %9
%17 = load i32, i32* %8
store i32 %17, i32* %7
br label %18
18: ; preds = %13, %4
%19 = load i8*, i8** %5
%20 = load i8*, i8** %6
%21 = load i32, i32* %7
%22 = call i32 @memcpy(i8* %19, i8* %20, i32 %21)
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @bh_memcpy(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %2, %3
%6 = select i1 %5, i32 %3, i32 %2
%7 = tail call i32 @llvm.usub.sat.i32(i32 %2, i32 %3)
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %6)
ret i32 %7
}
void single_gt() {
  register int out0 = 0;
  register int in1 = 1;
  asm("foo %1,%0" : "=r"(out0) : ">r"(in1));
  asm("foo %1,%0" : "=r"(out0) : "r>"(in1));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @single_gt() {
%1 = tail call i32 asm "foo $1,$0", "=r,>r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = tail call i32 asm "foo $1,$0", "=r,r>,~{dirflag},~{fpsr},~{flags}"(i32 1)
ret void
}
int keep_alive(void) { return ((1)); }


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

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

LLVM IR (-O0):
define i32 @keep_alive() {
ret i32 1
}

LLVM IR (-O2):
define i32 @keep_alive() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *opendir(char *);
void resourceLeak_opendir(void) { DIR *leak1 = opendir("abc"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define void @resourceLeak_opendir() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int screen_width();
int random_x(void) { return rand() % (screen_width() - 3); }


x86 assembly (clang, -O0):
<random_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <screen_width@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_x>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <screen_width@plt>
mov    %eax,%ecx
add    $0xfffffffd,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_x() {
%1 = call i32 (...) @rand()
%2 = call i32 (...) @screen_width()
%3 = sub nsw i32 %2, 3
%4 = srem i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_x() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @screen_width()
%3 = add nsw i32 %2, -3
%4 = srem i32 %1, %3
ret i32 %4
}
extern func1(param) int param;
{
  return param;
}


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

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

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

LLVM IR (-O2):
define i32 @func1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *sleeper_func(void *p) {
  sleep((int)p);
  printf("sleeper func woke up - exiting the program\n");
  exit(1);
}


x86 assembly (clang, -O0):
<sleeper_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1050 <sleep@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sleeper_func>:
push   %rax
call   1050 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"sleeper func woke up - exiting the program\0A\00"
define i8* @sleeper_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @sleep(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"sleeper func woke up - exiting the program\00"
define noalias i8* @sleeper_func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @sleep(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
void justreturn_handler(int signo __attribute__((unused))) { return; }


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

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

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

LLVM IR (-O2):
define void @justreturn_handler(i32 %0) {
ret void
}
void math_atan2(void) {
  double d1 = lua_check_number(1, "atan2");
  double d2 = lua_check_number(2, "atan2");
  lua_pushnumber(((atan2(d1, d2)) * 180.0 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<math_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  0xe81(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6d(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%al
call   1050 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_atan2>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <atan2@plt>
mulsd  0xe85(%rip),%xmm0
divsd  0xe85(%rip),%xmm0
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"atan2\00"
define void @math_atan2() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call double @atan2(double %7, double %8)
%10 = fmul double %9, 1.800000e+02
%11 = fdiv double %10, 0x400921FB54442D18
%12 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"atan2\00"
define void @math_atan2() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to double
%3 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
%5 = tail call double @atan2(double %2, double %4)
%6 = fmul double %5, 1.800000e+02
%7 = fdiv double %6, 0x400921FB54442D18
%8 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}
/* Variables and functions */
int close(int);
int nmcadec_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<nmcadec_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @nmcadec_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int test3() { return "hello world"; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define i32 @test3() {
ret i32 ptrtoint ([12 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @test3() {
ret i32 ptrtoint ([12 x i8]* @.str to i32)
}
int my_proc_info2(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @my_proc_info2(i32 %0) {
ret i32 undef
}
/* Variables and functions */
double __nv_sinh(double);
double sinh(double __a) { return __nv_sinh(__a); }


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

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <__nv_sinh@plt>

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

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @__nv_sinh(double %0)
ret double %2
}
char *align8(char *p) {
  long pint = (long)p;
  return p + 8 - pint % 8;
}


x86 assembly (clang, -O0):
<align8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align8>:
lea    0x7(%rdi),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
and    $0xfffffffffffffff8,%rax
add    $0x8,%rax
ret

LLVM IR (-O0):
define i8* @align8(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = load i64, i64* %3
%9 = srem i64 %8, 8
%10 = sub i64 0, %9
%11 = getelementptr inbounds i8, i8* %7, i64 %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @align8(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = srem i64 %2, 8
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i8, i8* %3, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *bar(void *p, void *q) {
  if (p != (void *)26 || q != (void *)35)
    abort();
  return (void *)76;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1a,%eax
cmp    %rax,-0x8(%rbp)
jne    113e <bar+0x2e>
mov    $0x23,%eax
cmp    %rax,-0x10(%rbp)
je     1145 <bar+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x4c,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x1a,%rdi
jne    1122 <bar+0x12>
cmp    $0x23,%rsi
jne    1122 <bar+0x12>
mov    $0x4c,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @bar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, inttoptr (i64 26 to i8*)
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, inttoptr (i64 35 to i8*)
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
ret i8* inttoptr (i64 76 to i8*)
}

LLVM IR (-O2):
define i8* @bar(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, inttoptr (i64 26 to i8*)
%4 = icmp ne i8* %1, inttoptr (i64 35 to i8*)
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* inttoptr (i64 76 to i8*)
}
void zeroBytes(void *vpt, int count) {
  char *pt = (char *)vpt;
  while (--count >= 0)
    *pt++ = 0;
}


x86 assembly (clang, -O0):
<zeroBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     113c <zeroBytes+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1113 <zeroBytes+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroBytes>:
test   %esi,%esi
jle    1122 <zeroBytes+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zeroBytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 0, i8* %12
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @zeroBytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
unsigned long FD_SETSIZE;
unsigned long __NFDBITS;
int /*<<< orphan*/ __chk_fail();
unsigned long int __fdelt_chk(unsigned long int d) {
  if (d >= FD_SETSIZE)
    __chk_fail();
  return d / __NFDBITS;
}


x86 assembly (clang, -O0):
<__fdelt_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jb     1137 <__fdelt_chk+0x27>
mov    $0x0,%al
call   1030 <__chk_fail@plt>
mov    -0x8(%rbp),%rax
mov    0x2e8e(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdelt_chk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
cmp    %rdi,(%rax)
ja     1127 <__fdelt_chk+0x17>
xor    %eax,%eax
call   1030 <__chk_fail@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1147 <__fdelt_chk+0x37>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
@FD_SETSIZE = global i64 0
@__NFDBITS = global i64 0
define i64 @__fdelt_chk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @FD_SETSIZE
%5 = icmp uge i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @__chk_fail()
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = load i64, i64* @__NFDBITS
%11 = udiv i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
@FD_SETSIZE = global i64 0
@__NFDBITS = global i64 0
define i64 @__fdelt_chk(i64 %0) {
%2 = load i64, i64* @FD_SETSIZE
%3 = icmp ugt i64 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @__chk_fail()
br label %6
6: ; preds = %4, %1
%7 = load i64, i64* @__NFDBITS
%8 = udiv i64 %0, %7
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigpause(int /*<<< orphan*/ const);
int sigsuspend(const sigset_t *sigmask) { sigpause(*sigmask); }


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

x86 assembly (clang, -O2):
<sigsuspend>:
mov    (%rdi),%edi
jmp    1030 <sigpause@plt>

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

LLVM IR (-O2):
define i32 @sigsuspend(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @sigpause(i32 %2)
ret i32 undef
}
/* Variables and functions */
char *dirname(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char *uniquestr(char *);
const char *give_dirname(const char *c) {
  char *tmp = strdup(c);
  char *dirname_tmp = dirname(tmp);
  const char *result = uniquestr(dirname_tmp);
  free(tmp);
  return result;
}


x86 assembly (clang, -O0):
<give_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <uniquestr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_dirname>:
push   %r14
push   %rbx
push   %rax
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <uniquestr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @give_dirname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @dirname(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i8* @uniquestr(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @give_dirname(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @dirname(i8* %2)
%4 = tail call i8* @uniquestr(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint64_t;

/* Variables and functions */
int get_tsc_ticks_per_sec(void *data) {
  uint64_t ticks;
  uint8_t *srcticks = (uint8_t *)(&ticks) + sizeof(uint64_t) - 1;
  uint8_t *dstticks = (uint8_t *)data;
  int i;
  ticks = (uint64_t)0x999e36LL;
  for (i = 0; i < sizeof(uint64_t); i++)
    *dstticks++ = *srcticks--;
  return 1;
}


x86 assembly (clang, -O0):
<get_tsc_ticks_per_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rax
add    $0x20,%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x999e36,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x8,%rax
jae    116d <get_tsc_ticks_per_sec+0x6d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <get_tsc_ticks_per_sec+0x2f>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tsc_ticks_per_sec>:
movabs $0x999e3600000000,%rax
mov    %rax,0x18(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_tsc_ticks_per_sec(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 24
%3 = bitcast i8* %2 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 28
%5 = bitcast i8* %4 to i32*
store i32 0, i32* %3
store i32 10067510, i32* %5
ret i32 1
}
void av_twofish_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_twofish_alloc() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(scalar_t__);
void reb_tools_init_srand() {
  struct timeval tim;
  gettimeofday(&tim, NULL);
  srand(tim.tv_usec + getpid());
}


x86 assembly (clang, -O0):
<reb_tools_init_srand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
add    %rax,%rdi
call   1050 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_tools_init_srand>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i64 }
define void @reb_tools_init_srand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = call i64 (...) @getpid()
%6 = add nsw i64 %4, %5
%7 = call i32 @srand(i64 %6)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define void @reb_tools_init_srand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = tail call i64 (...) @getpid()
%7 = add nsw i64 %6, %5
%8 = tail call i32 @srand(i64 %7)
ret void
}
int _min_number(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<_min_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <_min_number+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_min_number+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_min_number>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @_min_number(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void malloc_check(uint8_t *check_me, char *name) {
  if (check_me == NULL) {
    fprintf(stderr, "%s malloc error\n", name);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<malloc_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <malloc_check+0x3e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_check>:
test   %rdi,%rdi
je     1126 <malloc_check+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check(i32* readnone %0, i8* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void thread_self_exit() { pthread_exit(0); }


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

x86 assembly (clang, -O2):
<thread_self_exit>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @thread_self_exit() {
%1 = call i32 @pthread_exit(i32 0)
ret void
}

LLVM IR (-O2):
define void @thread_self_exit() {
%1 = tail call i32 @pthread_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float litros;
  scanf("%f", &litros);
  printf("%f", litros / 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
divss  0xeb9(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fdiv float %4, 1.000000e+03
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fdiv float %4, 1.000000e+03
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswalpha(int /*<<< orphan*/);
int __iswalpha_l(wint_t c, locale_t l) { return iswalpha(c); }


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

x86 assembly (clang, -O2):
<__iswalpha_l>:
jmp    1030 <iswalpha@plt>

LLVM IR (-O0):
define i32 @__iswalpha_l(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 = call i32 @iswalpha(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__iswalpha_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswalpha(i32 %0)
ret i32 %3
}