xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ mycrypt(char *, char *);
char *ib_password(char *val) {
  val = (char *)mycrypt(val, "9z");
  val = (char *)(mycrypt(val + 2, "9z") + 2);
  return (char *)val;
}


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

x86 assembly (clang, -O2):
<ib_password>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <mycrypt@plt>
lea    0x2(%rax),%rdi
mov    %rbx,%rsi
call   1030 <mycrypt@plt>
add    $0x2,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"9z\00"
define i8* @ib_password(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mycrypt(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i64 @mycrypt(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = add nsw i64 %8, 2
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %2
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"9z\00"
define i8* @ib_password(i8* %0) {
%2 = tail call i64 @mycrypt(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = inttoptr i64 %2 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = tail call i64 @mycrypt(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i64 %5, 2
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
int main() {
  if (!4) {
    return 3;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Type definitions */
typedef char server;
typedef char channel;

/* Variables and functions */
int /*<<< orphan*/ UNUSED(char *);
int irc_send_command(struct server *s, struct channel *c, char *m) {
  UNUSED(s);
  UNUSED(c);
  UNUSED(m);
  return 0;
}


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

x86 assembly (clang, -O2):
<irc_send_command>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <UNUSED@plt>
mov    %rbx,%rdi
call   1030 <UNUSED@plt>
mov    %r14,%rdi
call   1030 <UNUSED@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.server = type opaque
%struct.channel = type opaque
define i32 @irc_send_command(%struct.server* %0, %struct.channel* %1, i8* %2) {
%4 = alloca %struct.server*
%5 = alloca %struct.channel*
%6 = alloca i8*
store %struct.server* %0, %struct.server** %4
store %struct.channel* %1, %struct.channel** %5
store i8* %2, i8** %6
%7 = load %struct.server*, %struct.server** %4
%8 = bitcast %struct.server* %7 to i8*
%9 = call i32 @UNUSED(i8* %8)
%10 = load %struct.channel*, %struct.channel** %5
%11 = bitcast %struct.channel* %10 to i8*
%12 = call i32 @UNUSED(i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @UNUSED(i8* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.server = type opaque
%struct.channel = type opaque
define i32 @irc_send_command(%struct.server* %0, %struct.channel* %1, i8* %2) {
%4 = bitcast %struct.server* %0 to i8*
%5 = tail call i32 @UNUSED(i8* %4)
%6 = bitcast %struct.channel* %1 to i8*
%7 = tail call i32 @UNUSED(i8* %6)
%8 = tail call i32 @UNUSED(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int is_inputconf(const char *key) { return !strcmp(key, "stdin"); }


x86 assembly (clang, -O0):
<is_inputconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inputconf>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"stdin\00"
define i32 @is_inputconf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"stdin\00"
define i32 @is_inputconf(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CiStrError(short, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void CiPerror(short int cierrno, const char *s) {
  char buf[128];
  CiStrError(cierrno, buf, 127);
  fprintf(stderr, "%s: %s\n", s, buf);
  return;
}


x86 assembly (clang, -O0):
<CiPerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
lea    -0x90(%rbp),%rsi
mov    $0x7f,%edx
movswl %ax,%edi
call   1030 <CiStrError@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CiPerror>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x7f,%edx
call   1030 <CiStrError@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @CiPerror(i16 signext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca [128 x i8]
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i16, i16* %3
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = call i32 @CiStrError(i16 signext %6, i8* %7, i32 127)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @CiPerror(i16 signext %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @CiStrError(i16 signext %0, i8* %4, i32 127)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ inc(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int n;
  n = atoi(argv[1]);
  inc(&n);
  printf("%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <inc@plt>
mov    -0x14(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <inc@plt>
mov    0x4(%rsp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
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 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = call i32 @inc(i32* %6)
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
store i32 %7, i32* %3
%8 = call i32 @inc(i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writesysreq(char);
void reboot() { writesysreq('b'); }


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

x86 assembly (clang, -O2):
<reboot>:
mov    $0x62,%edi
jmp    1030 <writesysreq@plt>

LLVM IR (-O0):
define void @reboot() {
%1 = call i32 @writesysreq(i8 signext 98)
ret void
}

LLVM IR (-O2):
define void @reboot() {
%1 = tail call i32 @writesysreq(i8 signext 98)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a[10];
  int32_t i;
  for (i = 0; i < 10; i = i + 1) {
    a[i] = i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    112e <main+0x2e>
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xcf() {
  Assert_real((isupper(207) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1040, ("isupper should be 0 for 0xcf"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xcf\00"
define void @t_isupper_0xcf() {
%1 = tail call i64 @isupper(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void SwapInutile(int a, int b) {
  int temp = a;
  a = b;
  b = temp;
}


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

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

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

LLVM IR (-O2):
define void @SwapInutile(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t byte_even(const uint8_t byte) { return ~byte & 1; }


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

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

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

LLVM IR (-O2):
define i32 @byte_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fact(int n) {
  if (n == 0) {
    printf("n = %d , résultat *1.\n", n);
    return 1;
  } else {
    printf("n = %d , résultat *n.\n", n);
    return n * fact(n - 1);
  }
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1150 <fact+0x30>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117b <fact+0x5b>
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fact@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1144 <fact+0x34>
mov    %edi,%ebp
mov    $0x1,%ebx
lea    0xef2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
imul   %ebp,%ebx
add    $0xffffffff,%ebp
jne    1130 <fact+0x20>
jmp    1149 <fact+0x39>
mov    $0x1,%ebx
lea    0xeb0(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"n = %d , r\C3\A9sultat *1.\0A\00"
@.str.1 = [24 x i8] c"n = %d , r\C3\A9sultat *n.\0A\00"
define i32 @fact(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = call i32 @fact(i32 %14)
%16 = mul nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"n = %d , r\C3\A9sultat *1.\0A\00"
@.str.1 = [24 x i8] c"n = %d , r\C3\A9sultat *n.\0A\00"
define i32 @fact(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %6, %1
%4 = phi i32 [ 1, %1 ], [ %11, %6 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %0, %1 ]
%8 = phi i32 [ %11, %6 ], [ 1, %1 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = add nsw i32 %7, -1
%11 = mul nsw i32 %7, %8
%12 = icmp eq i32 %10, 0
br i1 %12, label %3, label %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int *v1 = (int *)malloc(32767000000000 * sizeof(int));
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 -1516972032)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 -1516972032)
ret i32 0
}
void gtk_text_iter_backward_visible_word_start() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_visible_word_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_no_fold_quote_free(char *nfq) { free(nfq); }


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

x86 assembly (clang, -O2):
<mailimf_no_fold_quote_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_no_fold_quote_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned long elf_hash(const unsigned char *name) {
  unsigned int h = 0, g;
  while (*name != '\0') {
    h = (h << 4) + *name++;
    if ((g = h & 0xf0000000)) {
      h ^= g >> 24;
    }
    h &= ~g;
  }
  return h;
}


x86 assembly (clang, -O0):
<elf_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     116d <elf_hash+0x6d>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf0000000,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     115c <elf_hash+0x5c>
mov    -0x10(%rbp),%eax
shr    $0x18,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <elf_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_hash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     113a <elf_hash+0x3a>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl %cl,%ecx
shl    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf0000000,%ecx
mov    %ecx,%edx
shr    $0x18,%edx
xor    %eax,%edx
not    %ecx
mov    %ecx,%eax
and    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <elf_hash+0x10>
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @elf_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %31
10: ; preds = %5
%11 = load i32, i32* %3
%12 = shl i32 %11, 4
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = add i32 %12, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = and i32 %18, -268435456
store i32 %19, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %10
%22 = load i32, i32* %4
%23 = lshr i32 %22, 24
%24 = load i32, i32* %3
%25 = xor i32 %24, %23
store i32 %25, i32* %3
br label %26
26: ; preds = %21, %10
%27 = load i32, i32* %4
%28 = xor i32 %27, -1
%29 = load i32, i32* %3
%30 = and i32 %29, %28
store i32 %30, i32* %3
br label %5
31: ; preds = %5
%32 = load i32, i32* %3
%33 = zext i32 %32 to i64
ret i64 %33
}

LLVM IR (-O2):
define i64 @elf_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %21, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %16, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = shl i32 %7, 4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, %8
%12 = and i32 %11, -268435456
%13 = lshr exact i32 %12, 24
%14 = xor i32 %13, %11
%15 = xor i32 %12, -1
%16 = and i32 %14, %15
%17 = load i8, i8* %10
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4
%20 = zext i32 %16 to i64
br label %21
21: ; preds = %19, %1
%22 = phi i64 [ 0, %1 ], [ %20, %19 ]
ret i64 %22
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
float maths_fast_inv_sqrt(float number) {
  union {
    float f;
    int32_t l;
  } i;
  float x, y;
  const float f = 1.5f;
  x = number * 0.5f;
  i.f = number;
  i.l = 0x5f3759df - (i.l >> 1);
  y = i.f;
  y = y * (f - (x * y * y));
  return y;
}


x86 assembly (clang, -O0):
<maths_fast_inv_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe87(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_fast_inv_sqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @maths_fast_inv_sqrt(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 1.500000e+00, float* %6
%7 = load float, float* %2
%8 = fmul float %7, 5.000000e-01
store float %8, float* %4
%9 = load float, float* %2
%10 = bitcast %union.anon* %3 to float*
store float %9, float* %10
%11 = bitcast %union.anon* %3 to i32*
%12 = load i32, i32* %11
%13 = ashr i32 %12, 1
%14 = sub nsw i32 1597463007, %13
%15 = bitcast %union.anon* %3 to i32*
store i32 %14, i32* %15
%16 = bitcast %union.anon* %3 to float*
%17 = load float, float* %16
store float %17, float* %5
%18 = load float, float* %5
%19 = load float, float* %4
%20 = load float, float* %5
%21 = fmul float %19, %20
%22 = load float, float* %5
%23 = fneg float %21
%24 = call float @llvm.fmuladd.f32(float %23, float %22, float 1.500000e+00)
%25 = fmul float %18, %24
store float %25, float* %5
%26 = load float, float* %5
ret float %26
}

LLVM IR (-O2):
define float @maths_fast_inv_sqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
void debug_dmem_freed(struct imx21 *imx21, int size) {}


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

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

LLVM IR (-O0):
%struct.imx21 = type opaque
define void @debug_dmem_freed(%struct.imx21* %0, i32 %1) {
%3 = alloca %struct.imx21*
%4 = alloca i32
store %struct.imx21* %0, %struct.imx21** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.imx21 = type opaque
define void @debug_dmem_freed(%struct.imx21* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int safe_read(int, char *, int);
int /*<<< orphan*/ safe_write(int, char *, int);
void echo_server(int fd) {
  int size;
  char buffer[512];
  for (; (size = safe_read(fd, buffer, sizeof buffer));)
    safe_write(fd, buffer, size);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<echo_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
call   1030 <safe_read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1175 <echo_server+0x45>
mov    -0x4(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <safe_write@plt>
jmp    113e <echo_server+0xe>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<echo_server>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0x200,%edx
call   1030 <safe_read@plt>
test   %eax,%eax
je     116f <echo_server+0x3f>
mov    %rsp,%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <safe_write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x200,%edx
call   1030 <safe_read@plt>
test   %eax,%eax
jne    1150 <echo_server+0x20>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @echo_server(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [512 x i8]
store i32 %0, i32* %2
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%8 = call i32 @safe_read(i32 %6, i8* %7, i32 512)
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32, i32* %2
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 @safe_write(i32 %11, i8* %12, i32 %13)
br label %5
15: ; preds = %5
%16 = load i32, i32* @EXIT_SUCCESS
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @echo_server(i32 %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @safe_read(i32 %0, i8* %3, i32 512)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %4, %1 ]
%8 = call i32 @safe_write(i32 %0, i8* %3, i32 %7)
%9 = call i32 @safe_read(i32 %0, i8* %3, i32 512)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ waitpid(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  printf("[init] start!\n");
  pid_t pid = fork();
  if (pid == 0) {
    execv("/bin/sh", argv);
    exit(127);
  } else {
    waitpid(pid, 0, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a2 <main+0x52>
mov    -0x10(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1060 <execv@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <waitpid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
je     117c <main+0x2c>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <waitpid@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe7d(%rip),%rdi
mov    %rbx,%rsi
call   1060 <execv@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"[init] start!\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i64 (...) @fork()
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %12)
%14 = call i32 @exit(i32 127)
unreachable
15: ; preds = %2
%16 = load i64, i64* %6
%17 = call i32 @waitpid(i64 %16, i32 0, i32 0)
br label %18
18: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [14 x i8] c"[init] start!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 (...) @fork()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%8 = tail call i32 @exit(i32 127)
unreachable
9: ; preds = %2
%10 = tail call i32 @waitpid(i64 %4, i32 0, i32 0)
ret i32 0
}
char *dc_dir_level(char *p_oid) { return "/"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @dc_dir_level(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @dc_dir_level(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ find(int *, int, int *, int *);
int test_negative_elements() {
  int one = 0;
  int two = 0;
  int array[] = {-5, -2, 9, -5, -3, 1, 9, -2};
  find(array, 8, &one, &two);
  return -3 == one && 1 == two;
}


x86 assembly (clang, -O0):
<test_negative_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <find@plt>
xor    %eax,%eax
mov    $0xfffffffd,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x31(%rbp)
jne    1189 <test_negative_elements+0x79>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative_elements>:
sub    $0x38,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x8,%esi
call   1030 <find@plt>
mov    0xc(%rsp),%ecx
xor    $0xfffffffd,%ecx
mov    0x8(%rsp),%edx
xor    $0x1,%edx
xor    %eax,%eax
or     %ecx,%edx
sete   %al
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_negative_elements.array = [8 x i32] [i32 -5, i32 -2, i32 9, i32 -5, i32 -3, i32 1, i32 9, i32 -2]
define i32 @test_negative_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @find(i32* %5, i32 8, i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = icmp eq i32 -3, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 1, %10
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@__const.test_negative_elements.array = [8 x i32] [i32 -5, i32 -2, i32 9, i32 -5, i32 -3, i32 1, i32 9, i32 -2]
define i32 @test_negative_elements() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast [8 x i32]* %3 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 @find(i32* %7, i32 8, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, -3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
char *strdup(char *);
char *tag_version(int argc, char *argv[]) { return strdup("0.4.4"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.4.4\00"
define i8* @tag_version(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.4.4\00"
define noalias i8* @tag_version(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(6) i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int bmp_isempty(uint8_t *buf, size_t buflen) {
  uint8_t *bufend = buf + buflen;
  while (buf < bufend) {
    if (*(buf++)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<bmp_isempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1156 <bmp_isempty+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
je     1151 <bmp_isempty+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <bmp_isempty+0x5d>
jmp    111f <bmp_isempty+0x1f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp_isempty>:
lea    (%rdi,%rsi,4),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %rax,%rdi
jae    1121 <bmp_isempty+0x21>
cmpl   $0x0,(%rdi)
lea    0x4(%rdi),%rdi
je     1110 <bmp_isempty+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bmp_isempty(i32* %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
br label %4
4: ; preds = %7, %2
%5 = phi i32* [ %0, %2 ], [ %8, %7 ]
%6 = icmp ult i32* %5, %3
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i32, i32* %5, i64 1
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %7
%12 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
yymallocerror() {
  printf("running out of memory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<yymallocerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [23 x i8] c"running out of memory\0A\00"
define i32 @yymallocerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"running out of memory\00"
define i32 @yymallocerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
double cos_73s(double x) {
  static const double c1 = 0.999999953464;
  static const double c2 = -0.499999053455;
  static const double c3 = 0.0416635846769;
  static const double c4 = -0.0013853704264;
  static const double c5 = 0.00002315393167;
  double x2;
  x2 = x * x;
  return (c1 + x2 * (c2 + x2 * (c3 + x2 * (c4 + c5 * x2))));
}


x86 assembly (clang, -O0):
<cos_73s>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  0xee4(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xee0(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xec0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea8(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_73s>:
mulsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
@cos_73s.c1 = internal constant double 0x3FEFFFFFE704240F
@cos_73s.c2 = internal constant double 0xBFDFFFFC07A7B10B
@cos_73s.c3 = internal constant double 0x3FA554EDEB3E29BE
@cos_73s.c4 = internal constant double 0xBF56B2AA2B26A495
@cos_73s.c5 = internal constant double 0x3EF8475611992C86
define double @cos_73s(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double 0x3EF8475611992C86, double %10, double 0xBF56B2AA2B26A495)
%12 = call double @llvm.fmuladd.f64(double %9, double %11, double 0x3FA554EDEB3E29BE)
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double 0xBFDFFFFC07A7B10B)
%14 = call double @llvm.fmuladd.f64(double %7, double %13, double 0x3FEFFFFFE704240F)
ret double %14
}

LLVM IR (-O2):
define double @cos_73s(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3EF8475611992C86, double 0xBF56B2AA2B26A495)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0x3FA554EDEB3E29BE)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0xBFDFFFFC07A7B10B)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x3FEFFFFFE704240F)
ret double %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char intToHexChar(uint8_t i) {
  if (i < 10) {
    return '0' + i;
  }
  return 'a' + i - 10;
}


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

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

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

LLVM IR (-O2):
define signext i8 @intToHexChar(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
int /*<<< orphan*/ rtrim(char *);
void trim(char *str) {
  ltrim(str);
  rtrim(str);
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ltrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rtrim@plt>

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

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @ltrim(i8* %0)
%3 = tail call i32 @rtrim(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HwMdSetNTable(char);
int /*<<< orphan*/ HwMdSetOffset(int);
void HwMdPutc(char chr, int color, int x, int y) {
  HwMdSetOffset(((y << 6) | x) << 1);
  HwMdSetNTable(((chr - 0x20) & 0xFF) | color);
}


x86 assembly (clang, -O0):
<HwMdPutc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
shl    $0x6,%edi
or     -0xc(%rbp),%edi
shl    $0x1,%edi
call   1040 <HwMdSetOffset@plt>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
and    $0xff,%eax
or     -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <HwMdSetNTable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwMdPutc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
shl    $0x7,%ecx
lea    (%rdx,%rdx,1),%edi
or     %ecx,%edi
call   1040 <HwMdSetOffset@plt>
add    $0xe0,%bpl
or     %bpl,%bl
movsbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <HwMdSetNTable@plt>

LLVM IR (-O0):
define void @HwMdPutc(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = shl i32 %9, 6
%11 = load i32, i32* %7
%12 = or i32 %10, %11
%13 = shl i32 %12, 1
%14 = call i32 @HwMdSetOffset(i32 %13)
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 32
%18 = and i32 %17, 255
%19 = load i32, i32* %6
%20 = or i32 %18, %19
%21 = trunc i32 %20 to i8
%22 = call i32 @HwMdSetNTable(i8 signext %21)
ret void
}

LLVM IR (-O2):
define void @HwMdPutc(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 7
%6 = shl i32 %2, 1
%7 = or i32 %5, %6
%8 = tail call i32 @HwMdSetOffset(i32 %7)
%9 = add i8 %0, -32
%10 = trunc i32 %1 to i8
%11 = or i8 %9, %10
%12 = tail call i32 @HwMdSetNTable(i8 signext %11)
ret void
}
char toUpper(char c) { return c - 'a' + 'A'; }


x86 assembly (clang, -O0):
<toUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpper>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @toUpper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 97
%6 = add nsw i32 %5, 65
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @toUpper(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
char biosal_dna_helper_complement_nucleotide(char nucleotide) {
  if (nucleotide == 'A') {
    return 'T';
  } else if (nucleotide == 'G') {
    return 'C';
  } else if (nucleotide == 'T') {
    return 'A';
  } else {
    return 'G';
  }
  return nucleotide;
}


x86 assembly (clang, -O0):
<biosal_dna_helper_complement_nucleotide>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jne    1120 <biosal_dna_helper_complement_nucleotide+0x20>
movb   $0x54,-0x1(%rbp)
jmp    1150 <biosal_dna_helper_complement_nucleotide+0x50>
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    1136 <biosal_dna_helper_complement_nucleotide+0x36>
movb   $0x43,-0x1(%rbp)
jmp    1150 <biosal_dna_helper_complement_nucleotide+0x50>
movsbl -0x2(%rbp),%eax
cmp    $0x54,%eax
jne    114c <biosal_dna_helper_complement_nucleotide+0x4c>
movb   $0x41,-0x1(%rbp)
jmp    1150 <biosal_dna_helper_complement_nucleotide+0x50>
movb   $0x47,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<biosal_dna_helper_complement_nucleotide>:
cmp    $0x41,%dil
je     1115 <biosal_dna_helper_complement_nucleotide+0x15>
cmp    $0x54,%dil
je     1118 <biosal_dna_helper_complement_nucleotide+0x18>
cmp    $0x47,%dil
jne    111b <biosal_dna_helper_complement_nucleotide+0x1b>
mov    $0x43,%al
ret
mov    $0x54,%al
ret
mov    $0x41,%al
ret
mov    $0x47,%al
ret

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

LLVM IR (-O2):
define signext i8 @biosal_dna_helper_complement_nucleotide(i8 signext %0) {
switch i8 %0, label %4 [
i8 65, label %5
i8 71, label %2
i8 84, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8 [ 67, %2 ], [ 65, %3 ], [ 71, %4 ], [ 84, %1 ]
ret i8 %6
}