xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: pigc [OPTIONS]\n"
                  "   -f,--foreground    do not fork and diassociate with tty\n"
                  "   -d,--debug         show keypresses on stderr\n"
                  "   -s,--shutdown      shutdown system when 5 and ESC "
                  "simultaneously pressed\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [206 x i8] c"Usage: pigc [OPTIONS]\0A -f,--foreground do not fork and diassociate with tty\0A -d,--debug show keypresses on stderr\0A -s,--shutdown shutdown system when 5 and ESC simultaneously pressed\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [206 x i8] c"Usage: pigc [OPTIONS]\0A -f,--foreground do not fork and diassociate with tty\0A -d,--debug show keypresses on stderr\0A -s,--shutdown shutdown system when 5 and ESC simultaneously pressed\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([206 x i8], [206 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ drwav__bytes_to_u16(unsigned char const *);
__attribute__((always_)) short drwav__bytes_to_s16(const unsigned char *data) {
  return (short)drwav__bytes_to_u16(data);
}


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

x86 assembly (clang, -O2):
<drwav__bytes_to_s16>:
push   %rax
call   1030 <drwav__bytes_to_u16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @drwav__bytes_to_s16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @drwav__bytes_to_u16(i8* %3)
%5 = trunc i64 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @drwav__bytes_to_s16(i8* %0) {
%2 = tail call i64 @drwav__bytes_to_u16(i8* %0)
%3 = trunc i64 %2 to i16
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_from_bytes(uintptr_t, uintptr_t);
void fiat_secp256k1_from_bytes(uint64_t out1[4], const uint8_t arg1[32]) {
  internal_fiat_secp256k1_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_from_bytes>:
jmp    1030 <internal_fiat_secp256k1_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_from_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_secp256k1_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_secp256k1_from_bytes(i64 %3, i64 %4)
ret void
}
void hog_detect() {}


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

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

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

LLVM IR (-O2):
define void @hog_detect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fsub_preg64_dword(int reg64) {
  put8(0xD8);
  put8(0x20 + reg64);
}


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

x86 assembly (clang, -O2):
<fsub_preg64_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd8,%edi
call   1030 <put8@plt>
add    $0x20,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fsub_preg64_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 216)
%4 = load i32, i32* %2
%5 = add nsw i32 32, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fsub_preg64_dword(i32 %0) {
%2 = tail call i32 @put8(i32 216)
%3 = add nsw i32 %0, 32
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vizinho_nulo(int, int, int, int);
int /*<<< orphan*/ vizinho_periodico(int, int, int, int);
int vizinho(int x, int y, int z, int posicao, int condicao) {
  if (condicao == 0) {
    vizinho_nulo(x, y, z, posicao);
  } else {
    vizinho_periodico(x, y, z, posicao);
  }
}


x86 assembly (clang, -O0):
<vizinho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1158 <vizinho+0x38>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <vizinho_nulo@plt>
jmp    1169 <vizinho+0x49>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <vizinho_periodico@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vizinho>:
push   %rax
test   %r8d,%r8d
je     112d <vizinho+0xd>
call   1030 <vizinho_periodico@plt>
pop    %rcx
ret
call   1040 <vizinho_nulo@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vizinho(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %5
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @vizinho_nulo(i32 %15, i32 %16, i32 %17, i32 %18)
br label %26
20: ; preds = %5
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = call i32 @vizinho_periodico(i32 %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20, %14
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
define i32 @vizinho(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @vizinho_nulo(i32 %0, i32 %1, i32 %2, i32 %3)
br label %11
9: ; preds = %5
%10 = tail call i32 @vizinho_periodico(i32 %0, i32 %1, i32 %2, i32 %3)
br label %11
11: ; preds = %9, %7
ret i32 undef
}
/* Variables and functions */
float _sinf_cosf_special(float, char *);
float _cosf_special(float x) { return _sinf_cosf_special(x, "cosf"); }


x86 assembly (clang, -O0):
<_cosf_special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <_sinf_cosf_special@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"cosf\00"
define float @_cosf_special(float %0) {
%2 = tail call float @_sinf_cosf_special(float %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void crash(char *str) {
  perror(str);
  exit(-1);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @crash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @crash(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int fork();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main() {
  int p = fork();
  if (!p) {
    printf("id=%d\n", p);
    b();
    _exit(0);
  } else {
    printf("id=%d\n", p);
    a();
  }
  wait(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11a0 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <b@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe56(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <a@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <wait@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <fork@plt>
lea    0xe91(%rip),%rdi
test   %eax,%eax
je     118c <main+0x2c>
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <a@plt>
xor    %edi,%edi
call   1070 <wait@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %esi,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"id=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @b()
%10 = call i32 @_exit(i32 0)
unreachable
11: ; preds = %0
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @a()
br label %15
15: ; preds = %11
%16 = call i32 @wait(i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"id=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 (...) @b()
%6 = tail call i32 @_exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%9 = tail call i32 (...) @a()
%10 = tail call i32 @wait(i32* null)
ret i32 0
}
/* Type definitions */
struct netdev_queue {
  int dummy;
};
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
struct netdev_queue *netdev_get_tx_queue(struct net_device *dev, int n) {
  WARN_ON(n != 0);
  return (struct netdev_queue *)dev;
}


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

x86 assembly (clang, -O2):
<netdev_get_tx_queue>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %esi,%esi
setne  %dil
call   1030 <WARN_ON@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.netdev_queue = type { i32 }
%struct.net_device = type { i32 }
define %struct.netdev_queue* @netdev_get_tx_queue(%struct.net_device* %0, i32 %1) {
%3 = alloca %struct.net_device*
%4 = alloca i32
store %struct.net_device* %0, %struct.net_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @WARN_ON(i32 %7)
%9 = load %struct.net_device*, %struct.net_device** %3
%10 = bitcast %struct.net_device* %9 to %struct.netdev_queue*
ret %struct.netdev_queue* %10
}

LLVM IR (-O2):
%struct.netdev_queue = type { i32 }
%struct.net_device = type { i32 }
define %struct.netdev_queue* @netdev_get_tx_queue(%struct.net_device* readnone %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @WARN_ON(i32 %4)
%6 = bitcast %struct.net_device* %0 to %struct.netdev_queue*
ret %struct.netdev_queue* %6
}
/* Variables and functions */
double evaluationStart(int /*<<< orphan*/ *);
extern double evaluationStop(void *data) {
  (void)data;
  return evaluationStart(NULL);
}


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

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

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

LLVM IR (-O2):
define double @evaluationStop(i8* nocapture readnone %0) {
%2 = tail call double @evaluationStart(i32* null)
ret double %2
}
/* Variables and functions */
int size_minus(size_t, size_t);
size_t strlen(char const *);
const char *last_bytes(const char *str, size_t num_bytes) {
  size_t len;
  if (!str)
    return NULL;
  len = strlen(str);
  return str + size_minus(len, num_bytes);
}


x86 assembly (clang, -O0):
<last_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <last_bytes+0x28>
movq   $0x0,-0x8(%rbp)
jmp    117a <last_bytes+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <size_minus@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_bytes>:
test   %rdi,%rdi
je     114c <last_bytes+0x2c>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <size_minus@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @last_bytes(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* %0)
%6 = tail call i32 @size_minus(i64 %5, i64 %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %8, %4 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
double M_PI;
float rad2deg(float rad) { return 180.0 * rad / M_PI; }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mov    0x2ed5(%rip),%rax
divsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define float @rad2deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 1.800000e+02, %4
%6 = load double, double* @M_PI
%7 = fdiv double %5, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define float @rad2deg(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.800000e+02
%4 = load double, double* @M_PI
%5 = fdiv double %3, %4
%6 = fptrunc double %5 to float
ret float %6
}
int main(void) {
  const int mantissa_size = 52;
  union {
    int u;
    double d;
  } startExp;
  startExp.u = mantissa_size;
  return 0;
}


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

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

LLVM IR (-O0):
%union.anon = type { double }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %union.anon
store i32 0, i32* %1
store i32 52, i32* %2
%4 = bitcast %union.anon* %3 to i32*
store i32 52, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ relay_network_close_socket();
void relay_network_end() { relay_network_close_socket(); }


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

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

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

LLVM IR (-O2):
define void @relay_network_end() {
%1 = tail call i32 (...) @relay_network_close_socket()
ret void
}
/* Variables and functions */
double fabs(double);
double fmod(double, double);
double mod_fun(double lhs, double rhs) {
  if (fabs(rhs) < 0.0000000001)
    return 0;
  else
    return fmod(lhs, rhs);
}


x86 assembly (clang, -O0):
<mod_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movaps 0xee2(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <mod_fun+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <mod_fun+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_fun>:
movapd 0xee8(%rip),%xmm2
andpd  %xmm1,%xmm2
movsd  0xeec(%rip),%xmm3
ucomisd %xmm2,%xmm3
jbe    112e <mod_fun+0x1e>
xorps  %xmm0,%xmm0
ret
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define double @mod_fun(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = call double @llvm.fabs.f64(double %6)
%8 = fcmp olt double %7, 1.000000e-10
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %14
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @fmod(double %11, double %12)
store double %13, double* %3
br label %14
14: ; preds = %10, %9
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @mod_fun(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %1)
%4 = fcmp olt double %3, 1.000000e-10
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @fmod(double %0, double %1)
br label %7
7: ; preds = %2, %5
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Variables and functions */
unsigned int baudot_decode(char *, unsigned long long);
int /*<<< orphan*/ baudot_reset();
unsigned int databits_decode_baudot(char *dataout_p, unsigned int dataout_size,
                                    unsigned long long bits,
                                    unsigned int n_databits) {
  if (!dataout_p) {
    baudot_reset();
    return 0;
  }
  bits &= 0x1F;
  return baudot_decode(dataout_p, bits);
}


x86 assembly (clang, -O0):
<databits_decode_baudot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <databits_decode_baudot+0x34>
mov    $0x0,%al
call   1040 <baudot_reset@plt>
movl   $0x0,-0x4(%rbp)
jmp    1170 <databits_decode_baudot+0x50>
mov    -0x20(%rbp),%rax
and    $0x1f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <baudot_decode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<databits_decode_baudot>:
test   %rdi,%rdi
je     1130 <databits_decode_baudot+0x10>
and    $0x1f,%edx
mov    %rdx,%rsi
jmp    1030 <baudot_decode@plt>
push   %rax
xor    %eax,%eax
call   1040 <baudot_reset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @databits_decode_baudot(i8* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %4
%13 = call i32 (...) @baudot_reset()
store i32 0, i32* %5
br label %20
14: ; preds = %4
%15 = load i64, i64* %8
%16 = and i64 %15, 31
store i64 %16, i64* %8
%17 = load i8*, i8** %6
%18 = load i64, i64* %8
%19 = call i32 @baudot_decode(i8* %17, i64 %18)
store i32 %19, i32* %5
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @databits_decode_baudot(i8* %0, i32 %1, i64 %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @baudot_reset()
br label %11
8: ; preds = %4
%9 = and i64 %2, 31
%10 = tail call i32 @baudot_decode(i8* %0, i64 %9)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ %10, %8 ], [ 0, %6 ]
ret i32 %12
}
double pi(void) { return 3.14159265358979323846; }


x86 assembly (clang, -O0):
<pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @pi() {
ret double 0x400921FB54442D18
}

LLVM IR (-O2):
define double @pi() {
ret double 0x400921FB54442D18
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ exit(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ ptsname(int);
int pts_slave_open(int master) {
  char *nombre;
  int fd;
  nombre = (char *)ptsname(master);
  if ((fd = open(nombre, O_RDWR)) == -1) {
    perror("Abriendo esclava de /dev/ptmx");
    exit(1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<pts_slave_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ptsname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    118b <pts_slave_open+0x4b>
lea    0xe84(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pts_slave_open>:
push   %rax
call   1030 <ptsname@plt>
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     115e <pts_slave_open+0x1e>
pop    %rcx
ret
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [30 x i8] c"Abriendo esclava de /dev/ptmx\00"
define i32 @pts_slave_open(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64 @ptsname(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i32, i32* @O_RDWR
%10 = call i32 @open(i8* %8, i32 %9)
store i32 %10, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [30 x i8] c"Abriendo esclava de /dev/ptmx\00"
define i32 @pts_slave_open(i32 %0) {
%2 = tail call i64 @ptsname(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* %3, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i32 %5
}
/* Variables and functions */
int getline2(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int len;
  char line[1000];
  char longest[1000];
  while ((len = getline2(line, 1000)) > 0) {
    if (len > 80)
      printf("\n The number of longest line is %d\n", len);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <getline2@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116d <main+0x4d>
cmpl   $0x50,-0x8(%rbp)
jle    1168 <main+0x48>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <getline2@plt>
test   %eax,%eax
jle    1172 <main+0x52>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <getline2@plt>
test   %eax,%eax
jle    1172 <main+0x52>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0A The number of longest line is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %15, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @getline2(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 80
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
br label %5
16: ; preds = %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A The number of longest line is %d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline2(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline2(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int receive_download(int sock, char *file_contents) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @receive_download(i32 %0, i8* nocapture readnone %1) {
ret i32 1
}
void VIDDummyVdp2SetPriorityNBG1(__attribute((unused)) int priority) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2SetPriorityNBG1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_mandelbrot();
void _initmandelbrot(int *w) { init_mandelbrot(); }


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

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

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

LLVM IR (-O2):
define void @_initmandelbrot(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @init_mandelbrot()
ret void
}
void a_crash() {
  __asm__ __volatile__(".byte 0xf1, 0xde"
                       ", 0xfd, 0xe7"
                       :
                       :
                       : "memory");
}


x86 assembly (clang, -O0):
<a_crash>:
push   %rbp
mov    %rsp,%rbp
int1
fdivrp %st,%st(5)
out    %eax,$0x5d
ret

x86 assembly (clang, -O2):
<a_crash>:
int1
fdivrp %st,%st(5)
out    %eax,$0xc3

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

LLVM IR (-O2):
define void @a_crash() {
tail call void asm sideeffect ".byte 0xf1, 0xde, 0xfd, 0xe7", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(void) { exit(42); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 42)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void ivory_serialize_pack_prim_1_le(uint8_t *dst, const uint8_t *src) {
  dst[0] = src[0];
}


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

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

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

LLVM IR (-O2):
define void @ivory_serialize_pack_prim_1_le(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ read_ble8(void const *);
uint8_t read_be8(const void *src) { return read_ble8(src); }


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

x86 assembly (clang, -O2):
<read_be8>:
jmp    1030 <read_ble8@plt>

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

LLVM IR (-O2):
define i32 @read_be8(i8* %0) {
%2 = tail call i32 @read_ble8(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XwcFreeStringList() {
  printf("XwcFreeStringList called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"XwcFreeStringList called\0A\00"
define i32 @XwcFreeStringList() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"XwcFreeStringList called\00"
define i32 @XwcFreeStringList() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t shrRoundUp(int group_size, int global_size) {
  int r = global_size % group_size;
  if (!r)
    return global_size;
  else
    return global_size + group_size - r;
}


x86 assembly (clang, -O0):
<shrRoundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    112b <shrRoundUp+0x2b>
movslq -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113a <shrRoundUp+0x3a>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x14(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrRoundUp>:
mov    %esi,%eax
cltd
idiv   %edi
add    %esi,%edi
sub    %edx,%edi
test   %edx,%edx
cmove  %esi,%edi
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @shrRoundUp(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = add nsw i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %1, i32 %6
%8 = sext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void jas_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<jas_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):
<jas_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @jas_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 @jas_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void SIG_IGN(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ signal(int, void (*)(int));
void sighandler(int sig) {
  char temp[200];
  char *p;
  signal(sig, SIG_IGN);
  signal(sig, sighandler);
  exit(sig);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rsi
call   1030 <signal@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea1(%rip),%rsi
call   1030 <signal@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rsi
call   1030 <signal@plt>
mov    0x2eb2(%rip),%rsi
mov    %ebx,%edi
call   1030 <signal@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
%3 = alloca [200 x i8]
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @signal(i32 %5, void (i32)* @SIG_IGN)
%7 = load i32, i32* %2
%8 = call i32 @signal(i32 %7, void (i32)* @sighandler)
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @SIG_IGN)
%3 = tail call i32 @signal(i32 %0, void (i32)* @sighandler)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct pico_mqtt_packet {
  int dummy;
};
struct pico_mqtt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_packet(struct pico_mqtt_packet *);
int handle_error_message(struct pico_mqtt *mqtt,
                         struct pico_mqtt_packet *packet) {
  do {
  } while (0);
  destroy_packet(packet);
  do {
  } while (0);
  do {
  } while (0);
  return -1;
}


x86 assembly (clang, -O0):
<handle_error_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1125 <handle_error_message+0x15>
mov    -0x10(%rbp),%rdi
call   1030 <destroy_packet@plt>
jmp    1133 <handle_error_message+0x23>
jmp    1138 <handle_error_message+0x28>
jmp    113d <handle_error_message+0x2d>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_error_message>:
push   %rax
mov    %rsi,%rdi
call   1030 <destroy_packet@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_error_message(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1) {
%3 = alloca %struct.pico_mqtt*
%4 = alloca %struct.pico_mqtt_packet*
store %struct.pico_mqtt* %0, %struct.pico_mqtt** %3
store %struct.pico_mqtt_packet* %1, %struct.pico_mqtt_packet** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load %struct.pico_mqtt_packet*, %struct.pico_mqtt_packet** %4
%8 = call i32 @destroy_packet(%struct.pico_mqtt_packet* %7)
br label %9
9: ; preds = %6
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
ret i32 -1
}

LLVM IR (-O2):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_error_message(%struct.pico_mqtt* nocapture readnone %0, %struct.pico_mqtt_packet* %1) {
%3 = tail call i32 @destroy_packet(%struct.pico_mqtt_packet* %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ randomTimeName(char *);
void test_randomTimeName() {
  printf("Teste of randomTimeName()...\n");
  char timeName[150];
  randomTimeName(timeName);
  printf("Found: %s\n", timeName);
}


x86 assembly (clang, -O0):
<test_randomTimeName>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <randomTimeName@plt>
lea    -0xa0(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_randomTimeName>:
push   %rbx
sub    $0xa0,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <randomTimeName@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Teste of randomTimeName()...\0A\00"
@.str.1 = [11 x i8] c"Found: %s\0A\00"
define void @test_randomTimeName() {
%1 = alloca [150 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%4 = call i32 @randomTimeName(i8* %3)
%5 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Found: %s\0A\00"
@str = [29 x i8] c"Teste of randomTimeName()...\00"
define void @test_randomTimeName() {
%1 = alloca [150 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [150 x i8], [150 x i8]* %1, i64 0, i64 0
%4 = call i32 @randomTimeName(i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
unsigned long SSLeay();
unsigned long OpenSSL_version_num(void) { return SSLeay(); }


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

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

LLVM IR (-O0):
define i64 @OpenSSL_version_num() {
%1 = call i64 (...) @SSLeay()
ret i64 %1
}

LLVM IR (-O2):
define i64 @OpenSSL_version_num() {
%1 = tail call i64 (...) @SSLeay()
ret i64 %1
}
short f_short() {
  short s;
  s = 256;
  return s;
}


x86 assembly (clang, -O0):
<f_short>:
push   %rbp
mov    %rsp,%rbp
movw   $0x100,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_short>:
mov    $0x100,%ax
ret

LLVM IR (-O0):
define signext i16 @f_short() {
%1 = alloca i16
store i16 256, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define signext i16 @f_short() {
ret i16 256
}
int SuiteSparse_version(int version[3]) {
  if (version != ((void *)0)) {
    version[0] = 4;
    version[1] = 5;
    version[2] = 3;
  }
  return (((4) * 1000 + (5)));
}


x86 assembly (clang, -O0):
<SuiteSparse_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <SuiteSparse_version+0x33>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    $0xfa5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuiteSparse_version>:
test   %rdi,%rdi
je     1119 <SuiteSparse_version+0x19>
movabs $0x500000004,%rax
mov    %rax,(%rdi)
movl   $0x3,0x8(%rdi)
mov    $0xfa5,%eax
ret

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

LLVM IR (-O2):
define i32 @SuiteSparse_version(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
store i32 4, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 5, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 3, i32* %5
br label %6
6: ; preds = %3, %1
ret i32 4005
}
void instruc_6() {}


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

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

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

LLVM IR (-O2):
define void @instruc_6() {
ret void
}
/* Variables and functions */
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
char getcwd_no_buf_no_free_bad() {
  char *cwd = getcwd(NULL, 0);
  if (cwd != NULL) {
    return cwd[0];
  }
  return 'a';
}


x86 assembly (clang, -O0):
<getcwd_no_buf_no_free_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <getcwd@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <getcwd_no_buf_no_free_bad+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    1144 <getcwd_no_buf_no_free_bad+0x34>
movb   $0x61,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd_no_buf_no_free_bad>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
je     1123 <getcwd_no_buf_no_free_bad+0x13>
mov    (%rax),%al
pop    %rcx
ret
mov    $0x61,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getcwd_no_buf_no_free_bad() {
%1 = alloca i8
%2 = alloca i8*
%3 = call i8* @getcwd(i32* null, i32 0)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
store i8 %9, i8* %1
br label %11
10: ; preds = %0
store i8 97, i8* %1
br label %11
11: ; preds = %10, %6
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @getcwd_no_buf_no_free_bad() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load i8, i8* %1
br label %5
5: ; preds = %0, %3
%6 = phi i8 [ %4, %3 ], [ 97, %0 ]
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_REQUEST;

/* Variables and functions */
int /*<<< orphan*/ OCSP_REQUEST_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *d2i_OCSP_REQUEST(int /*<<< orphan*/ *,
                                     unsigned char const **, size_t);
int ssl_is_ocspreq(const unsigned char *buf, size_t sz) {
  OCSP_REQUEST *req;
  const unsigned char *p;
  p = (const unsigned char *)buf;
  req = d2i_OCSP_REQUEST(NULL, &p, sz);
  if (!req)
    return 0;
  OCSP_REQUEST_free(req);
  return 1;
}


x86 assembly (clang, -O0):
<ssl_is_ocspreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x28(%rbp),%rsi
call   1040 <d2i_OCSP_REQUEST@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1164 <ssl_is_ocspreq+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1174 <ssl_is_ocspreq+0x54>
mov    -0x20(%rbp),%rdi
call   1030 <OCSP_REQUEST_free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_is_ocspreq>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,0x8(%rsp)
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1040 <d2i_OCSP_REQUEST@plt>
test   %rax,%rax
je     114d <ssl_is_ocspreq+0x2d>
mov    %rax,%rdi
call   1030 <OCSP_REQUEST_free@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ssl_is_ocspreq(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = call i32* @d2i_OCSP_REQUEST(i32* null, i8** %3, i64 %1)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @OCSP_REQUEST_free(i32* %5)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %10
}