xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: cmp [-l | -s] file1 file2 [skip1 [skip2]]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"usage: cmp [-l | -s] file1 file2 [skip1 [skip2]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"usage: cmp [-l | -s] file1 file2 [skip1 [skip2]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ getAlphabeticXY(int, int, int, char *);
int getNumericCoordinateFromIndex(int, int);
int getAlphabeticXYFromIndexes(int i, int j, int boardSize, char *letters) {
  int x = getNumericCoordinateFromIndex(j, boardSize);
  int y = getNumericCoordinateFromIndex(i, boardSize);
  getAlphabeticXY(x, y, boardSize, letters);
}


x86 assembly (clang, -O0):
<getAlphabeticXYFromIndexes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <getNumericCoordinateFromIndex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <getNumericCoordinateFromIndex@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <getAlphabeticXY@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAlphabeticXYFromIndexes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %edi,%r15d
mov    %esi,%edi
mov    %edx,%esi
call   1030 <getNumericCoordinateFromIndex@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %ebp,%esi
call   1030 <getNumericCoordinateFromIndex@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <getAlphabeticXY@plt>

LLVM IR (-O0):
define i32 @getAlphabeticXYFromIndexes(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @getNumericCoordinateFromIndex(i32 %12, i32 %13)
store i32 %14, i32* %10
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = call i32 @getNumericCoordinateFromIndex(i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %8
%21 = load i8*, i8** %9
%22 = call i32 @getAlphabeticXY(i32 %18, i32 %19, i32 %20, i8* %21)
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @getAlphabeticXYFromIndexes(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @getNumericCoordinateFromIndex(i32 %1, i32 %2)
%6 = tail call i32 @getNumericCoordinateFromIndex(i32 %0, i32 %2)
%7 = tail call i32 @getAlphabeticXY(i32 %5, i32 %6, i32 %2, i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ func_2(int /*<<< orphan*/);
int main(void) {
  func_2(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func_2(i32 0)
ret i32 0
}
int event_del(struct event *ev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.event = type opaque
define i32 @event_del(%struct.event* nocapture readnone %0) {
ret i32 0
}
int test_imm_58int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x58 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_58int64_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, 88
%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_58int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 377957122048
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int SDL_imageFilterShiftRightUintMMX(unsigned char *Src1, unsigned char *Dest,
                                     unsigned int SrcLength, unsigned char N) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterShiftRightUintMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterShiftRightUintMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterShiftRightUintMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 -1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int lex_match_entry(const char *a, const char *b) {
  int c;
  c = strcmp(a + 1, b + 1);
  return c;
}


x86 assembly (clang, -O0):
<lex_match_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_match_entry>:
add    $0x1,%rdi
add    $0x1,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @lex_match_entry(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i32 @strcmp(i8* %7, i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @lex_match_entry(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = tail call i32 @strcmp(i8* %3, i8* %4)
ret i32 %5
}
void __attribute__((__always___, __nodebug__)) _mm_stream_si32(int *p, int a) {
  __builtin_ia32_movnti(p, a);
}


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

x86 assembly (clang, -O2):
<_mm_stream_si32>:
movnti %esi,(%rdi)
ret

LLVM IR (-O0):
define void @_mm_stream_si32(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
store i32 %6, i32* %5
ret void
}

LLVM IR (-O2):
define void @_mm_stream_si32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
void *_palloc(size_t, char *);
void *palloc_malloc(size_t size) { return _palloc(size, "native"); }


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

x86 assembly (clang, -O2):
<palloc_malloc>:
lea    0xee9(%rip),%rsi
jmp    1030 <_palloc@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"native\00"
define i8* @palloc_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @_palloc(i64 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"native\00"
define i8* @palloc_malloc(i64 %0) {
%2 = tail call i8* @_palloc(i64 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
char *strcpy(char *dst, const char *src) {
  char *ptr = dst;
  do {
    *ptr++ = *src;
  } while (*src++ != 0);
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
cmpb   $0x0,(%rsi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %7, %3 ]
%6 = load i8, i8* %4
%7 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %0
}
int sum(x, y, z) {
  x / y;
  z;
  int a = 2 / 0;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
%12 = load i32, i32* %7
store i32 poison, i32* %8
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ draw_edges();
int /*<<< orphan*/ draw_nodes();
void draw_main(void) {
  ;
  ;
  draw_nodes();
  ;
  ;
  draw_edges();
  ;
}


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

x86 assembly (clang, -O2):
<draw_main>:
push   %rax
xor    %eax,%eax
call   1040 <draw_nodes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <draw_edges@plt>

LLVM IR (-O0):
define void @draw_main() {
%1 = call i32 (...) @draw_nodes()
%2 = call i32 (...) @draw_edges()
ret void
}

LLVM IR (-O2):
define void @draw_main() {
%1 = tail call i32 (...) @draw_nodes()
%2 = tail call i32 (...) @draw_edges()
ret void
}
/* Type definitions */
typedef char uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_err(char *, int, int, int /*<<< orphan*/ *);
int strlen(char *);
void toasim_write_str(char *fname, char *str, FILE *file) {
  uint32_t sz = (uint32_t)strlen(str);
  fwrite_err(fname, 4, 1, file);
  fwrite_err(&sz, sizeof(uint32_t), 1, file);
  fwrite_err(str, 1, strlen(str), file);
}


x86 assembly (clang, -O0):
<toasim_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite_err@plt>
mov    -0x18(%rbp),%rcx
lea    -0x19(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite_err@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite_err@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toasim_write_str>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %al,0xf(%rsp)
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1040 <fwrite_err@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @toasim_write_str(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
%11 = load i8*, i8** %4
%12 = load i32*, i32** %6
%13 = call i32 @fwrite_err(i8* %11, i32 4, i32 1, i32* %12)
%14 = load i32*, i32** %6
%15 = call i32 @fwrite_err(i8* %7, i32 1, i32 1, i32* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %5
%18 = call i32 @strlen(i8* %17)
%19 = load i32*, i32** %6
%20 = call i32 @fwrite_err(i8* %16, i32 1, i32 %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @toasim_write_str(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8
%5 = tail call i32 @strlen(i8* %1)
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = tail call i32 @fwrite_err(i8* %0, i32 4, i32 1, i32* %2)
%8 = call i32 @fwrite_err(i8* %4, i32 1, i32 1, i32* %2)
%9 = call i32 @strlen(i8* %1)
%10 = call i32 @fwrite_err(i8* %1, i32 1, i32 %9, i32* %2)
ret void
}
/* Variables and functions */
int isspace(int);
bool invalidFunctionArgBool_isspace(bool b, int c) {
  (void)isspace(b);
  return isspace(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isspace>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isspace@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isspace(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 @isspace(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isspace(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isspace(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isspace(i32 %4)
ret i32 %5
}
void gtk_clipboard_get_display() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_get_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void parentTerminate(int sig) {
  raise(SIGTERM);
  return;
}


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

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

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @parentTerminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGTERM
%4 = call i32 @raise(i32 %3)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @parentTerminate(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @raise(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void writes(const char *s) { write(1, s, strlen(s)); }


x86 assembly (clang, -O0):
<writes>:
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 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @writes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @writes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
char **copyip(cpf, cpt)
char **cpf, **cpt;
{
  register int *ipf, *ipt;
  ipf = (int *)cpf;
  ipt = (int *)cpt;
  while ((*ipt = *ipf) && *ipf++ != -1)
    ipt++;
  *ipt = 0;
  return (char **)ipt;
}


x86 assembly (clang, -O0):
<copyip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     114e <copyip+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0xffffffff,(%rax)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    115e <copyip+0x5e>
jmp    116f <copyip+0x6f>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <copyip+0x1c>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyip>:
mov    %rsi,%rax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
test   %ecx,%ecx
je     1127 <copyip+0x27>
add    $0x4,%rdi
nop
cmpl   $0xffffffff,-0x4(%rdi)
je     1127 <copyip+0x27>
mov    (%rdi),%ecx
mov    %ecx,0x4(%rax)
add    $0x4,%rax
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <copyip+0x10>
movl   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8** @copyip(i8** nocapture %0, i8** writeonly %1) {
%3 = bitcast i8** %0 to i32*
%4 = bitcast i8** %1 to i32*
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %12
%8 = phi i32* [ %14, %12 ], [ %4, %2 ]
%9 = phi i32* [ %13, %12 ], [ %3, %2 ]
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, -1
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = getelementptr inbounds i32, i32* %9, i64 1
%14 = getelementptr inbounds i32, i32* %8, i64 1
%15 = load i32, i32* %13
store i32 %15, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %12, %2
%18 = phi i32* [ %4, %2 ], [ %14, %12 ], [ %8, %7 ]
store i32 0, i32* %18
%19 = bitcast i32* %18 to i8**
ret i8** %19
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc) {
  return strncasecmp(l, r, n);
}


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

x86 assembly (clang, -O2):
<strncasecmp_l>:
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
define i32 @strncasecmp_l(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @strncasecmp(i8* %9, i8* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @strncasecmp_l(i8* nocapture %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %5
}
unsigned char ScaleColor5to8(const unsigned long color) {
  return ((unsigned char)(((color) << 3) | ((color) >> 2)));
}


x86 assembly (clang, -O0):
<ScaleColor5to8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
or     %rcx,%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleColor5to8>:
lea    0x0(,%rdi,8),%eax
shr    $0x2,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @ScaleColor5to8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 3
%5 = load i64, i64* %2
%6 = lshr i64 %5, 2
%7 = or i64 %4, %6
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @ScaleColor5to8(i64 %0) {
%2 = shl i64 %0, 3
%3 = lshr i64 %0, 2
%4 = or i64 %2, %3
%5 = trunc i64 %4 to i8
ret i8 %5
}
int ILibGetLocalIPAddressList(int **pp_int) {}


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

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

LLVM IR (-O0):
define i32 @ILibGetLocalIPAddressList(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 @ILibGetLocalIPAddressList(i32** nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
uint8_t pbe8_to_h(void *v) {
  uint8_t u;
  memcpy(&u, v, sizeof(uint8_t));
  return u;
}


x86 assembly (clang, -O0):
<pbe8_to_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbe8_to_h>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pbe8_to_h(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int sys_asend(unsigned int p1, struct message *p2, unsigned int p3) {
  int a;
  asm volatile("int $0x80"
               : "=a"(a)
               : "0"(3), "b"((int)p1), "c"((int)p2), "d"((int)p3));
  return a;
}


x86 assembly (clang, -O0):
<sys_asend>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x1c(%rbp),%edx
mov    $0x3,%eax
int    $0x80
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_asend>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0x3,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
%struct.message = type opaque
define i32 @sys_asend(i32 %0, %struct.message* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.message*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.message* %1, %struct.message** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.message*, %struct.message** %5
%10 = ptrtoint %struct.message* %9 to i32
%11 = load i32, i32* %6
%12 = call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 3, i32 %8, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
%struct.message = type opaque
define i32 @sys_asend(i32 %0, %struct.message* %1, i32 %2) {
%4 = ptrtoint %struct.message* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 3, i32 %0, i32 %5, i32 %2)
ret i32 %6
}
void INT_Excep_MTU6_TGIV6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU6_TGIV6() {
ret void
}
/* Variables and functions */
int tty_getch();
int bs_getch_raw(void) { return tty_getch(); }


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

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

LLVM IR (-O0):
define i32 @bs_getch_raw() {
%1 = call i32 (...) @tty_getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bs_getch_raw() {
%1 = tail call i32 (...) @tty_getch()
ret i32 %1
}
void fpfixup(void) {}


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

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

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

LLVM IR (-O2):
define void @fpfixup() {
ret void
}
void SysCtlGPIOAHBDisable(unsigned long ulGPIOPeripheral) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FE06C))) &= ~(ulGPIOPeripheral & 0x1FF);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlGPIOAHBDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
and    $0x1ff,%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fe06c,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fe06c,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlGPIOAHBDisable>:
not    %edi
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
or     $0xfffffffffffffe00,%rdi
and    %rdi,0x400fe06c
40
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @SysCtlGPIOAHBDisable(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %4, i64* %3
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %5, 511
%7 = xor i64 %6, -1
%8 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%9 = and i64 %8, %7
store volatile i64 %9, i64* inttoptr (i64 1074782316 to i64*)
%10 = load i64, i64* %3
store volatile i64 %10, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlGPIOAHBDisable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = and i64 %0, 511
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074782316 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074782316 to i64*)
store volatile i64 %2, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float Q_fabs(float f) {
  union {
    uint32_t l;
    float f;
  } tmp;
  tmp.f = f;
  tmp.l &= 0x7FFFFFFF;
  return tmp.f;
}


x86 assembly (clang, -O0):
<Q_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @Q_fabs(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %6
%9 = bitcast %union.anon* %3 to float*
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @Q_fabs(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = bitcast i32 %3 to float
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p384_sub(uint64_t out1[6], const uint64_t arg1[6],
                   const uint64_t arg2[6]) {
  internal_fiat_p384_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p384_sub>:
jmp    1030 <internal_fiat_p384_sub@plt>

LLVM IR (-O0):
define void @fiat_p384_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p384_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p384_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int strlen(char *);
void replace_break_line_into_space(char *string) {
  int position = strlen(string) - 1;
  if (string[position] == '\n') {
    string[position] = ' ';
  }
}


x86 assembly (clang, -O0):
<replace_break_line_into_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <replace_break_line_into_space+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_break_line_into_space>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <replace_break_line_into_space+0x17>
movb   $0x20,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @replace_break_line_into_space(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 32, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int execvp(const char *file, char *const argv[]) {
  ;
  typeof(execvp) *orig_execvp = osym("execvp");
  interpose_fini();
  int rc = (*orig_execvp)(file, argv);
  interpose_init();
  return rc;
}


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1050 <osym@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <interpose_fini@plt>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <interpose_init@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1050 <osym@plt>
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <interpose_fini@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   *%rbx
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <interpose_init@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"execvp\00"
define i32 @execvp(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32 (i8*, i8**)*
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32 (i8*, i8**)*
store i32 (i8*, i8**)* %9, i32 (i8*, i8**)** %5
%10 = call i32 (...) @interpose_fini()
%11 = load i32 (i8*, i8**)*, i32 (i8*, i8**)** %5
%12 = load i8*, i8** %3
%13 = load i8**, i8*** %4
%14 = call i32 %11(i8* %12, i8** %13)
store i32 %14, i32* %6
%15 = call i32 (...) @interpose_init()
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"execvp\00"
define i32 @execvp(i8* %0, i8** %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i8*, i8**)*
%6 = tail call i32 (...) @interpose_fini()
%7 = tail call i32 %5(i8* %0, i8** %1)
%8 = tail call i32 (...) @interpose_init()
ret i32 %7
}
void stap_stop_task_finder(void) { ; }


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

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

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

LLVM IR (-O2):
define void @stap_stop_task_finder() {
ret void
}
int test3(double a, float b) { return __builtin_isless(a, b); }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
cvtss2sd %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @test3(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp olt double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test3(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fcmp ogt double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
jmp    1109 <foo+0x9>

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

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
size_t sysconf(int /*<<< orphan*/);
size_t gu_page_size() { return sysconf(_SC_PAGESIZE); }


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

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

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i64 @gu_page_size() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @gu_page_size() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long mytime() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<mytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @mytime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @mytime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void malloc_array_bad_FN(int len) {
  char *o = (char *)malloc(len);
  if (o) {
    o[0] = 'a';
    char c = o[1];
  }
  free(o);
}


x86 assembly (clang, -O0):
<malloc_array_bad_FN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <malloc_array_bad_FN+0x33>
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_array_bad_FN>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112e <malloc_array_bad_FN+0xe>
movb   $0x61,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @malloc_array_bad_FN(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 97, i8* %3
br label %6
6: ; preds = %5, %1
%7 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_screen(int);
void disp_clear() { fill_screen(((5 << 11) + (5 << 5) + 5)); }


x86 assembly (clang, -O0):
<disp_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28a5,%edi
call   1030 <fill_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_clear>:
mov    $0x28a5,%edi
jmp    1030 <fill_screen@plt>

LLVM IR (-O0):
define void @disp_clear() {
%1 = call i32 @fill_screen(i32 10405)
ret void
}

LLVM IR (-O2):
define void @disp_clear() {
%1 = tail call i32 @fill_screen(i32 10405)
ret void
}
/* Variables and functions */
int inv_row_2_scale(char const *);
unsigned short inv_orientation_matrix_to_scalar(const signed char *mtx) {
  unsigned short scalar;
  scalar = inv_row_2_scale(mtx);
  scalar |= inv_row_2_scale(mtx + 3) << 3;
  scalar |= inv_row_2_scale(mtx + 6) << 6;
  return scalar;
}


x86 assembly (clang, -O0):
<inv_orientation_matrix_to_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inv_row_2_scale@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
call   1030 <inv_row_2_scale@plt>
mov    %eax,%ecx
shl    $0x3,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
call   1030 <inv_row_2_scale@plt>
mov    %eax,%ecx
shl    $0x6,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_orientation_matrix_to_scalar>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <inv_row_2_scale@plt>
mov    %eax,%r14d
lea    0x3(%rbx),%rdi
call   1030 <inv_row_2_scale@plt>
mov    %eax,%ebp
shl    $0x3,%ebp
or     %r14d,%ebp
add    $0x6,%rbx
mov    %rbx,%rdi
call   1030 <inv_row_2_scale@plt>
shl    $0x6,%eax
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @inv_orientation_matrix_to_scalar(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @inv_row_2_scale(i8* %4)
%6 = trunc i32 %5 to i16
store i16 %6, i16* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = call i32 @inv_row_2_scale(i8* %8)
%10 = shl i32 %9, 3
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = or i32 %12, %10
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 6
%17 = call i32 @inv_row_2_scale(i8* %16)
%18 = shl i32 %17, 6
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = or i32 %20, %18
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @inv_orientation_matrix_to_scalar(i8* %0) {
%2 = tail call i32 @inv_row_2_scale(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = tail call i32 @inv_row_2_scale(i8* %3)
%5 = shl i32 %4, 3
%6 = or i32 %5, %2
%7 = getelementptr inbounds i8, i8* %0, i64 6
%8 = tail call i32 @inv_row_2_scale(i8* %7)
%9 = shl i32 %8, 6
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}
/* Variables and functions */
int CFSwapInt32(int);
int intValueFrom(unsigned char *bstr) {
  int retValue;
  retValue = CFSwapInt32(*((int *)bstr));
  return retValue;
}


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

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

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

LLVM IR (-O2):
define i32 @intValueFrom(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @CFSwapInt32(i32 %3)
ret i32 %4
}
/* Variables and functions */
int do_d(char **, int /*<<< orphan*/);
int cmd_d(char **argv) { return do_d(argv, 0); }


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

x86 assembly (clang, -O2):
<cmd_d>:
xor    %esi,%esi
jmp    1030 <do_d@plt>

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

LLVM IR (-O2):
define i32 @cmd_d(i8** %0) {
%2 = tail call i32 @do_d(i8** %0, i32 0)
ret i32 %2
}