xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xcd() {
  Assert_real((isalnum(205) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1030, ("isalnum should be 0 for 0xcd"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xcd\00"
define void @t_isalnum_0xcd() {
%1 = tail call i64 @isalnum(i32 205)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test46(__m64 a, __m64 b) { return _mm_subs_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test46>:
jmp    1030 <_mm_subs_pi16@plt>

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

LLVM IR (-O2):
define i32 @test46(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ printf(char *, unsigned int);
int commandlineseed(char **seeds) {
  unsigned int seed2;
  void srand(unsigned int seed);
  seed2 = atoi(seeds[0]);
  printf("\n%d\n", seed2);
  srand(seed2);
  return (1);
}


x86 assembly (clang, -O0):
<commandlineseed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <srand@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandlineseed>:
push   %rbx
mov    (%rdi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <srand@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @commandlineseed(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @atoi(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
tail call void @srand(i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _error_print(char const *, char const *, char const *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int _error_print_exit(const char *scope, const char *call, const char *file,
                      int line) {
  _error_print(scope, call, file, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<_error_print_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <_error_print@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_error_print_exit>:
push   %rax
call   1030 <_error_print@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @_error_print_exit(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @_error_print(i8* %9, i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @_error_print_exit(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @_error_print(i8* %0, i8* %1, i8* %2, i32 %3)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGet_size(int /*<<< orphan*/);
GLint __glGetIntegerv_size(GLenum sq) { return __glGet_size(sq); }


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

x86 assembly (clang, -O2):
<__glGetIntegerv_size>:
jmp    1030 <__glGet_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetIntegerv_size(i32 %0) {
%2 = tail call i32 @__glGet_size(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_136(void) {
  if (*(uint32_t *)0x10000130ul == 0xAul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_136>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xa,%rax
jne    1157 <errata_136+0x57>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_136+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_136+0x5e>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_136+0x52>
movl   $0x1,-0x4(%rbp)
jmp    115e <errata_136+0x5e>
jmp    1157 <errata_136+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_136() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 10
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %17
10: ; preds = %5
%11 = load i32, i32* inttoptr (i64 268435764 to i32*)
%12 = sext i32 %11 to i64
%13 = icmp eq i64 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15, %0
store i32 1, i32* %1
br label %17
17: ; preds = %16, %14, %9
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @errata_136() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ glb_free(char *);
void glb_free_mat(double **m, int nrl, int nrh, int ncl, int nch) {
  int i;
  for (i = nrh; i >= 0; i--)
    glb_free((char *)(m[i]));
  glb_free((char *)(m));
}


x86 assembly (clang, -O0):
<glb_free_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1158 <glb_free_mat+0x48>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <glb_free@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <glb_free_mat+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <glb_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glb_free_mat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %edx,%edx
js     112f <glb_free_mat+0x1f>
mov    %edx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <glb_free@plt>
add    $0xffffffffffffffff,%rbx
jb     1120 <glb_free_mat+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <glb_free@plt>

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

LLVM IR (-O2):
define void @glb_free_mat(double** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %2, -1
br i1 %6, label %7, label %17
7: ; preds = %5
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ %8, %7 ], [ %15, %9 ]
%11 = getelementptr inbounds double*, double** %0, i64 %10
%12 = bitcast double** %11 to i8**
%13 = load i8*, i8** %12
%14 = tail call i32 @glb_free(i8* %13)
%15 = add nsw i64 %10, -1
%16 = icmp eq i64 %10, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %5
%18 = bitcast double** %0 to i8*
%19 = tail call i32 @glb_free(i8* %18)
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setreuid(scalar_t__, scalar_t__);
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  if (ruid != suid) {
    errno = ENOSYS;
    return -1;
  }
  return setreuid(ruid, euid);
}


x86 assembly (clang, -O0):
<setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1150 <setresuid+0x40>
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <setresuid+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <setreuid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresuid>:
cmp    %rdx,%rdi
jne    111a <setresuid+0xa>
jmp    1030 <setreuid@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2eae(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setresuid(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
br label %9
7: ; preds = %3
%8 = tail call i32 @setreuid(i64 %0, i64 %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int bundle_raw_get_proc_flags(int const *, int *);
int bundle_raw_ext_get_proc_flags(const uint8_t *ext_raw, uint8_t *flags) {
  uint64_t flags_32 = 0, ret = 0;
  ret = bundle_raw_get_proc_flags(ext_raw, &flags_32);
  *flags = flags_32;
  return ret;
}


x86 assembly (clang, -O0):
<bundle_raw_ext_get_proc_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <bundle_raw_get_proc_flags@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bundle_raw_ext_get_proc_flags>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <bundle_raw_get_proc_flags@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bundle_raw_ext_get_proc_flags(i32* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @bundle_raw_get_proc_flags(i32* %0, i32* %3)
%6 = load i32, i32* %3
store i32 %6, i32* %1
ret i32 %5
}
int test_imm_D7uint32_mem(unsigned int *val) {
  return ((*val) & (0xD7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D7uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D7uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 215
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D7uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 215
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ExttMonthHitAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttMonthHitAuxTable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_PCTX;

/* Variables and functions */
int print_gost_94(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int,
                  int /*<<< orphan*/ *, int);
int pub_print_gost94(BIO *out, const EVP_PKEY *pkey, int indent,
                     ASN1_PCTX *pctx) {
  return print_gost_94(out, pkey, indent, pctx, 1);
}


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

x86 assembly (clang, -O2):
<pub_print_gost94>:
mov    $0x1,%r8d
jmp    1030 <print_gost_94@plt>

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

LLVM IR (-O2):
define i32 @pub_print_gost94(i32* %0, i32* %1, i32 %2, i32* %3) {
%5 = tail call i32 @print_gost_94(i32* %0, i32* %1, i32 %2, i32* %3, i32 1)
ret i32 %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int timediff_usec(struct timeval t1, struct timeval t2) {
  return (t1.tv_sec - t2.tv_sec) * 1000000 + (t1.tv_usec - t2.tv_usec);
}


x86 assembly (clang, -O0):
<timediff_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff_usec>:
mov    %rdi,%rcx
shr    $0x20,%rcx
sub    %esi,%edi
shr    $0x20,%rsi
imul   $0xf4240,%edi,%eax
sub    %esi,%ecx
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timediff_usec(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
%6 = bitcast %struct.timeval* %4 to i64*
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%16 = load i32, i32* %15
%17 = sub nsw i32 %14, %16
%18 = add nsw i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @timediff_usec(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = trunc i64 %1 to i32
%7 = lshr i64 %1, 32
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %3, %6
%10 = mul nsw i32 %9, 1000000
%11 = sub i32 %5, %8
%12 = add nsw i32 %11, %10
ret i32 %12
}
/* Type definitions */
union bpf_attr {
  void *file_flags;
  void *bpf_fd;
  scalar_t__ pathname;
};
typedef scalar_t__ __u64;
typedef void *__u32;

/* Variables and functions */
void bpf_attr_setup_obj_pin(union bpf_attr *attr, char *path, __u32 fd,
                            __u32 flags) {
  attr->pathname = (__u64)(unsigned long)path;
  attr->bpf_fd = fd;
  attr->file_flags = flags;
}


x86 assembly (clang, -O0):
<bpf_attr_setup_obj_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_attr_setup_obj_pin>:
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_obj_pin(%union.bpf_attr* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %union.bpf_attr*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %union.bpf_attr* %0, %union.bpf_attr** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = load %union.bpf_attr*, %union.bpf_attr** %5
%12 = bitcast %union.bpf_attr* %11 to i64*
store i64 %10, i64* %12
%13 = load i8*, i8** %7
%14 = load %union.bpf_attr*, %union.bpf_attr** %5
%15 = bitcast %union.bpf_attr* %14 to i8**
store i8* %13, i8** %15
%16 = load i8*, i8** %8
%17 = load %union.bpf_attr*, %union.bpf_attr** %5
%18 = bitcast %union.bpf_attr* %17 to i8**
store i8* %16, i8** %18
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_obj_pin(%union.bpf_attr* nocapture writeonly %0, i8* %1, i8* nocapture readnone %2, i8* %3) {
%5 = getelementptr %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0
store i8* %3, i8** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ tty_restore();
void sig_tty_restore(int signo) {
  tty_restore();
  die("Data transfer interrupted");
}


x86 assembly (clang, -O0):
<sig_tty_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tty_restore@plt>
lea    0xec7(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_tty_restore>:
push   %rax
xor    %eax,%eax
call   1030 <tty_restore@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Data transfer interrupted\00"
define void @sig_tty_restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tty_restore()
%4 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Data transfer interrupted\00"
define void @sig_tty_restore(i32 %0) {
%2 = tail call i32 (...) @tty_restore()
%3 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long TicksToSecs(unsigned long tickamount) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @TicksToSecs(i64 %0) {
ret i64 0
}
unsigned char UARTReadChar(void) {
  while (((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x01) == 0)
    ;
  return (*(volatile unsigned long *)(0xE000C000 + 0x00));
}


x86 assembly (clang, -O0):
<UARTReadChar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UARTReadChar+0x9>
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1124 <UARTReadChar+0x24>
jmp    1109 <UARTReadChar+0x9>
mov    $0xe000c000,%eax
mov    (%rax),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTReadChar>:
mov    $0xe000c000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,0x14(%rax)
je     1110 <UARTReadChar+0x10>
mov    (%rax),%rax
ret

LLVM IR (-O0):
define zeroext i8 @UARTReadChar() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%8 = trunc i64 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @UARTReadChar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
void start(double *in) {
  __asm__ volatile("movapd	%0, %%xmm0\n"
                   "movapd	%1, %%xmm1\n"
                   "addpd	%%xmm0, %%xmm1\n"
                   "sqrtpd	%%xmm1, %%xmm2\n"
                   :
                   : "m"(in[0]), "m"(in[2]));
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x10,%rcx
movapd (%rax),%xmm0
movapd (%rcx),%xmm1
addpd  %xmm0,%xmm1
sqrtpd %xmm1,%xmm2
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
movapd (%rdi),%xmm0
movapd 0x10(%rdi),%xmm1
addpd  %xmm0,%xmm1
sqrtpd %xmm1,%xmm2
ret

LLVM IR (-O0):
define void @start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 2
ret void
}

LLVM IR (-O2):
define void @start(double* %0) {
%2 = getelementptr inbounds double, double* %0, i64 2
tail call void asm sideeffect "movapd\09$0, %xmm0\0Amovapd\09$1, %xmm1\0Aaddpd\09%xmm0, %xmm1\0Asqrtpd\09%xmm1, %xmm2\0A", "*m,*m,~{dirflag},~{fpsr},~{flags}"(double* elementtype(double) %0, double* elementtype(double) %2)
ret void
}
/* Variables and functions */
int atoi(char *);
char *extractIpaddress(char *, char, char);
int extractNodeno(char *buff) {
  char *nodeno = extractIpaddress(buff, ')', '[');
  return atoi(nodeno);
}


x86 assembly (clang, -O0):
<extractNodeno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x29,%esi
mov    $0x5b,%edx
call   1030 <extractIpaddress@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractNodeno>:
push   %rax
mov    $0x29,%esi
mov    $0x5b,%edx
call   1030 <extractIpaddress@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @extractNodeno(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @extractIpaddress(i8* %4, i8 signext 41, i8 signext 91)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @atoi(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @extractNodeno(i8* %0) {
%2 = tail call i8* @extractIpaddress(i8* %0, i8 signext 41, i8 signext 91)
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIM_power_dump_tech_para();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  SIM_power_dump_tech_para();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <SIM_power_dump_tech_para@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @SIM_power_dump_tech_para()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @SIM_power_dump_tech_para()
%4 = tail call i32 @exit(i32 0)
unreachable
}
int atoi(int *s) {
  int n = 0;
  int *p = s;
  int i;
  for (i = 0; *s++ != '\0'; i++)
    ;
  while (p == s)
    n = 10 * n + (*s-- - '0');
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1149 <atoi+0x49>
jmp    113b <atoi+0x3b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <atoi+0x1e>
jmp    114e <atoi+0x4e>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    117e <atoi+0x7e>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x8(%rbp)
mov    (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <atoi+0x4e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0x0,(%rdi,%rcx,1)
lea    0x4(%rcx),%rcx
jne    1110 <atoi+0x10>
xor    %eax,%eax
test   %rcx,%rcx
je     1122 <atoi+0x22>
ret
mov    (%rdi),%eax
add    $0xffffffd0,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = icmp eq i32* %4, %0
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = load i32, i32* %0
%11 = add i32 %10, -48
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ 0, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char const *, char *);
int /*<<< orphan*/ printf(char *, char const *);
int run_cmd(const char *cmd) {
  FILE *gnuplotOut = popen(cmd, "r");
  int status = pclose(gnuplotOut);
  if (status == -1) {
    printf("Could not run [%s]\n", cmd);
  }
  return status;
}


x86 assembly (clang, -O0):
<run_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pclose@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1176 <run_cmd+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_cmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec3(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rdi
call   1040 <pclose@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1160 <run_cmd+0x30>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Could not run [%s]\0A\00"
define i32 @run_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @popen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @pclose(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"Could not run [%s]\0A\00"
define i32 @run_cmd(i8* %0) {
%2 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pclose(i32* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret i32 %3
}
void writeWord(unsigned char *p, unsigned long v) {
  p[1] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[0] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<writeWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeWord>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @writeWord(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @writeWord(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ flags;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int set_reuseaddr(int fd, void *optval, int optlen) {
  int rc;
  int flags = *(int *)optval ? 1 : 0;
  rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
  return rc;
}


x86 assembly (clang, -O0):
<set_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_reuseaddr>:
push   %rax
xor    %eax,%eax
cmpl   $0x0,(%rsi)
setne  %al
mov    %eax,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %8
%15 = load i32, i32* %4
%16 = load i32, i32* @SOL_SOCKET
%17 = load i32, i32* @SO_REUSEADDR
%18 = call i32 @setsockopt(i32 %15, i32 %16, i32 %17, i32* %8, i32 4)
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @set_reuseaddr(i32 %0, i8* nocapture %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* @SOL_SOCKET
%11 = load i32, i32* @SO_REUSEADDR
%12 = call i32 @setsockopt(i32 %0, i32 %10, i32 %11, i32* %4, i32 4)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printl(char *);
int test2() {
  printl("Second test");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Second test\00"
define i32 @test2() {
%1 = call i32 @printl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Second test\00"
define i32 @test2() {
%1 = tail call i32 @printl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long long get_cpu_clock(void) {
  unsigned long ret;
  __asm__ __volatile__("rdtsc" : "=A"(ret));
  return ret;
}


x86 assembly (clang, -O0):
<get_cpu_clock>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @get_cpu_clock() {
%1 = alloca i64
%2 = call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_cpu_clock() {
%1 = tail call i64 asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void a(void) {
  double __logbw = 1;
  if (__extension__(({
        __typeof((__logbw)) x_ = (__logbw);
        !__builtin_isinf((x_)) && !__builtin_isnan((x_));
      })))
    __logbw = 1;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee9(%rip),%xmm1
pand   %xmm1,%xmm0
xor    %eax,%eax
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x15(%rbp)
jne    114d <a+0x4d>
jp     114d <a+0x4d>
jmp    115e <a+0x5e>
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm0,%xmm0
setp   %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1180 <a+0x80>
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @a() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
store double 1.000000e+00, double* %1
%4 = load double, double* %1
store double %4, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fabs.f64(double %5)
%7 = fcmp oeq double %6, 0x7FF0000000000000
br i1 %7, label %12, label %8
8: ; preds = %0
%9 = load double, double* %2
%10 = fcmp uno double %9, %9
%11 = xor i1 %10, true
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store double 1.000000e+00, double* %1
br label %18
18: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
define void @a() {
ret void
}
int ft_isblk(int c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<ft_isblk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <ft_isblk+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isblk>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isblk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isblk(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void sum_keys(int key, void *valp0, void *sump0) {
  int *sump = sump0;
  *sump += key;
}


x86 assembly (clang, -O0):
<sum_keys>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_keys>:
add    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @sum_keys(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @sum_keys(i32 %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %0
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sound_ioctl(int, int /*<<< orphan*/);
int main() {
  sound_ioctl(2, 0);
  int len;
  unsigned long value;
  void *p = &value;
  if ((unsigned long)p == (unsigned long)((void *)0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <sound_ioctl@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    114d <main+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <main+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 @sound_ioctl(i32 2, i32 0)
%6 = bitcast i64* %3 to i8*
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sound_ioctl(i32 2, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int errno;
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int tosMutex_unlock(pthread_mutex_t *mx) {
  int res = 0;
  res = pthread_mutex_unlock(mx);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosMutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <tosMutex_unlock+0x3c>
mov    -0xc(%rbp),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMutex_unlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     112a <tosMutex_unlock+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosMutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* @errno
br label %5
5: ; preds = %4, %1
%6 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %6
}
int xrealloc(ptr, size)
char *ptr;
int size;
{
  int result = realloc(ptr, size);
  if (!result)
    fatal("virtual memory exhausted");
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rsi
call   1030 <realloc@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1157 <xrealloc+0x37>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
movslq %esi,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %ebx,%ebx
jne    113e <xrealloc+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i32 @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i32 @xrealloc(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 %6
}