xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SDL_free(void *);
void mz_free(void *p) { SDL_free(p); }


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

x86 assembly (clang, -O2):
<mz_free>:
jmp    1030 <SDL_free@plt>

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

LLVM IR (-O2):
define void @mz_free(i8* %0) {
%2 = tail call i32 @SDL_free(i8* %0)
ret void
}
/* Variables and functions */
int gethostname(char *, long);
int gethostname_c4_(char *hostname, long len_hostname) {
  int result;
  result = gethostname(hostname, len_hostname);
  return result;
}


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

x86 assembly (clang, -O2):
<gethostname_c4_>:
jmp    1030 <gethostname@plt>

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

LLVM IR (-O2):
define i32 @gethostname_c4_(i8* %0, i64 %1) {
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putstr_fd(char const *s, int fd) { write(fd, s, ft_strlen(s)); }


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ mpop();
int /*<<< orphan*/ mpush(scalar_t__);
void oneminus() { mpush(mpop() - 1); }


x86 assembly (clang, -O0):
<oneminus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpop@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1040 <mpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oneminus>:
push   %rax
xor    %eax,%eax
call   1030 <mpop@plt>
lea    -0x1(%rax),%rdi
pop    %rax
jmp    1040 <mpush@plt>

LLVM IR (-O0):
define void @oneminus() {
%1 = call i64 (...) @mpop()
%2 = sub nsw i64 %1, 1
%3 = call i32 @mpush(i64 %2)
ret void
}

LLVM IR (-O2):
define void @oneminus() {
%1 = tail call i64 (...) @mpop()
%2 = add nsw i64 %1, -1
%3 = tail call i32 @mpush(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("that is the word");
  printf("\b");
  printf("\b");
  printf("l\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"that is the word\00"
@.str.1 = [2 x i8] c"\08\00"
@.str.2 = [3 x i8] c"l\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"that is the word\00"
@str = [2 x i8] c"l\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 8)
%3 = tail call i32 @putchar(i32 8)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
OP(op, df) { RST(0x18); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x18,%edi
mov    $0x0,%al
call   1030 <RST@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
mov    $0x18,%edi
xor    %eax,%eax
jmp    1030 <RST@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 24)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 24)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ leave(int /*<<< orphan*/);
void crash(void) { leave(0); }


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

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

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

LLVM IR (-O2):
define void @crash() {
%1 = tail call i32 @leave(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  if (argv[1] == NULL) {
    argv[1] = "World";
  }
  printf("Hello %s!", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1144 <main+0x34>
mov    -0x10(%rbp),%rax
lea    0xec0(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rax
mov    0x8(%rsi),%rsi
test   %rsi,%rsi
jne    1128 <main+0x18>
lea    0xedc(%rip),%rsi
mov    %rsi,0x8(%rax)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"World\00"
@.str.1 = [10 x i8] c"Hello %s!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %12
br label %13
13: ; preds = %10, %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"World\00"
@.str.1 = [10 x i8] c"Hello %s!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %2
%8 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %6 ], [ %4, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
/* Variables and functions */
char *GetBitSize() {
  size_t pointerSize = sizeof(intptr_t);
  if (4 == pointerSize) {
    return "32-bits";
  } else if (8 == pointerSize) {
    return "64-bits";
  } else {
    return "Non-standard bits";
  }
}


x86 assembly (clang, -O0):
<GetBitSize>:
push   %rbp
mov    %rsp,%rbp
movq   $0x8,-0x10(%rbp)
mov    $0x4,%eax
cmp    -0x10(%rbp),%rax
jne    112b <GetBitSize+0x2b>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <GetBitSize+0x55>
mov    $0x8,%eax
cmp    -0x10(%rbp),%rax
jne    114a <GetBitSize+0x4a>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <GetBitSize+0x55>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"32-bits\00"
@.str.1 = [8 x i8] c"64-bits\00"
@.str.2 = [18 x i8] c"Non-standard bits\00"
define i8* @GetBitSize() {
%1 = alloca i8*
%2 = alloca i64
store i64 8, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 4, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
6: ; preds = %0
%7 = load i64, i64* %2
%8 = icmp eq i64 8, %7
br i1 %8, label %9, label %10
9: ; preds = %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %11
10: ; preds = %6
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %11
11: ; preds = %10, %9, %5
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"64-bits\00"
define i8* @GetBitSize() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
}
/* Variables and functions */
char *TestFunction();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char *exePath = argv[0];
  (void)argc;
  fprintf(stdout, "2: %s: Called %s", exePath, TestFunction());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <TestFunction@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe93(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <TestFunction@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"2: %s: Called %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i32, i32* %4
%11 = load i32, i32* @stdout
%12 = load i8*, i8** %6
%13 = call i8* (...) @TestFunction()
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"2: %s: Called %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i32, i32* @stdout
%5 = tail call i8* (...) @TestFunction()
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int zeile(void) {
  int z;
  printf("Zeile: ");
  scanf("%d", &z);
  fflush(stdin);
  return z;
}


x86 assembly (clang, -O0):
<zeile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeile>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Zeile: \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @zeile() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"Zeile: \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @zeile() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}
adrreg0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= (*((short *)(11111111 & ~(__alignof__(short) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
mov    $0xa98ac6,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <adrreg0adr1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <adrreg0adr1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adr1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    0xa98ac6,%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adrreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* inttoptr (i64 11111110 to i16*)
%10 = icmp sle i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ cdoAbort(char *);
void sinusoidal_to_geo(int gridsize, double *xvals, double *yvals) {
  cdoAbort("proj4 support not compiled in!");
}


x86 assembly (clang, -O0):
<sinusoidal_to_geo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <cdoAbort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"proj4 support not compiled in!\00"
define void @sinusoidal_to_geo(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = call i32 @cdoAbort(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"proj4 support not compiled in!\00"
define void @sinusoidal_to_geo(i32 %0, double* nocapture readnone %1, double* nocapture readnone %2) {
%4 = tail call i32 @cdoAbort(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
void free_tokenized(char *array[]) {
  int i;
  if (!array)
    return;
  for (i = 0; array[i]; ++i)
    free(array[i]);
  free(array);
}


x86 assembly (clang, -O0):
<free_tokenized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_tokenized+0x1c>
jmp    116e <free_tokenized+0x5e>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1165 <free_tokenized+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <free_tokenized+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tokenized>:
test   %rdi,%rdi
je     1150 <free_tokenized+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_tokenized+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_tokenized+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_tokenized(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
void av_opt_get_key_value() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_get_key_value() {
ret void
}
int mm_yy_flex_strlen(const char *s) {
  register int n;
  for (n = 0; s[n]; ++n)
    ;
  return n;
}


x86 assembly (clang, -O0):
<mm_yy_flex_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <mm_yy_flex_strlen+0x34>
jmp    1126 <mm_yy_flex_strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mm_yy_flex_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_yy_flex_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mm_yy_flex_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mm_yy_flex_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int edge_ori(int cubieval) { return cubieval & 1; }


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

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

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

LLVM IR (-O2):
define i32 @edge_ori(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Variables and functions */
void *init_vector_c(int);
void *init_c(int n) { return init_vector_c(n); }


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

x86 assembly (clang, -O2):
<init_c>:
jmp    1030 <init_vector_c@plt>

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

LLVM IR (-O2):
define i8* @init_c(i32 %0) {
%2 = tail call i8* @init_vector_c(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int *, int);
int improved_fibo(int);
void improved_process() {
  int i = 0;
  int vector[35];
  for (; i < 35; i++)
    vector[i] = improved_fibo(i);
  binary_search(vector, 5702887);
}


x86 assembly (clang, -O0):
<improved_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x23,-0x4(%rbp)
jge    115f <improved_process+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <improved_fibo@plt>
mov    %eax,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <improved_process+0x12>
lea    -0x90(%rbp),%rdi
mov    $0x5704e7,%esi
call   1040 <binary_search@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<improved_process>:
push   %rbx
sub    $0x90,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <improved_fibo@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x23,%rbx
jne    1130 <improved_process+0x10>
mov    %rsp,%rdi
mov    $0x5704e7,%esi
call   1040 <binary_search@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @improved_process() {
%1 = alloca i32
%2 = alloca [35 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 35
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @improved_fibo(i32 %7)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [35 x i32], [35 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
%16 = getelementptr inbounds [35 x i32], [35 x i32]* %2, i64 0, i64 0
%17 = call i32 @binary_search(i32* %16, i32 5702887)
ret void
}

LLVM IR (-O2):
define void @improved_process() {
%1 = alloca [35 x i32]
%2 = bitcast [35 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %8, %3 ]
%5 = trunc i64 %4 to i32
%6 = tail call i32 @improved_fibo(i32 %5)
%7 = getelementptr inbounds [35 x i32], [35 x i32]* %1, i64 0, i64 %4
store i32 %6, i32* %7
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 35
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = getelementptr inbounds [35 x i32], [35 x i32]* %1, i64 0, i64 0
%12 = call i32 @binary_search(i32* %11, i32 5702887)
ret void
}
int numcmp(x, y)
long x, y;
{ return x != y; }


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @numcmp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @numcmp(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int calc_col(int n, int index) { return index % n; }


x86 assembly (clang, -O0):
<calc_col>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_col>:
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_col(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int /*<<< orphan*/);
void print(const char *ptr) {
  while (*ptr) {
    outbyte(*ptr++);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <print+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outbyte@plt>
jmp    111c <print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <outbyte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @outbyte(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
struct p7_timer_event {
  int dummy;
};
struct p7_minheap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ heap_insert(struct p7_timer_event *, struct p7_minheap *);
void timer_add_event(struct p7_timer_event *ev, struct p7_minheap *heap) {
  heap_insert(ev, heap);
}


x86 assembly (clang, -O0):
<timer_add_event>:
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 <heap_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_add_event>:
jmp    1030 <heap_insert@plt>

LLVM IR (-O0):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define void @timer_add_event(%struct.p7_timer_event* %0, %struct.p7_minheap* %1) {
%3 = alloca %struct.p7_timer_event*
%4 = alloca %struct.p7_minheap*
store %struct.p7_timer_event* %0, %struct.p7_timer_event** %3
store %struct.p7_minheap* %1, %struct.p7_minheap** %4
%5 = load %struct.p7_timer_event*, %struct.p7_timer_event** %3
%6 = load %struct.p7_minheap*, %struct.p7_minheap** %4
%7 = call i32 @heap_insert(%struct.p7_timer_event* %5, %struct.p7_minheap* %6)
ret void
}

LLVM IR (-O2):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define void @timer_add_event(%struct.p7_timer_event* %0, %struct.p7_minheap* %1) {
%3 = tail call i32 @heap_insert(%struct.p7_timer_event* %0, %struct.p7_minheap* %1)
ret void
}
void foo769() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @trans_pack_free() {
ret void
}
/* Variables and functions */
char *StrFindChar(char *str, char find) {
  while (*str && *str != find) {
    ++str;
  }
  if (!*str) {
    return NULL;
  }
  return str;
}


x86 assembly (clang, -O0):
<StrFindChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1136 <StrFindChar+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1146 <StrFindChar+0x46>
jmp    1157 <StrFindChar+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <StrFindChar+0xe>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1171 <StrFindChar+0x71>
movq   $0x0,-0x8(%rbp)
jmp    1179 <StrFindChar+0x79>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrFindChar>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <StrFindChar+0x21>
cmp    %sil,%cl
jne    1110 <StrFindChar+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @StrFindChar(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %6, i8* null, i8* %4
ret i8* %11
}
void isr_int_BOUND() {}


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

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

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

LLVM IR (-O2):
define void @isr_int_BOUND() {
ret void
}
int array_size(char *a) { return sizeof(a); }


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

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

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

LLVM IR (-O2):
define i32 @array_size(i8* nocapture readnone %0) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ SEC_GPIO_INT0_IRQ0_DriverIRQHandler();
__attribute__((weak)) void SEC_GPIO_INT0_IRQ0_IRQHandler(void) {
  SEC_GPIO_INT0_IRQ0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SEC_GPIO_INT0_IRQ0_IRQHandler() {
%1 = call i32 (...) @SEC_GPIO_INT0_IRQ0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SEC_GPIO_INT0_IRQ0_IRQHandler() {
%1 = tail call i32 (...) @SEC_GPIO_INT0_IRQ0_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t GSM_ADD(int16_t a, int16_t b) {
  int32_t ltmp;
  ltmp = ((int32_t)a) + ((int32_t)b);
  if (ltmp >= 32767)
    return 32767;
  if (ltmp <= (-32767 - 1))
    return (-32767 - 1);
  return ltmp;
}


x86 assembly (clang, -O0):
<GSM_ADD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x7fff,-0x1c(%rbp)
jl     1132 <GSM_ADD+0x32>
movl   $0x7fff,-0x4(%rbp)
jmp    1151 <GSM_ADD+0x51>
cmpl   $0xffff8000,-0x1c(%rbp)
jg     114b <GSM_ADD+0x4b>
movl   $0xffff8000,-0x4(%rbp)
jmp    1151 <GSM_ADD+0x51>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSM_ADD>:
lea    (%rsi,%rdi,1),%eax
cmp    $0xffff8001,%eax
mov    $0xffff8000,%ecx
cmovge %eax,%ecx
cmp    $0x7fff,%ecx
mov    $0x7fff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GSM_ADD(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %8, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 32767
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 32767, i32* %3
br label %21
15: ; preds = %2
%16 = load i32, i32* %6
%17 = icmp sle i32 %16, -32768
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 -32768, i32* %3
br label %21
19: ; preds = %15
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %18, %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @GSM_ADD(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = add nsw i32 %4, %3
%6 = icmp sgt i32 %5, -32768
%7 = select i1 %6, i32 %5, i32 -32768
%8 = icmp slt i32 %7, 32767
%9 = select i1 %8, i32 %7, i32 32767
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void foo(char *argv[]) { bar(argv[1]); }


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

x86 assembly (clang, -O2):
<foo>:
mov    0x8(%rdi),%rdi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @bar(i8* %5)
ret void
}

LLVM IR (-O2):
define void @foo(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @bar(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free_settings();
int /*<<< orphan*/ msg(char *);
void my_exit(int retVal) {
  free_settings();
  msg("Exit.");
  exit(retVal);
}


x86 assembly (clang, -O0):
<my_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <free_settings@plt>
lea    0xeb7(%rip),%rdi
call   1050 <msg@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<my_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <free_settings@plt>
lea    0xebf(%rip),%rdi
call   1050 <msg@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Exit.\00"
define void @my_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @free_settings()
%4 = call i32 @msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Exit.\00"
define void @my_exit(i32 %0) {
%2 = tail call i32 (...) @free_settings()
%3 = tail call i32 @msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_port(int, unsigned char);
void update_cursor(int row, int col) {
  unsigned short position = (row * 80) + col;
  write_port(0x3D4, 0x0F);
  write_port(0x3D5, (unsigned char)(position & 0xFF));
  write_port(0x3D4, 0x0E);
  write_port(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<update_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_cursor>:
push   %rbx
lea    (%rdi,%rdi,4),%ebx
shl    $0x4,%ebx
add    %esi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <write_port@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @update_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @write_port(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @write_port(i32 981, i8 zeroext %15)
%17 = call i32 @write_port(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @write_port(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @update_cursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 80
%4 = add nsw i32 %3, %1
%5 = tail call i32 @write_port(i32 980, i8 zeroext 15)
%6 = trunc i32 %4 to i8
%7 = tail call i32 @write_port(i32 981, i8 zeroext %6)
%8 = tail call i32 @write_port(i32 980, i8 zeroext 14)
%9 = lshr i32 %4, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @write_port(i32 981, i8 zeroext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Hello World!\n");
  system("pause");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ mpf_out_str(int /*<<< orphan*/, int, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void fp_prt(const char *str, mpf_t val) {
  printf("%s", str);
  mpf_out_str(stdout, 10, 60, val);
}


x86 assembly (clang, -O0):
<fp_prt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%ecx
mov    $0xa,%esi
mov    $0x3c,%edx
call   1040 <mpf_out_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_prt>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    $0xa,%esi
mov    $0x3c,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1040 <mpf_out_str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @fp_prt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdout
%8 = load i32, i32* %4
%9 = call i32 @mpf_out_str(i32 %7, i32 10, i32 60, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @fp_prt(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @mpf_out_str(i32 %4, i32 10, i32 60, i32 %1)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDONLY;
int /*<<< orphan*/ open(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  open("/tmp/foo", O_CREAT | O_RDONLY);
  sleep(1200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea1(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <open@plt>
mov    $0x4b0,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <open@plt>
mov    $0x4b0,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/foo\00"
@O_CREAT = global i32 0
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_RDONLY
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 1200)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/foo\00"
@O_CREAT = global i32 0
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_CREAT
%2 = load i32, i32* @O_RDONLY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 1200)
ret i32 0
}
unsigned cvt(unsigned val) {
  switch (val) {
  case 0:
    return 0;
  case 1:
    return 1;
  case 2:
    return 2;
  case 4:
    return 3;
  case 8:
    return 4;
  case 16:
    return 5;
  case 32:
    return 6;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cvt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x20,%rax
ja     1180 <cvt+0x80>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x2,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x3,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x4,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x5,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x6,-0x4(%rbp)
jmp    1187 <cvt+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt>:
xor    %eax,%eax
lea    -0x1(%rdi),%ecx
cmp    $0x1f,%ecx
ja     1134 <cvt+0x34>
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    %edi,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret
mov    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @cvt(i32 %0) {
switch i32 %0, label %8 [
i32 32, label %7
i32 1, label %2
i32 2, label %3
i32 4, label %4
i32 8, label %5
i32 16, label %6
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3, %2
%9 = phi i32 [ 6, %7 ], [ 5, %6 ], [ 4, %5 ], [ 3, %4 ], [ %0, %3 ], [ %0, %2 ], [ 0, %1 ]
ret i32 %9
}