xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int (*xGetLastError)(TYPE_1__ *, int, char *);
  scalar_t__ pAppData;
};
typedef TYPE_1__ sqlite3_vfs;

/* Variables and functions */
int stub1(TYPE_1__ *, int, char *);
int memGetLastError(sqlite3_vfs *pVfs, int a, char *b) {
  return ((sqlite3_vfs *)((pVfs)->pAppData))
      ->xGetLastError(((sqlite3_vfs *)((pVfs)->pAppData)), a, b);
}


x86 assembly (clang, -O0):
<memGetLastError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memGetLastError>:
mov    0x8(%rdi),%rdi
mov    (%rdi),%rax
jmp    *%rax

LLVM IR (-O0):
%struct.TYPE_4__ = type { {}*, i64 }
define i32 @memGetLastError(%struct.TYPE_4__* %0, i32 %1, i8* %2) {
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32
%6 = alloca i8*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to %struct.TYPE_4__*
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = bitcast {}** %11 to i32 (%struct.TYPE_4__*, i32, i8*)**
%13 = load i32 (%struct.TYPE_4__*, i32, i8*)*, i32 (%struct.TYPE_4__*, i32, i8*)** %12
%14 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = inttoptr i64 %16 to %struct.TYPE_4__*
%18 = load i32, i32* %5
%19 = load i8*, i8** %6
%20 = call i32 %13(%struct.TYPE_4__* %17, i32 %18, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { {}*, i64 }
define i32 @memGetLastError(%struct.TYPE_4__* nocapture %0, i32 %1, i8* %2) {
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to %struct.TYPE_4__*
%7 = inttoptr i64 %5 to i32 (%struct.TYPE_4__*, i32, i8*)**
%8 = load i32 (%struct.TYPE_4__*, i32, i8*)*, i32 (%struct.TYPE_4__*, i32, i8*)** %7
%9 = tail call i32 %8(%struct.TYPE_4__* %6, i32 %1, i8* %2)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi16(int /*<<< orphan*/);
__m128i x265_m8s_max_m8s_int32(__m128i a, int32_t i) {
  __m128i b;
  b = _mm_set1_epi16(i);
  return _mm_max_epi16(a, b);
}


x86 assembly (clang, -O0):
<x265_m8s_max_m8s_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_mm_set1_epi16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <_mm_max_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x265_m8s_max_m8s_int32>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <_mm_set1_epi16@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm_max_epi16@plt>

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

LLVM IR (-O2):
define i32 @x265_m8s_max_m8s_int32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_set1_epi16(i32 %1)
%4 = tail call i32 @_mm_max_epi16(i32 %0, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_THREAD_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t rc_nanos_thread_time() {
  struct timespec ts;
  clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
  return ((uint64_t)ts.tv_sec * 1000000000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<rc_nanos_thread_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_nanos_thread_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i32 @rc_nanos_thread_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_THREAD_CPUTIME_ID = global i32 0
define i32 @rc_nanos_thread_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_THREAD_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void quit(const char *reason) {
  if (reason != NULL)
    fprintf(stderr, "%s\n", reason);
  fprintf(stderr, "Exiting...\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <quit+0x32>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
test   %rdi,%rdi
je     1140 <quit+0x20>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Exiting...\0A\00"
@EXIT_FAILURE = global i32 0
define void @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Exiting...\0A\00"
@EXIT_FAILURE = global i32 0
define void @quit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
int m2_min(int a, int b) {
  if (a <= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<m2_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <m2_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <m2_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m2_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @m2_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int extGcd(int, int, int *, int *);
int invMod(int n, int p) {
  int x, y, g = extGcd(n, p, &x, &y);
  if (g == 1)
    return x;
  else if (g == -1)
    return -x;
  else
    return 0;
}


x86 assembly (clang, -O0):
<invMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <extGcd@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1149 <invMod+0x39>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <invMod+0x57>
cmpl   $0xffffffff,-0x18(%rbp)
jne    1160 <invMod+0x50>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <invMod+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invMod>:
push   %rax
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
call   1030 <extGcd@plt>
cmp    $0xffffffff,%eax
je     1131 <invMod+0x21>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1136 <invMod+0x26>
mov    (%rsp),%eax
pop    %rcx
ret
xor    %eax,%eax
sub    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @invMod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @extGcd(i32 %0, i32 %1, i32* %3, i32* %4)
switch i32 %7, label %13 [
i32 1, label %8
i32 -1, label %10
]
8: ; preds = %2
%9 = load i32, i32* %3
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %2, %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ], [ 0, %2 ]
ret i32 %14
}
float clamp_0to1(float x) {
  if (x < 0)
    return 0;
  if (x > 1.0)
    return 1.0;
  return x;
}


x86 assembly (clang, -O0):
<clamp_0to1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <clamp_0to1+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <clamp_0to1+0x5a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <clamp_0to1+0x50>
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <clamp_0to1+0x5a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_0to1>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @clamp_0to1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Variables and functions */
void *mmp_load(void *);
void *__mmp_load_agent(void *addr) { return mmp_load(addr); }


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

x86 assembly (clang, -O2):
<__mmp_load_agent>:
jmp    1030 <mmp_load@plt>

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

LLVM IR (-O2):
define i8* @__mmp_load_agent(i8* %0) {
%2 = tail call i8* @mmp_load(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int strlcpy(char *, char *, int);
int main(void) {
  char buf[2] = "";
  return !(strlcpy(buf, "a", sizeof(buf)) == 1 && buf[0] == 'a' &&
           buf[1] == '\0');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
lea    -0x6(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2,%edx
call   1040 <strlcpy@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x7(%rbp)
jne    1183 <main+0x63>
movsbl -0x6(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x7(%rbp)
jne    1183 <main+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x0,0x6(%rsp)
lea    0xee1(%rip),%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <strlcpy@plt>
cmp    $0x1,%eax
setne  %al
cmpb   $0x61,0x6(%rsp)
setne  %cl
or     %al,%cl
cmpb   $0x0,0x7(%rsp)
setne  %al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %17
7: ; preds = %0
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 97
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br label %17
17: ; preds = %12, %7, %0
%18 = phi i1 [ false, %7 ], [ false, %0 ], [ %16, %12 ]
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 0, i16* %1
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = icmp ne i32 %3, 1
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 97
%7 = select i1 %4, i1 true, i1 %6
%8 = bitcast i16* %1 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 1
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = select i1 %7, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ xAbort(int, char const *);
void cAbort(int r, const char *function) {
  if (r != 0)
    xAbort(r, function);
}


x86 assembly (clang, -O0):
<cAbort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <cAbort+0x25>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <xAbort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cAbort>:
test   %edi,%edi
je     1119 <cAbort+0x9>
jmp    1030 <xAbort@plt>
ret

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

LLVM IR (-O2):
define void @cAbort(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @xAbort(i32 %0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int a;
  char n;
  scanf("%c", &n);
  a = 122 - (n - 97);
  printf("%c", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x9(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%eax
mov    $0xdb,%esi
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = sub nsw i32 122, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 219, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void xxx() {
  int *a = &(int){1};
  struct s {
    int a, b, c;
  } *b = &(struct s){1, 2, 3};
  _Complex double *x = &(_Complex double){1.0f};
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x2,-0x24(%rbp)
movl   $0x3,-0x20(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s = type { i32, i32, i32 }
define void @xxx() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca %struct.s*
%4 = alloca %struct.s
%5 = alloca { double, double }*
%6 = alloca { double, double }
store i32 1, i32* %2
store i32* %2, i32** %1
%7 = getelementptr inbounds %struct.s, %struct.s* %4, i32 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds %struct.s, %struct.s* %4, i32 0, i32 1
store i32 2, i32* %8
%9 = getelementptr inbounds %struct.s, %struct.s* %4, i32 0, i32 2
store i32 3, i32* %9
store %struct.s* %4, %struct.s** %3
%10 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%11 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double 1.000000e+00, double* %10
store double 0.000000e+00, double* %11
store { double, double }* %6, { double, double }** %5
ret void
}

LLVM IR (-O2):
%struct.s = type { i32, i32, i32 }
define void @xxx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_exit();
int /*<<< orphan*/ write_log(int, char *, char *);
void handle_term() {
  write_log(2,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/"
            "signalhandler.c",
            "SIGTERM recieved");
  clean_exit();
}


x86 assembly (clang, -O0):
<handle_term>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
lea    0xf5a(%rip),%rdx
call   1040 <write_log@plt>
mov    $0x0,%al
call   1030 <clean_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_term>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xf62(%rip),%rdx
mov    $0x2,%edi
call   1040 <write_log@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clean_exit@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/signalhandler.c\00"
@.str.1 = [17 x i8] c"SIGTERM recieved\00"
define void @handle_term() {
%1 = call i32 @write_log(i32 2, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @clean_exit()
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/blueness/hwmultd/refs/heads/master/src/signalhandler.c\00"
@.str.1 = [17 x i8] c"SIGTERM recieved\00"
define void @handle_term() {
%1 = tail call i32 @write_log(i32 2, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @clean_exit()
ret void
}
/* Variables and functions */
long lround(long double);
long lroundl(long double a1) { return lround(a1); }


x86 assembly (clang, -O0):
<lroundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lround@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lroundl>:
jmp    1030 <lround@plt>

LLVM IR (-O0):
define i64 @lroundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @lround(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lroundl(x86_fp80 %0) {
%2 = tail call i64 @lround(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[2];
  array[0] = 0;
  array[1] = 1;
  printf("%d\n", *array);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void test_log_out_of_sync() {}


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

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

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

LLVM IR (-O2):
define void @test_log_out_of_sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test(int);
int main() {
  if (test(123) != 123)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7b,%edi
call   1040 <test@plt>
cmp    $0x7b,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1040 <test@plt>
cmp    $0x7b,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 123)
%3 = icmp ne i32 %2, 123
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 123)
%2 = icmp eq i32 %1, 123
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
void test_type() {
  char a;
  short b;
  int c;
  long d;
  long long e;
  short int f;
  long int g;
  long long int h;
  long int long i;
  float j;
  double k;
  long double l;
  _Bool m;
  bool n;
}


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

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

LLVM IR (-O0):
define void @test_type() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca float
%11 = alloca double
%12 = alloca x86_fp80
%13 = alloca i8
%14 = alloca i32
ret void
}

LLVM IR (-O2):
define void @test_type() {
ret void
}
int enet_initialize(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @enet_initialize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @enet_initialize() {
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double timer_get_time(void) {
  struct timespec time_now;
  double result_sec_now;
  clock_gettime(CLOCK_MONOTONIC, &time_now);
  result_sec_now = (time_now.tv_sec) + (time_now.tv_nsec) * 1e-9;
  return result_sec_now;
}


x86 assembly (clang, -O0):
<timer_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_get_time>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl (%rsp),%xmm1
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @timer_get_time() {
%1 = alloca %struct.timespec
%2 = alloca double
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
store double %11, double* %2
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @timer_get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
ret double %11
}
void test___atomic_compare_exchange_0(char *mem) {
  char expected = 1;
  char desired = 5;
  __atomic_compare_exchange(mem, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test___atomic_compare_exchange_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
movb   $0x5,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x9(%rbp),%al
mov    -0xa(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0xd(%rbp)
mov    %cl,-0xc(%rbp)
test   $0x1,%al
jne    1137 <test___atomic_compare_exchange_0+0x37>
mov    -0xc(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
mov    %al,-0xb(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_compare_exchange_0>:
mov    $0x5,%cl
mov    $0x1,%al
lock cmpxchg %cl,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_compare_exchange_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %2
store i8 1, i8* %3
store i8 5, i8* %4
%6 = load i8*, i8** %2
%7 = load i8, i8* %3
%8 = load i8, i8* %4
%9 = cmpxchg i8* %6, i8 %7, i8 %8 acq_rel monotonic
%10 = extractvalue { i8, i1 } %9, 0
%11 = extractvalue { i8, i1 } %9, 1
br i1 %11, label %13, label %12
12: ; preds = %1
store i8 %10, i8* %3
br label %13
13: ; preds = %12, %1
%14 = zext i1 %11 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = trunc i8 %15 to i1
ret void
}

LLVM IR (-O2):
define void @test___atomic_compare_exchange_0(i8* nocapture %0) {
%2 = cmpxchg i8* %0, i8 1, i8 5 acq_rel monotonic
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap32(int /*<<< orphan*/);
uint32_t be32_to_cpu(uint32_t x) { return bswap32(x); }


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

x86 assembly (clang, -O2):
<be32_to_cpu>:
jmp    1030 <bswap32@plt>

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

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 %0) {
%2 = tail call i32 @bswap32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ dds_lookup(int);
int16_t dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale,
                int32_t phase) {
  int16_t amp;
  amp = (int16_t)(((int32_t)dds_lookup(*phase_acc + phase) * (int32_t)scale) >>
                  15);
  *phase_acc += phase_rate;
  return amp;
}


x86 assembly (clang, -O0):
<dds_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
add    -0x1c(%rbp),%edi
call   1030 <dds_lookup@plt>
mov    -0x18(%rbp),%rcx
imul   %ecx,%eax
sar    $0xf,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_mod>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
add    (%rdi),%ecx
mov    %ecx,%edi
call   1030 <dds_lookup@plt>
imul   %eax,%ebx
sar    $0xf,%ebx
movslq %ebx,%rax
add    %r14d,0x0(%rbp)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @dds_mod(i32* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
%14 = call i64 @dds_lookup(i32 %13)
%15 = trunc i64 %14 to i32
%16 = load i64, i64* %7
%17 = trunc i64 %16 to i32
%18 = mul nsw i32 %15, %17
%19 = ashr i32 %18, 15
%20 = sext i32 %19 to i64
store i64 %20, i64* %9
%21 = load i32, i32* %6
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %21
store i32 %24, i32* %22
%25 = load i64, i64* %9
ret i64 %25
}

LLVM IR (-O2):
define i64 @dds_mod(i32* nocapture %0, i32 %1, i64 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = add nsw i32 %5, %3
%7 = tail call i64 @dds_lookup(i32 %6)
%8 = trunc i64 %7 to i32
%9 = trunc i64 %2 to i32
%10 = mul nsw i32 %8, %9
%11 = ashr i32 %10, 15
%12 = sext i32 %11 to i64
%13 = load i32, i32* %0
%14 = add nsw i32 %13, %1
store i32 %14, i32* %0
ret i64 %12
}
/* Variables and functions */
void *restore_eltN_l(int, int /*<<< orphan*/);
void *restore_eltN(int fd) { return restore_eltN_l(fd, 0); }


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

x86 assembly (clang, -O2):
<restore_eltN>:
xor    %esi,%esi
jmp    1030 <restore_eltN_l@plt>

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

LLVM IR (-O2):
define i8* @restore_eltN(i32 %0) {
%2 = tail call i8* @restore_eltN_l(i32 %0, i32 0)
ret i8* %2
}
void cdiClearAdditionalKeys() {}


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

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

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

LLVM IR (-O2):
define void @cdiClearAdditionalKeys() {
ret void
}
void GaussRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @GaussRow_NEON() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t do_read_uint16(void *src) {
  uint8_t *d = (uint8_t *)src;
  return (d[0] << 8) | d[1];
}


x86 assembly (clang, -O0):
<do_read_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_read_uint16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @do_read_uint16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @do_read_uint16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ editor_init();
int /*<<< orphan*/ editor_open(char *);
int /*<<< orphan*/ editor_process_key();
int /*<<< orphan*/ editor_refresh_screen();
int /*<<< orphan*/ raw_mode_enable();
int main(int argc, char *argv[]) {
  raw_mode_enable();
  editor_init();
  if (argc >= 2)
    editor_open(argv[1]);
  while (1) {
    editor_refresh_screen();
    editor_process_key();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <raw_mode_enable@plt>
mov    $0x0,%al
call   1030 <editor_init@plt>
cmpl   $0x2,-0x8(%rbp)
jl     118b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <editor_open@plt>
jmp    1190 <main+0x40>
mov    $0x0,%al
call   1040 <editor_refresh_screen@plt>
mov    $0x0,%al
call   1060 <editor_process_key@plt>
jmp    1190 <main+0x40>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <raw_mode_enable@plt>
xor    %eax,%eax
call   1030 <editor_init@plt>
cmp    $0x2,%ebp
jl     1180 <main+0x30>
mov    0x8(%rbx),%rdi
call   1050 <editor_open@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <editor_refresh_screen@plt>
xor    %eax,%eax
call   1060 <editor_process_key@plt>
jmp    1180 <main+0x30>

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 (...) @raw_mode_enable()
%7 = call i32 (...) @editor_init()
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @editor_open(i8* %13)
br label %15
15: ; preds = %10, %2
br label %16
16: ; preds = %15, %16
%17 = call i32 (...) @editor_refresh_screen()
%18 = call i32 (...) @editor_process_key()
br label %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @raw_mode_enable()
%4 = tail call i32 (...) @editor_init()
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @editor_open(i8* %8)
br label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %10, %11
%12 = tail call i32 (...) @editor_refresh_screen()
%13 = tail call i32 (...) @editor_process_key()
br label %11
}
void intel_th_debug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @intel_th_debug_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _citrus_esdb_free_list(char **, size_t);
void __iconv_free_list(char **list, size_t sz) {
  _citrus_esdb_free_list(list, sz);
}


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

x86 assembly (clang, -O2):
<__iconv_free_list>:
jmp    1030 <_citrus_esdb_free_list@plt>

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

LLVM IR (-O2):
define void @__iconv_free_list(i8** %0, i64 %1) {
%3 = tail call i32 @_citrus_esdb_free_list(i8** %0, i64 %1)
ret void
}
getgid() { return 20; }


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

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

LLVM IR (-O0):
define i32 @getgid() {
ret i32 20
}

LLVM IR (-O2):
define i32 @getgid() {
ret i32 20
}
int test_imm_4Fint16_reg(short val) {
  return ((val) & (-0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fint16_reg>:
test   $0xffb1,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -79
%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_4Fint16_reg(i16 signext %0) {
%2 = and i16 %0, -79
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "Usage: %s $type $filename\n"
          "  type: -x, where x is one of {r,b,q}\n"
          "  parses file as a Response, reQuest, or Both\n",
          name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [111 x i8] c"Usage: %s $type $filename\0A type: -x, where x is one of {r,b,q}\0A parses file as a Response, reQuest, or Both\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [111 x i8] c"Usage: %s $type $filename\0A type: -x, where x is one of {r,b,q}\0A parses file as a Response, reQuest, or Both\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void lshosts_printwide(struct hostInfo *hostinfo) {}


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

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

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

LLVM IR (-O2):
%struct.hostInfo = type opaque
define void @lshosts_printwide(%struct.hostInfo* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ang_sort_aux(void *, void *, int /*<<< orphan*/, int);
void ang_sort(void *u, void *v, int n) { ang_sort_aux(u, v, 0, n - 1); }


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

x86 assembly (clang, -O2):
<ang_sort>:
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
jmp    1030 <ang_sort_aux@plt>

LLVM IR (-O0):
define void @ang_sort(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @ang_sort_aux(i8* %7, i8* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @ang_sort(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @ang_sort_aux(i8* %0, i8* %1, i32 0, i32 %4)
ret void
}
int os_get_sockerr(int fd) {
  int err = 0;
  return err;
}


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

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

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

LLVM IR (-O2):
define i32 @os_get_sockerr(i32 %0) {
ret i32 0
}
int sum(const int *n1, const int *n2) { return *n1 + *n2; }


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

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

LLVM IR (-O0):
define i32 @sum(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}