xunge/DecIR huggingface dataset:
void setin(int *a) {
  if (*a != 0) {
    *a = 1;
  }
}


x86 assembly (clang, -O0):
<setin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     111f <setin+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setin>:
cmpl   $0x0,(%rdi)
je     110b <setin+0xb>
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @setin(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 1, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int _anetTcpServer(char *, int, char *, int /*<<< orphan*/, int);
int anetTcpServer(char *err, int port, char *bindaddr, int backlog) {
  return _anetTcpServer(err, port, bindaddr, AF_INET, backlog);
}


x86 assembly (clang, -O0):
<anetTcpServer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <_anetTcpServer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpServer>:
mov    %ecx,%r8d
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <_anetTcpServer@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @anetTcpServer(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* %8
%14 = call i32 @_anetTcpServer(i8* %9, i32 %10, i8* %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @anetTcpServer(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @AF_INET
%6 = tail call i32 @_anetTcpServer(i8* %0, i32 %1, i8* %2, i32 %5, i32 %3)
ret i32 %6
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reset(struct terminal *);
void ris(struct terminal *term) { reset(term); }


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

x86 assembly (clang, -O2):
<ris>:
jmp    1030 <reset@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @ris(%struct.terminal* %0) {
%2 = alloca %struct.terminal*
store %struct.terminal* %0, %struct.terminal** %2
%3 = load %struct.terminal*, %struct.terminal** %2
%4 = call i32 @reset(%struct.terminal* %3)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @ris(%struct.terminal* %0) {
%2 = tail call i32 @reset(%struct.terminal* %0)
ret void
}
int intel_i830_free_gatt_table(struct agp_bridge_data *bridge) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.agp_bridge_data = type opaque
define i32 @intel_i830_free_gatt_table(%struct.agp_bridge_data* nocapture readnone %0) {
ret i32 0
}
int somatorio(int num) {
  int i = 0, soma = 0;
  while (i <= num) {
    soma += i;
    i++;
  }
  return soma;
}


x86 assembly (clang, -O0):
<somatorio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <somatorio+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <somatorio+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<somatorio>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @somatorio(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i33
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %8, %0
%10 = select i1 %2, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int main(void) {
  static struct timeval tv0;
  if (!gettimeofday(&tv0, NULL))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2f06(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%eax
jne    1144 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x2f14(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@main.tv0 = internal global %struct.timeval zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @gettimeofday(%struct.timeval* @main.tv0, i32* null)
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@main.tv0 = internal global %struct.timeval zeroinitializer
define i32 @main() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @main.tv0, i32* null)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *utf8_skip_char(char const *);
const char *utf8_skip(const char *s, size_t n) {
  while (n--)
    s = utf8_skip_char(s);
  return s;
}


x86 assembly (clang, -O0):
<utf8_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     114b <utf8_skip+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <utf8_skip_char@plt>
mov    %rax,-0x8(%rbp)
jmp    1120 <utf8_skip+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_skip>:
push   %rbx
mov    %rdi,%rax
test   %rsi,%rsi
je     112e <utf8_skip+0x1e>
mov    %rsi,%rbx
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <utf8_skip_char@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <utf8_skip+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @utf8_skip(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = call i8* @utf8_skip_char(i8* %10)
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @utf8_skip(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = tail call i8* @utf8_skip_char(i8* %6)
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i8* [ %0, %2 ], [ %8, %4 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t dll_fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t __wrap_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  return dll_fread(ptr, size, nmemb, stream);
}


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

x86 assembly (clang, -O2):
<__wrap_fread>:
jmp    1030 <dll_fread@plt>

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

LLVM IR (-O2):
define i64 @__wrap_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i64 @dll_fread(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vprintf(char const *, int /*<<< orphan*/);
int _vtprintf(const char *format, va_list ap) { return vprintf(format, ap); }


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

x86 assembly (clang, -O2):
<_vtprintf>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define i32 @_vtprintf(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 = load i32, i32* %4
%7 = call i32 @vprintf(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_vtprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret i32 %3
}
int SDL_imageFilterShiftLeftByteMMX(unsigned char *Src1, unsigned char *Dest,
                                    int length, unsigned char N,
                                    unsigned char *Mask) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterShiftLeftByteMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
unsigned char getc();
scalar_t__ isDigit(unsigned char);
scalar_t__ isLetter(unsigned char);
int /*<<< orphan*/ putc(unsigned char);
int /*<<< orphan*/ uart0_init();
int main() {
  unsigned char c;
  uart0_init();
  while (1) {
    c = getc();
    if (isDigit(c) || isLetter(c))
      putc(c + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uart0_init@plt>
mov    $0x0,%al
call   1060 <getc@plt>
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1050 <isDigit@plt>
cmp    $0x0,%rax
jne    1196 <main+0x46>
movzbl -0x5(%rbp),%edi
call   1070 <isLetter@plt>
cmp    $0x0,%rax
je     11a5 <main+0x55>
movzbl -0x5(%rbp),%eax
add    $0x1,%eax
movzbl %al,%edi
call   1040 <putc@plt>
jmp    1166 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <uart0_init@plt>
jmp    116b <main+0x1b>
nopl   0x0(%rax)
add    $0x1,%bl
movzbl %bl,%edi
call   1040 <putc@plt>
xor    %eax,%eax
call   1060 <getc@plt>
mov    %eax,%ebx
movzbl %al,%ebp
mov    %ebp,%edi
call   1050 <isDigit@plt>
test   %rax,%rax
jne    1160 <main+0x10>
mov    %ebp,%edi
call   1070 <isLetter@plt>
test   %rax,%rax
jne    1160 <main+0x10>
jmp    116b <main+0x1b>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @uart0_init()
br label %4
4: ; preds = %0, %19
%5 = call zeroext i8 (...) @getc()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = call i64 @isDigit(i8 zeroext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = load i8, i8* %2
%11 = call i64 @isLetter(i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %9, %4
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
%18 = call i32 @putc(i8 zeroext %17)
br label %19
19: ; preds = %13, %9
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @uart0_init()
br label %2
2: ; preds = %12, %0
%3 = tail call zeroext i8 (...) @getc()
%4 = tail call i64 @isDigit(i8 zeroext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i64 @isLetter(i8 zeroext %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6, %2
%10 = add i8 %3, 1
%11 = tail call i32 @putc(i8 zeroext %10)
br label %12
12: ; preds = %9, %6
br label %2
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigHandler(int signo) {
  if (signo == SIGINT)
    printf("Exiting reunited.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1149 <sigHandler+0x29>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
jne    1138 <sigHandler+0x18>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [19 x i8] c"Exiting reunited.\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [18 x i8] c"Exiting reunited.\00"
define void @sigHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int sum(float, float, float, float);
float average(float a, float b, float c, float d) {
  return sum(a, b, c, d) / 4;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <sum@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
push   %rax
call   1030 <sum@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @average(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @sum(float %9, float %10, float %11, float %12)
%14 = sdiv i32 %13, 4
%15 = sitofp i32 %14 to float
ret float %15
}

LLVM IR (-O2):
define float @average(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @sum(float %0, float %1, float %2, float %3)
%6 = sdiv i32 %5, 4
%7 = sitofp i32 %6 to float
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
__attribute__((always_)) void SCB_InvalidateICache_by_Addr(void *addr,
                                                           int32_t isize) {}


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

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

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

LLVM IR (-O2):
define void @SCB_InvalidateICache_by_Addr(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pp_printf(char *);
int /*<<< orphan*/ print_devices_deep(int /*<<< orphan*/, int);
void sdb_print_devices(void) {
  pp_printf("-------------------------------------------\n");
  pp_printf("|            SDB memory map               |\n");
  pp_printf("-------------------------------------------\n\n");
  print_devices_deep(0, 0x30000000);
}


x86 assembly (clang, -O0):
<sdb_print_devices>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <pp_printf@plt>
lea    0xef6(%rip),%rdi
call   1040 <pp_printf@plt>
lea    0xf17(%rip),%rdi
call   1040 <pp_printf@plt>
xor    %edi,%edi
mov    $0x30000000,%esi
call   1030 <print_devices_deep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_print_devices>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <pp_printf@plt>
lea    0xef9(%rip),%rdi
call   1040 <pp_printf@plt>
lea    0xf1a(%rip),%rdi
call   1040 <pp_printf@plt>
xor    %edi,%edi
mov    $0x30000000,%esi
pop    %rax
jmp    1030 <print_devices_deep@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"-------------------------------------------\0A\00"
@.str.1 = [45 x i8] c"| SDB memory map |\0A\00"
@.str.2 = [46 x i8] c"-------------------------------------------\0A\0A\00"
define void @sdb_print_devices() {
%1 = call i32 @pp_printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @pp_printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @pp_printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @print_devices_deep(i32 0, i32 805306368)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"-------------------------------------------\0A\00"
@.str.1 = [45 x i8] c"| SDB memory map |\0A\00"
@.str.2 = [46 x i8] c"-------------------------------------------\0A\0A\00"
define void @sdb_print_devices() {
%1 = tail call i32 @pp_printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @pp_printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @pp_printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @print_devices_deep(i32 0, i32 805306368)
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_DELETE_ELEM;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_delete_elem(int fd, void *key) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
  };
  return syscall(__NR_bpf, BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_delete_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_delete_elem>:
push   %rax
mov    %rsi,%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast %union.bpf_attr* %5 to i32*
%7 = load i8*, i8** %4
%8 = call i32 @ptr_to_u64(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* @__NR_bpf
%10 = load i32, i32* @BPF_MAP_DELETE_ELEM
%11 = call i32 @syscall(i32 %9, i32 %10, %union.bpf_attr* %5, i32 4)
ret i32 %11
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_DELETE_ELEM = global i32 0
define i32 @bpf_delete_elem(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
%6 = tail call i32 @ptr_to_u64(i8* %1)
store i32 %6, i32* %5
%7 = load i32, i32* @__NR_bpf
%8 = load i32, i32* @BPF_MAP_DELETE_ELEM
%9 = call i32 @syscall(i32 %7, i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}
void EVP_PKEY_size(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void log_perror(const char *str) { perror(str); }


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

x86 assembly (clang, -O2):
<log_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @log_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void Dcas_navigate(void *self) { pthread_exit(0); }


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

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

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

LLVM IR (-O2):
define void @Dcas_navigate(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matrix_mul(unsigned char *, unsigned char *, unsigned char *,
                              int, int, int);
void encode_chunk(unsigned char *dataChunk, unsigned char *parityCoeff,
                  unsigned char *codeChunk, int nativeBlockNum,
                  int parityBlockNum, int chunkSize) {
  matrix_mul(parityCoeff, dataChunk, codeChunk, parityBlockNum, nativeBlockNum,
             chunkSize);
}


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

x86 assembly (clang, -O2):
<encode_chunk>:
mov    %ecx,%eax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rcx,%rsi
mov    %r8d,%ecx
mov    %eax,%r8d
jmp    1030 <matrix_mul@plt>

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

LLVM IR (-O2):
define void @encode_chunk(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @matrix_mul(i8* %1, i8* %0, i8* %2, i32 %4, i32 %3, i32 %5)
ret void
}
int yyerror(const char *err __attribute__((__unused__))) {
  do {
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <yyerror+0xd>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @yyerror(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void p(void) { puts("hello world"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
define void @p() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define void @p() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TS_Shutdown();
void TSM_Remove(void) { TS_Shutdown(); }


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

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

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

LLVM IR (-O2):
define void @TSM_Remove() {
%1 = tail call i32 (...) @TS_Shutdown()
ret void
}
/* Variables and functions */
double fabsf(float);
int fequals(float a, float b) { return fabsf(a - b) < 0.00001; }


x86 assembly (clang, -O0):
<fequals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabsf@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fequals>:
push   %rax
subss  %xmm1,%xmm0
call   1030 <fabsf@plt>
movsd  0xede(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fequals(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call double @fabsf(float %7)
%9 = fcmp olt double %8, 1.000000e-05
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @fequals(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call double @fabsf(float %3)
%5 = fcmp olt double %4, 1.000000e-05
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *a;
  printf("%d\n", (int)sizeof(a));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
char *gst2fd(string)
char *string;
{
  double sdj, dj;
  sdj = fd2jd(string);
  dj = gst2jd(sdj);
  return (jd2fd(dj));
}


x86 assembly (clang, -O0):
<gst2fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1050 <gst2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gst2fd>:
push   %rax
xor    %eax,%eax
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1050 <gst2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @gst2fd(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %5)
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (double, ...) bitcast (i32 (...)* @gst2jd to i32 (double, ...)*)(double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @gst2fd(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @gst2jd to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
double percentage(double num, double den) {
  double per = num / den * 100.0;
  return per;
}


x86 assembly (clang, -O0):
<percentage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentage>:
divsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @percentage(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = fmul double %8, 1.000000e+02
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @percentage(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fmul double %3, 1.000000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ gf_error(int, char *, size_t);
void *malloc(size_t);
void *gf_malloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    gf_error(30, "Could not malloc %ld bytes!\n", size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<gf_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <gf_malloc+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x1e,%edi
lea    0xeac(%rip),%rsi
call   1030 <gf_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <gf_malloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1e,%edi
mov    %r14,%rdx
call   1030 <gf_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Could not malloc %ld bytes!\0A\00"
define i8* @gf_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @gf_error(i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"Could not malloc %ld bytes!\0A\00"
define noalias i8* @gf_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @gf_error(i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int compare(const void *arg1, const void *arg2) {
  return *((int *)arg1) - *((int *)arg2);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void thread_uncaught_exception() { exit(1); }


x86 assembly (clang, -O0):
<thread_uncaught_exception>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<thread_uncaught_exception>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @thread_uncaught_exception() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @thread_uncaught_exception() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int factorial_zeros(int);
int test_factorial_zeros() {
  return 2 == factorial_zeros(13) && 3 == factorial_zeros(15) &&
         4 == factorial_zeros(20);
}


x86 assembly (clang, -O0):
<test_factorial_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xd,%edi
call   1030 <factorial_zeros@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    116d <test_factorial_zeros+0x5d>
mov    $0xf,%edi
call   1030 <factorial_zeros@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    116d <test_factorial_zeros+0x5d>
mov    $0x14,%edi
call   1030 <factorial_zeros@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_factorial_zeros>:
push   %rbx
mov    $0xd,%edi
call   1030 <factorial_zeros@plt>
xor    %ebx,%ebx
cmp    $0x2,%eax
jne    1143 <test_factorial_zeros+0x33>
mov    $0xf,%edi
call   1030 <factorial_zeros@plt>
cmp    $0x3,%eax
jne    1143 <test_factorial_zeros+0x33>
mov    $0x14,%edi
call   1030 <factorial_zeros@plt>
xor    %ebx,%ebx
cmp    $0x4,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_factorial_zeros() {
%1 = call i32 @factorial_zeros(i32 13)
%2 = icmp eq i32 2, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @factorial_zeros(i32 15)
%5 = icmp eq i32 3, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @factorial_zeros(i32 20)
%8 = icmp eq i32 4, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_factorial_zeros() {
%1 = tail call i32 @factorial_zeros(i32 13)
%2 = icmp eq i32 %1, 2
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 @factorial_zeros(i32 15)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @factorial_zeros(i32 20)
%8 = icmp eq i32 %7, 4
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
void path_005_expected_4(int a, int b) {
  if (a) {
  }
  if (b) {
    return;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1119 <path_005_expected_4+0x19>
jmp    1119 <path_005_expected_4+0x19>
cmpl   $0x0,-0x8(%rbp)
je     1128 <path_005_expected_4+0x28>
jmp    1128 <path_005_expected_4+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @path_005_expected_4(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int f57(int *);
int f58(int *p) { return f57(p); }


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

x86 assembly (clang, -O2):
<f58>:
jmp    1030 <f57@plt>

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

LLVM IR (-O2):
define i32 @f58(i32* %0) {
%2 = tail call i32 @f57(i32* %0)
ret i32 %2
}
trim(t) register char **t;
{
  register char *p;
  while (p = *t++)
    while (*p)
      *p++ &= 0177;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115b <trim+0x5b>
jmp    112d <trim+0x2d>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <trim+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%ecx
and    $0x7f,%ecx
mov    %cl,(%rax)
jmp    112d <trim+0x2d>
jmp    1108 <trim+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
mov    (%rdi),%rax
test   %rax,%rax
je     1133 <trim+0x33>
add    $0x8,%rdi
mov    (%rax),%cl
test   %cl,%cl
je     1100 <trim>
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
and    $0x7f,%cl
mov    %cl,-0x1(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1120 <trim+0x20>
jmp    1100 <trim>
ret

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

LLVM IR (-O2):
define i32 @trim(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %20, label %7
4: ; preds = %13, %7
%5 = load i8*, i8** %10
%6 = icmp eq i8* %5, null
br i1 %6, label %20, label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ %2, %1 ]
%9 = phi i8** [ %10, %4 ], [ %0, %1 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %13
13: ; preds = %7, %13
%14 = phi i8 [ %18, %13 ], [ %11, %7 ]
%15 = phi i8* [ %16, %13 ], [ %8, %7 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = and i8 %14, 127
store i8 %17, i8* %15
%18 = load i8, i8* %16
%19 = icmp eq i8 %18, 0
br i1 %19, label %4, label %13
20: ; preds = %4, %1
ret i32 undef
}
void strength_test7(int *data) {
  int i = 0;
  do {
    if (data[1])
      i = i + 1;
    else
      i = i + 2;
    data[data[2]] = 2;
  } while (i * 21 < data[3]);
}


x86 assembly (clang, -O0):
<strength_test7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     112b <strength_test7+0x2b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <strength_test7+0x34>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     110f <strength_test7+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test7>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0x1,0x4(%rdi)
adc    $0x0,%eax
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
mov    %eax,%ecx
add    $0x1,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rax,%rdx,4),%edx
add    $0x1,%edx
mov    %ecx,%eax
cmp    0xc(%rdi),%edx
jl     1110 <strength_test7+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = getelementptr inbounds i32, i32* %0, i64 3
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %10, %5 ]
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 2, i32 1
%10 = add nuw nsw i32 %9, %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = mul nsw i32 %10, 21
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %5, label %17
17: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int (*a)[40]) {
  int x = (*(a + 29))[7];
  assert(x == 23);
  int y = (*(a + 7))[13];
  assert(y == 23);
  assert(a[7][13] == 23);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x123c(%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x17,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    0x494(%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x17,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x17,0x494(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x17,0x123c(%rbx)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x17,0x494(%rbx)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x17,0x494(%rbx)
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo([40 x i32]* %0) {
%2 = alloca [40 x i32]*
%3 = alloca i32
%4 = alloca i32
store [40 x i32]* %0, [40 x i32]** %2
%5 = load [40 x i32]*, [40 x i32]** %2
%6 = getelementptr inbounds [40 x i32], [40 x i32]* %5, i64 29
%7 = getelementptr inbounds [40 x i32], [40 x i32]* %6, i64 0, i64 7
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 23
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load [40 x i32]*, [40 x i32]** %2
%14 = getelementptr inbounds [40 x i32], [40 x i32]* %13, i64 7
%15 = getelementptr inbounds [40 x i32], [40 x i32]* %14, i64 0, i64 13
%16 = load i32, i32* %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 23
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load [40 x i32]*, [40 x i32]** %2
%22 = getelementptr inbounds [40 x i32], [40 x i32]* %21, i64 7
%23 = getelementptr inbounds [40 x i32], [40 x i32]* %22, i64 0, i64 13
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 23
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
ret void
}

LLVM IR (-O2):
define void @foo([40 x i32]* nocapture %0) {
%2 = getelementptr inbounds [40 x i32], [40 x i32]* %0, i64 29, i64 7
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 23
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds [40 x i32], [40 x i32]* %0, i64 7, i64 13
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 23
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 23
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
ret void
}