xunge/DecIR huggingface dataset:
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int unlink(char const *);
int shm_unlink(const char *path) {
  int len = strlen(path);
  char *pathbuf = alloca(len + 10);
  memcpy(pathbuf, "/dev/shm/", 9);
  memcpy(pathbuf + 9, path, len + 1);
  return unlink(path);
}


x86 assembly (clang, -O0):
<shm_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0xa,%edi
call   1050 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe8e(%rip),%rsi
mov    $0x9,%edx
call   1060 <memcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x9,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1060 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_unlink>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0xa(%r15),%edi
call   1050 <alloca@plt>
mov    %rax,%rbx
lea    0xe9d(%rip),%rsi
mov    %rax,%rdi
mov    $0x9,%edx
call   1060 <memcpy@plt>
add    $0x9,%rbx
add    $0x1,%r15d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1060 <memcpy@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/shm/\00"
define i32 @shm_unlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 10
%9 = call i8* @alloca(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @memcpy(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 9
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i32 %16)
%18 = load i8*, i8** %2
%19 = call i32 @unlink(i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/shm/\00"
define i32 @shm_unlink(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 10
%4 = tail call i8* @alloca(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%6 = getelementptr inbounds i8, i8* %4, i64 9
%7 = add nsw i32 %2, 1
%8 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %7)
%9 = tail call i32 @unlink(i8* %0)
ret i32 %9
}
void test51_BufferTest_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test51_BufferTest_targetInit__I() {
ret void
}
/* Type definitions */
struct iax_ie_data {
  int dummy;
};

/* Variables and functions */
int iax_ie_append_raw(struct iax_ie_data *, unsigned char, unsigned char *,
                      int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie,
                      unsigned char *str) {
  return iax_ie_append_raw(ied, ie, str, strlen((char *)str));
}


x86 assembly (clang, -O0):
<iax_ie_append_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x19(%rbp),%al
movzbl %al,%esi
call   1040 <iax_ie_append_raw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iax_ie_append_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <iax_ie_append_raw@plt>

LLVM IR (-O0):
%struct.iax_ie_data = type { i32 }
define i32 @iax_ie_append_str(%struct.iax_ie_data* %0, i8 zeroext %1, i8* %2) {
%4 = alloca %struct.iax_ie_data*
%5 = alloca i8
%6 = alloca i8*
store %struct.iax_ie_data* %0, %struct.iax_ie_data** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load %struct.iax_ie_data*, %struct.iax_ie_data** %4
%8 = load i8, i8* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @iax_ie_append_raw(%struct.iax_ie_data* %7, i8 zeroext %8, i8* %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.iax_ie_data = type { i32 }
define i32 @iax_ie_append_str(%struct.iax_ie_data* %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @iax_ie_append_raw(%struct.iax_ie_data* %0, i8 zeroext %1, i8* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ I2CVMUserProgramHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void I2CVMUserProgramUpdated() { UAVObjUpdated(I2CVMUserProgramHandle()); }


x86 assembly (clang, -O0):
<I2CVMUserProgramUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <I2CVMUserProgramHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CVMUserProgramUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <I2CVMUserProgramHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @I2CVMUserProgramUpdated() {
%1 = call i32 (...) @I2CVMUserProgramHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @I2CVMUserProgramUpdated() {
%1 = tail call i32 (...) @I2CVMUserProgramHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int mfspr(scalar_t__);
int /*<<< orphan*/ mtspr(scalar_t__, int);
int int_enable(unsigned long irq) {
  if (irq >= 32)
    return -1;
  mtspr(((9 << (11)) + 0), mfspr(((9 << (11)) + 0)) | (0x00000001L << irq));
  return 0;
}


x86 assembly (clang, -O0):
<int_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x20,-0x10(%rbp)
jb     1143 <int_enable+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <int_enable+0x54>
mov    $0x4800,%edi
call   1030 <mfspr@plt>
cltq
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
mov    %eax,%esi
mov    $0x4800,%edi
call   1040 <mtspr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_enable>:
mov    $0xffffffff,%eax
cmp    $0x1f,%rdi
ja     1152 <int_enable+0x32>
push   %rbx
mov    %rdi,%rbx
mov    $0x4800,%edi
call   1030 <mfspr@plt>
mov    $0x1,%esi
mov    %ebx,%ecx
shl    %cl,%rsi
or     %eax,%esi
mov    $0x4800,%edi
call   1040 <mtspr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @int_enable(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp uge i64 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %15
7: ; preds = %1
%8 = call i32 @mfspr(i64 18432)
%9 = sext i32 %8 to i64
%10 = load i64, i64* %3
%11 = shl i64 1, %10
%12 = or i64 %9, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @mtspr(i64 18432, i32 %13)
store i32 0, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @int_enable(i64 %0) {
%2 = icmp ugt i64 %0, 31
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @mfspr(i64 18432)
%5 = shl nuw nsw i64 1, %0
%6 = trunc i64 %5 to i32
%7 = or i32 %4, %6
%8 = tail call i32 @mtspr(i64 18432, i32 %7)
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %10
}
void safe_addf(float *sum, float *c, float x) {
  float y = x - *c;
  float t = *sum + y;
  *c = (t - *sum) - y;
  *sum = t;
}


x86 assembly (clang, -O0):
<safe_addf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
subss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_addf>:
subss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movaps %xmm1,%xmm2
addss  %xmm0,%xmm2
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
subss  %xmm0,%xmm3
movss  %xmm3,(%rsi)
movss  %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @safe_addf(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fsub float %9, %11
store float %12, float* %7
%13 = load float*, float** %4
%14 = load float, float* %13
%15 = load float, float* %7
%16 = fadd float %14, %15
store float %16, float* %8
%17 = load float, float* %8
%18 = load float*, float** %4
%19 = load float, float* %18
%20 = fsub float %17, %19
%21 = load float, float* %7
%22 = fsub float %20, %21
%23 = load float*, float** %5
store float %22, float* %23
%24 = load float, float* %8
%25 = load float*, float** %4
store float %24, float* %25
ret void
}

LLVM IR (-O2):
define void @safe_addf(float* nocapture %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fsub float %2, %4
%6 = load float, float* %0
%7 = fadd float %6, %5
%8 = fsub float %7, %6
%9 = fsub float %8, %5
store float %9, float* %1
store float %7, float* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ on;

/* Variables and functions */
int setsockopt(int, int, int, void *, int);
int silc_net_set_socket_opt(int sock, int level, int option, int on) {
  return setsockopt(sock, level, option, (void *)&on, sizeof(on));
}


x86 assembly (clang, -O0):
<silc_net_set_socket_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silc_net_set_socket_opt>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @silc_net_set_socket_opt(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 = bitcast i32* %8 to i8*
%13 = call i32 @setsockopt(i32 %9, i32 %10, i32 %11, i8* %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
define i32 @silc_net_set_socket_opt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = bitcast i32* %5 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %6, i32 4)
ret i32 %7
}
/* Variables and functions */
scalar_t__ isxdigit(char);
int is_ip_char(char c) { return isxdigit(c) || c == ':' || c == '.'; }


x86 assembly (clang, -O0):
<is_ip_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isxdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <is_ip_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x2(%rbp)
je     1158 <is_ip_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ip_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isxdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x3a,%bl
sete   %cl
cmp    $0x2e,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_ip_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isxdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 58
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_ip_char(i8 signext %0) {
%2 = tail call i64 @isxdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 58
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 46
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_METHOD;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ abort();
int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method) { abort(); }


x86 assembly (clang, -O0):
<SSL_set_ssl_method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<SSL_set_ssl_method>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @SSL_set_ssl_method(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @SSL_set_ssl_method(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
void stress_thrash_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @stress_thrash_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int, int, int, int);
void Viewport(int x, int y, int w, int h) { glViewport(x, y, w, h); }


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

x86 assembly (clang, -O2):
<Viewport>:
jmp    1030 <glViewport@plt>

LLVM IR (-O0):
define void @Viewport(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 @glViewport(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Viewport(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glViewport(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
int __cxa_atexit(void (*fn)(void *), void *arg, void *d) { return 0; }


x86 assembly (clang, -O0):
<__cxa_atexit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__cxa_atexit(void (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IN_NONBLOCK;
int inotify_init1(int /*<<< orphan*/);
int main() {
  int ret = inotify_init1(IN_NONBLOCK);
  return 0;
}


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

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

LLVM IR (-O0):
@IN_NONBLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IN_NONBLOCK
%4 = call i32 @inotify_init1(i32 %3)
store i32 %4, i32* %2
ret i32 0
}

LLVM IR (-O2):
@IN_NONBLOCK = global i32 0
define i32 @main() {
%1 = load i32, i32* @IN_NONBLOCK
%2 = tail call i32 @inotify_init1(i32 %1)
ret i32 0
}
void slang_prog_mode(void) {}


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

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

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

LLVM IR (-O2):
define void @slang_prog_mode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x05() {
  Assert_real((isgraph(5) == 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_isgraph.c",
              30, ("isgraph should be 0 for 0x05"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x05>:
push   %rax
mov    $0x5,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x05\00"
define void @t_isgraph_0x05() {
%1 = call i64 @isgraph(i32 5)
%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 30, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x05\00"
define void @t_isgraph_0x05() {
%1 = tail call i64 @isgraph(i32 5)
%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 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buf *);
__attribute__((visibility("default"))) void buf_free(struct buf *buf) {
  free(buf);
}


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

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

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

LLVM IR (-O2):
%struct.buf = type { i32 }
define void @buf_free(%struct.buf* nocapture %0) {
%2 = tail call i32 @free(%struct.buf* %0)
ret void
}
int total_days(int year, int month, int day) {
  int days = 0;
  days += (365 * year) + (year / 4) - (year / 100) + (year / 400);
  days += (306 * (month + 1) / 10);
  days += day;
  days -= 429;
  return days;
}


x86 assembly (clang, -O0):
<total_days>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
imul   $0x16d,-0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
imul   $0x132,%eax,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1ad,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<total_days>:
imul   $0x16d,%edi,%eax
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
add    %eax,%ecx
movslq %edi,%r8
imul   $0xffffffffae147ae1,%r8,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
add    %ecx,%edi
imul   $0x51eb851f,%r8,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %edi,%eax
imul   $0x132,%esi,%ecx
add    $0x132,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %edx,%eax
add    %ecx,%eax
add    $0xfffffe53,%eax
ret

LLVM IR (-O0):
define i32 @total_days(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = mul nsw i32 365, %8
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 4
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %4
%14 = sdiv i32 %13, 100
%15 = sub nsw i32 %12, %14
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 400
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %7
%20 = add nsw i32 %19, %18
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = mul nsw i32 306, %22
%24 = sdiv i32 %23, 10
%25 = load i32, i32* %7
%26 = add nsw i32 %25, %24
store i32 %26, i32* %7
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = add nsw i32 %28, %27
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = sub nsw i32 %30, 429
store i32 %31, i32* %7
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @total_days(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 365
%5 = sdiv i32 %0, 4
%6 = sdiv i32 %0, -100
%7 = sdiv i32 %0, 400
%8 = mul i32 %1, 306
%9 = add i32 %8, 306
%10 = sdiv i32 %9, 10
%11 = add nsw i32 %5, -429
%12 = add i32 %11, %4
%13 = add i32 %12, %6
%14 = add i32 %13, %7
%15 = add i32 %14, %2
%16 = add i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void libamg_extensions_flash_save_config(void) {
  system("if [ ! -d /mnt/config/asterisk ]; then "
         "mkdir /mnt/config/asterisk; fi");
  system("cp "
         "/etc/asterisk/"
         "extensions.conf"
         " /mnt/config/asterisk");
}


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

x86 assembly (clang, -O2):
<libamg_extensions_flash_save_config>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xf22(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"if [ ! -d /mnt/config/asterisk ]; then mkdir /mnt/config/asterisk; fi\00"
@.str.1 = [54 x i8] c"cp /etc/asterisk/extensions.conf /mnt/config/asterisk\00"
define void @libamg_extensions_flash_save_config() {
%1 = call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"if [ ! -d /mnt/config/asterisk ]; then mkdir /mnt/config/asterisk; fi\00"
@.str.1 = [54 x i8] c"cp /etc/asterisk/extensions.conf /mnt/config/asterisk\00"
define void @libamg_extensions_flash_save_config() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *n = malloc(strlen(s) + 1);
  return strcpy(n, s);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
char *dir_file_pathname(dir, file)
char const *dir, *file;
{
  char const *p = strrchr(dir, '/');
  return concat(dir, "/" + (p && !p[1]), file);
}


x86 assembly (clang, -O0):
<dir_file_pathname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     116a <dir_file_pathname+0x4a>
mov    -0x18(%rbp),%rax
cmpb   $0x0,0x1(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
lea    0xe81(%rip),%rsi
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <concat@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_file_pathname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
je     1142 <dir_file_pathname+0x22>
cmpb   $0x0,0x1(%rax)
sete   %cl
lea    0xeb7(%rip),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <concat@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @dir_file_pathname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i32 47)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
%16 = xor i1 %15, true
br label %17
17: ; preds = %11, %2
%18 = phi i1 [ false, %2 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %20
%22 = load i8*, i8** %4
%23 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @concat to i32 (i8*, i8*, i8*, ...)*)(i8* %8, i8* %21, i8* %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
ret i8* %25
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @dir_file_pathname(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = zext i1 %8 to i64
br label %10
10: ; preds = %5, %2
%11 = phi i64 [ 0, %2 ], [ %9, %5 ]
%12 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 %11
%13 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @concat to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %12, i8* %1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}
void caller_1_2_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_2_1_2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeh_pd(double *, int /*<<< orphan*/);
void test_mm_storeh_pd(double *A, __m128d B) { _mm_storeh_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_storeh_pd>:
jmp    1030 <_mm_storeh_pd@plt>

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

LLVM IR (-O2):
define void @test_mm_storeh_pd(double* %0, i32 %1) {
%3 = tail call i32 @_mm_storeh_pd(double* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
gap_event_advertising_report_get_advertising_event_type(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<gap_event_advertising_report_get_advertising_event_type>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @gap_event_advertising_report_get_advertising_event_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sigcleanup(int signo) {
  fprintf(stderr, "signal %d\n", signo);
  exit(0);
}


x86 assembly (clang, -O0):
<sigcleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigcleanup>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"signal %d\0A\00"
define void @sigcleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"signal %d\0A\00"
define void @sigcleanup(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void vApplicationMallocFailedHook(void) { ; }


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

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

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

LLVM IR (-O2):
define void @vApplicationMallocFailedHook() {
ret void
}
__attribute__((always_)) unsigned zone_span_seqbegin(struct zone *zone) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @zone_span_seqbegin(%struct.zone* nocapture readnone %0) {
ret i32 0
}
int my_str_isnum(char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] >= '0' && str[i] <= '9')
      ;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116f <my_str_isnum+0x6f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1150 <my_str_isnum+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     1150 <my_str_isnum+0x50>
jmp    115c <my_str_isnum+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <my_str_isnum+0x76>
jmp    1161 <my_str_isnum+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_isnum+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isnum>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isnum+0x23>
add    $0x1,%rdi
nop
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1124 <my_str_isnum+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isnum+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_str_isnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %31, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %34
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %29
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp sle i32 %26, 57
br i1 %27, label %28, label %29
28: ; preds = %20
br label %30
29: ; preds = %20, %12
store i32 0, i32* %2
br label %35
30: ; preds = %28
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %5
34: ; preds = %5
store i32 1, i32* %2
br label %35
35: ; preds = %34, %29
%36 = load i32, i32* %2
ret i32 %36
}

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

/* Variables and functions */
int sigtimedwait(int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/);
int sigwaitinfo(const sigset_t *restrict mask, siginfo_t *restrict si) {
  return sigtimedwait(mask, si, 0);
}


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

x86 assembly (clang, -O2):
<sigwaitinfo>:
xor    %edx,%edx
jmp    1030 <sigtimedwait@plt>

LLVM IR (-O0):
define i32 @sigwaitinfo(i32* noalias %0, i32* noalias %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 @sigtimedwait(i32* %5, i32* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sigwaitinfo(i32* noalias %0, i32* noalias %1) {
%3 = tail call i32 @sigtimedwait(i32* %0, i32* %1, i32 0)
ret i32 %3
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_collate_name(const char *name, char *buf,
                                         struct _Locale_name_hint *hint,
                                         int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_extract_collate_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_collate_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._Locale_name_hint*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %8
%11 = call i8* @_Locale_extract_name(i8* %9, i32* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_collate_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ is_digit(int);
int /*<<< orphan*/ is_uppercase(char);
int main(void) {
  is_digit(7);
  is_digit(13);
  is_uppercase('C');
  is_uppercase('x');
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1040 <is_digit@plt>
mov    $0xd,%edi
call   1040 <is_digit@plt>
mov    $0x43,%edi
call   1030 <is_uppercase@plt>
mov    $0x78,%edi
call   1030 <is_uppercase@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1040 <is_digit@plt>
mov    $0xd,%edi
call   1040 <is_digit@plt>
mov    $0x43,%edi
call   1030 <is_uppercase@plt>
mov    $0x78,%edi
call   1030 <is_uppercase@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @is_digit(i32 7)
%3 = call i32 @is_digit(i32 13)
%4 = call i32 @is_uppercase(i8 signext 67)
%5 = call i32 @is_uppercase(i8 signext 120)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @is_digit(i32 7)
%2 = tail call i32 @is_digit(i32 13)
%3 = tail call i32 @is_uppercase(i8 signext 67)
%4 = tail call i32 @is_uppercase(i8 signext 120)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int gcspy_driverControlIsSeparator(char val) { return (val & 8) != 0; }


x86 assembly (clang, -O0):
<gcspy_driverControlIsSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcspy_driverControlIsSeparator>:
shr    $0x3,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @gcspy_driverControlIsSeparator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 8
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @gcspy_driverControlIsSeparator(i8 signext %0) {
%2 = lshr i8 %0, 3
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
void NV12ToRGB565Row_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB565Row_Any_SSSE3() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_aeswrfifo(uint32_t value) {
  *((volatile uint32_t *)0x10009008) = value;
}


x86 assembly (clang, -O0):
<set_aeswrfifo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10009008,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_aeswrfifo>:
mov    %edi,0x10009008
ret

LLVM IR (-O0):
define void @set_aeswrfifo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 268472328 to i32*)
ret void
}

LLVM IR (-O2):
define void @set_aeswrfifo(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 268472328 to i32*)
ret void
}
int foo(int a, int b) { return (short)a * (short)b; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    -0x8(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movswl %di,%ecx
movswl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(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 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = mul nsw i32 %6, %4
ret i32 %7
}
double qpei(x, y, p)
double x, y;
double *p;
{ return (y + (p[2] * gpei(x, y, p))); }


x86 assembly (clang, -O0):
<qpei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    $0x2,%al
call   1030 <gpei@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qpei>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rdi),%xmm2
movsd  %xmm2,0x10(%rsp)
mov    $0x2,%al
call   1030 <gpei@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @qpei(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %5
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 2
%10 = load double, double* %9
%11 = load double, double* %4
%12 = load double, double* %5
%13 = load double*, double** %6
%14 = call i32 (double, double, double*, ...) bitcast (i32 (...)* @gpei to i32 (double, double, double*, ...)*)(double %11, double %12, double* %13)
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %10, double %15, double %7)
ret double %16
}

LLVM IR (-O2):
define double @qpei(double %0, double %1, double* %2) {
%4 = getelementptr inbounds double, double* %2, i64 2
%5 = load double, double* %4
%6 = tail call i32 (double, double, double*, ...) bitcast (i32 (...)* @gpei to i32 (double, double, double*, ...)*)(double %0, double %1, double* %2)
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %1)
ret double %8
}
/* Variables and functions */
int floor(double);
int func(int inputval) {
  int temp = floor((double)inputval / 10);
  switch (temp) {
  case (0):
    return 100;
    break;
  case (1):
    return 200;
    break;
  case (2):
    return 300;
    break;
  case (3):
    return 400;
    break;
  default:
    return inputval;
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     1189 <func+0x79>
mov    -0x18(%rbp),%rax
lea    0xeb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x64,-0x4(%rbp)
jmp    118f <func+0x7f>
movl   $0xc8,-0x4(%rbp)
jmp    118f <func+0x7f>
movl   $0x12c,-0x4(%rbp)
jmp    118f <func+0x7f>
movl   $0x190,-0x4(%rbp)
jmp    118f <func+0x7f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %edi,%ebx
cvtsi2sd %edi,%xmm0
divsd  0xee1(%rip),%xmm0
call   1030 <floor@plt>
imul   $0x64,%eax,%ecx
add    $0x64,%ecx
cmp    $0x4,%eax
cmovae %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+01
%8 = call i32 @floor(double %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
switch i32 %9, label %14 [
i32 0, label %10
i32 1, label %11
i32 2, label %12
i32 3, label %13
]
10: ; preds = %1
store i32 100, i32* %2
br label %16
11: ; preds = %1
store i32 200, i32* %2
br label %16
12: ; preds = %1
store i32 300, i32* %2
br label %16
13: ; preds = %1
store i32 400, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %3
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %13, %12, %11, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+01
%4 = tail call i32 @floor(double %3)
%5 = icmp ult i32 %4, 4
%6 = mul i32 %4, 100
%7 = add i32 %6, 100
%8 = select i1 %5, i32 %7, i32 %0
ret i32 %8
}