xunge/DecIR huggingface dataset:
/* Variables and functions */
int pow(double, double);
double sqrt(int);
double velocity(double E, double mass) {
  double gamma = 1.0 + E / (mass * 8.9875518e+16);
  return sqrt((1 - pow(gamma, -2.0)) * 8.9875518e+16);
}


x86 assembly (clang, -O0):
<velocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xec1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe80(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<velocity>:
push   %rax
mulsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xea8(%rip),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @velocity(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %7, 0x4373F4D4EB464EC0
%9 = fdiv double %6, %8
%10 = fadd double 1.000000e+00, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = call i32 @pow(double %11, double -2.000000e+00)
%13 = sub nsw i32 1, %12
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 0x4373F4D4EB464EC0
%16 = fptosi double %15 to i32
%17 = call double @sqrt(i32 %16)
ret double %17
}

LLVM IR (-O2):
define double @velocity(double %0, double %1) {
%3 = fmul double %1, 0x4373F4D4EB464EC0
%4 = fdiv double %0, %3
%5 = fadd double %4, 1.000000e+00
%6 = tail call i32 @pow(double %5, double -2.000000e+00)
%7 = sub nsw i32 1, %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x4373F4D4EB464EC0
%10 = fptosi double %9 to i32
%11 = tail call double @sqrt(i32 %10)
ret double %11
}
/* Variables and functions */
int f(int *);
int main() {
  int a[3] = {1, 2, 3};
  a[2] = a[a[1] - 1];
  a[1] = f(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x200000001,%rax
mov    %rax,0x8(%rsp)
movl   $0x2,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 %9, i32* %10
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%12 = call i32 @f(i32* %11)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = bitcast [3 x i32]* %1 to i64*
store i64 8589934593, i64* %3
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 2, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @f(i32* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry_square(uintptr_t, uintptr_t);
void fiat_25519_carry_square(uint64_t out1[5], const uint64_t arg1[5]) {
  internal_fiat_25519_carry_square((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry_square>:
jmp    1030 <internal_fiat_25519_carry_square@plt>

LLVM IR (-O0):
define void @fiat_25519_carry_square(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_carry_square(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry_square(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_carry_square(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int abs(int);
int hashKeyPair(char *key) {
  int hash = 0;
  while (*key != '\0') {
    hash += (int)*key;
    key++;
  }
  hash = hash * 32 % 500;
  return abs(hash);
}


x86 assembly (clang, -O0):
<hashKeyPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <hashKeyPair+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <hashKeyPair+0x13>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    $0x1f4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashKeyPair>:
mov    (%rdi),%cl
test   %cl,%cl
je     1144 <hashKeyPair+0x44>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashKeyPair+0x10>
shl    $0x5,%eax
movslq %eax,%rcx
imul   $0x10624dd3,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x1f4,%eax,%eax
sub    %eax,%ecx
jmp    1146 <hashKeyPair+0x46>
xor    %ecx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashKeyPair(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = shl i32 %9, 5
%15 = srem i32 %14, 500
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 0, %1 ], [ %15, %13 ]
%18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
ret i32 %18
}
int __attribute__((no, const)) ret4(float value) { return 4; }


x86 assembly (clang, -O0):
<ret4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ret4(float %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ read_color_scheme_file(char const *);
int /*<<< orphan*/ write_color_schemes(char const *);
void convert_color_schemes(const char *colorschemes_file,
                           const char *colors_dir) {
  read_color_scheme_file(colorschemes_file);
  write_color_schemes(colors_dir);
}


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

x86 assembly (clang, -O2):
<convert_color_schemes>:
push   %rbx
mov    %rsi,%rbx
call   1030 <read_color_scheme_file@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <write_color_schemes@plt>

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

LLVM IR (-O2):
define void @convert_color_schemes(i8* %0, i8* %1) {
%3 = tail call i32 @read_color_scheme_file(i8* %0)
%4 = tail call i32 @write_color_schemes(i8* %1)
ret void
}
void gtk_image_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_type_get_type() {
ret void
}
/* Variables and functions */
char *strerror(int);
char *socket_strerror(int errnum) { return strerror(errnum); }


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

x86 assembly (clang, -O2):
<socket_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @socket_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
void *brp_calloc_internal(void *, int, int, int);
void *brp_calloc_1(void *storage, int elem_numbers, int elem_size) {
  return brp_calloc_internal(storage, elem_numbers, elem_size, 1);
}


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

x86 assembly (clang, -O2):
<brp_calloc_1>:
mov    $0x1,%ecx
jmp    1030 <brp_calloc_internal@plt>

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

LLVM IR (-O2):
define i8* @brp_calloc_1(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @brp_calloc_internal(i8* %0, i32 %1, i32 %2, i32 1)
ret i8* %4
}
int init_OPENMP_sets_fromargs(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @init_OPENMP_sets_fromargs() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least32_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_uint_least32_t(uint_least32_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_uint_least32_t(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_send_blocking(char);
void cio_printc(char c) { serial_send_blocking(c); }


x86 assembly (clang, -O0):
<cio_printc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <serial_send_blocking@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cio_printc>:
jmp    1030 <serial_send_blocking@plt>

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

LLVM IR (-O2):
define void @cio_printc(i8 signext %0) {
%2 = tail call i32 @serial_send_blocking(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g_load(int);
void iload1(void) { g_load(1); }


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

x86 assembly (clang, -O2):
<iload1>:
mov    $0x1,%edi
jmp    1030 <g_load@plt>

LLVM IR (-O0):
define void @iload1() {
%1 = call i32 @g_load(i32 1)
ret void
}

LLVM IR (-O2):
define void @iload1() {
%1 = tail call i32 @g_load(i32 1)
ret void
}
erro(s1, s2) char *s1, *s2;
{
  printf("fixi80: %s%s\n", s1, s2);
  breakout();
  exit(1);
}


x86 assembly (clang, -O0):
<erro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <breakout@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<erro>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <breakout@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fixi80: %s%s\0A\00"
define i32 @erro(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (...) @breakout()
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"fixi80: %s%s\0A\00"
define i32 @erro(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 (...) @breakout()
tail call void @exit(i32 1)
unreachable
}
int empty(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @empty() {
ret i32 42
}

LLVM IR (-O2):
define i32 @empty() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x17() {
  Assert_real((ispunct(23) == 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_ispunct.c",
              120, ("ispunct should be 0 for 0x17"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x17\00"
define void @t_ispunct_0x17() {
%1 = call i64 @ispunct(i32 23)
%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 120, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x17\00"
define void @t_ispunct_0x17() {
%1 = tail call i64 @ispunct(i32 23)
%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 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showADSLSettings();
void cmdShowAdslSetting(int cmdType, struct cmd_arg *pCmdArg) {
  showADSLSettings();
}


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowAdslSetting(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showADSLSettings()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowAdslSetting(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showADSLSettings()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ load_xmm(int, void *);
int /*<<< orphan*/ print_vec_uint8(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void print_xmm_uint8(int i) {
  static uint8_t v[16];
  load_xmm(i, (void *)v);
  printf("xmm%d = ", i);
  print_vec_uint8(v);
}


x86 assembly (clang, -O0):
<print_xmm_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
call   1050 <load_xmm@plt>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0x2ef0(%rip),%rdi
call   1030 <print_vec_uint8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xmm_uint8>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f13(%rip),%r14
mov    %r14,%rsi
call   1050 <load_xmm@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_vec_uint8@plt>

LLVM IR (-O0):
@print_xmm_uint8.v = internal global [16 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_xmm(i32 %3, i8* bitcast ([16 x i32]* @print_xmm_uint8.v to i8*))
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @print_vec_uint8(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @print_xmm_uint8.v, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_xmm_uint8.v = internal global [16 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_uint8(i32 %0) {
%2 = tail call i32 @load_xmm(i32 %0, i8* bitcast ([16 x i32]* @print_xmm_uint8.v to i8*))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @print_vec_uint8(i32* getelementptr inbounds ([16 x i32], [16 x i32]* @print_xmm_uint8.v, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void flushStream(FILE *stream) { fflush(stream); }


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

x86 assembly (clang, -O2):
<flushStream>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define void @flushStream(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
ret void
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_feature_abort(const struct cec_msg *msg, __u8 *abort_msg,
                           __u8 *reason) {
  *abort_msg = msg->msg[2];
  *reason = msg->msg[3];
}


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

x86 assembly (clang, -O2):
<cec_ops_feature_abort>:
mov    (%rdi),%rax
mov    0x8(%rax),%ecx
mov    %ecx,(%rsi)
mov    0xc(%rax),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_feature_abort(%struct.cec_msg* %0, i32* %1, i32* %2) {
%4 = alloca %struct.cec_msg*
%5 = alloca i32*
%6 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.cec_msg*, %struct.cec_msg** %4
%8 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %7, i32 0, i32 0
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load %struct.cec_msg*, %struct.cec_msg** %4
%14 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %13, i32 0, i32 0
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_feature_abort(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
store i32 %7, i32* %1
%8 = getelementptr inbounds i32, i32* %5, i64 3
%9 = load i32, i32* %8
store i32 %9, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ remove(char *);
void sigterm_handler(int i) {
  remove("/var/run/displayd.pid");
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/var/run/displayd.pid\00"
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"/var/run/displayd.pid\00"
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 @remove(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int pst_chr_count(char *str, char x) {
  int r = 0;
  while (*str) {
    if (*str == x)
      r++;
    str++;
  }
  return r;
}


x86 assembly (clang, -O0):
<pst_chr_count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <pst_chr_count+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <pst_chr_count+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <pst_chr_count+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pst_chr_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <pst_chr_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <pst_chr_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pst_chr_count(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
void avcodec_encode_subtitle() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_encode_subtitle() {
ret void
}
void f7(char ***bar) {
  const char **volatile *p9 = (const char **volatile *)bar;
  char *const *volatile *p11 = (char *const *volatile *)bar;
  char **volatile const *p13 = (char **volatile const *)bar;
  const char *const *volatile *p15 = (const char *const *volatile *)bar;
  const char **volatile const *p17 = (const char **volatile const *)bar;
  char *const *volatile const *p19 = (char *const *volatile const *)bar;
  const char *const *volatile const *p21 =
      (const char *const *volatile const *)bar;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f7(i8*** %0) {
%2 = alloca i8***
%3 = alloca i8***
%4 = alloca i8***
%5 = alloca i8***
%6 = alloca i8***
%7 = alloca i8***
%8 = alloca i8***
%9 = alloca i8***
store i8*** %0, i8**** %2
%10 = load i8***, i8**** %2
store i8*** %10, i8**** %3
%11 = load i8***, i8**** %2
store i8*** %11, i8**** %4
%12 = load i8***, i8**** %2
store i8*** %12, i8**** %5
%13 = load i8***, i8**** %2
store i8*** %13, i8**** %6
%14 = load i8***, i8**** %2
store i8*** %14, i8**** %7
%15 = load i8***, i8**** %2
store i8*** %15, i8**** %8
%16 = load i8***, i8**** %2
store i8*** %16, i8**** %9
ret void
}

LLVM IR (-O2):
define void @f7(i8*** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void func() {
  char str[0x20];
  read(0, str, 0x20);
  printf(str);
  read(0, str, 0x50);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1040 <read@plt>
lea    -0x20(%rbp),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x50,%edx
call   1040 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <read@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1040 <read@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @func() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 32)
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* %4)
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%7 = call i32 @read(i32 0, i8* %6, i32 80)
ret void
}

LLVM IR (-O2):
define void @func() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 32)
%4 = call i32 @printf(i8* %2)
%5 = call i32 @read(i32 0, i8* %2, i32 80)
ret void
}
int fun239() { return 239; }


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

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

LLVM IR (-O0):
define i32 @fun239() {
ret i32 239
}

LLVM IR (-O2):
define i32 @fun239() {
ret i32 239
}
int rand() { return 42; }


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

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

LLVM IR (-O0):
define i32 @rand() {
ret i32 42
}

LLVM IR (-O2):
define i32 @rand() {
ret i32 42
}
/* Variables and functions */
char *ft_strcpy(char *, char const *);
int ft_strlen(char const *);
scalar_t__ malloc(int);
char *ft_strdup(const char *s1) {
  char *result;
  if (!(result = (char *)malloc(sizeof(char) * ft_strlen(s1) + 1)))
    return (NULL);
  return (ft_strcpy(result, s1));
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <ft_strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1182 <ft_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1152 <ft_strdup+0x22>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ft_strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = tail call i8* @ft_strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %10
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef TYPE_1__ *res_state;
struct TYPE_3__ {
  int res_h_errno;
};

/* Variables and functions */
int h_errno;
void __h_errno_set(res_state res, int err) { h_errno = res->res_h_errno = err; }


x86 assembly (clang, -O0):
<__h_errno_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2ecd(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__h_errno_set>:
mov    %esi,(%rdi)
mov    0x2edf(%rip),%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@h_errno = global i32 0
define void @__h_errno_set(%struct.TYPE_3__* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %5, i32* %7
store i32 %5, i32* @h_errno
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@h_errno = global i32 0
define void @__h_errno_set(%struct.TYPE_3__* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %1, i32* %3
store i32 %1, i32* @h_errno
ret void
}
struct task_struct *get_nsc_task(void) {
  extern struct task_struct *nsc_task;
  return nsc_task;
}


x86 assembly (clang, -O0):
<get_nsc_task>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nsc_task>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.task_struct = type opaque
@nsc_task = external global %struct.task_struct*
define %struct.task_struct* @get_nsc_task() {
%1 = load %struct.task_struct*, %struct.task_struct** @nsc_task
ret %struct.task_struct* %1
}

LLVM IR (-O2):
%struct.task_struct = type opaque
@nsc_task = external global %struct.task_struct*
define %struct.task_struct* @get_nsc_task() {
%1 = load %struct.task_struct*, %struct.task_struct** @nsc_task
ret %struct.task_struct* %1
}
/* Variables and functions */
char *strLeader(char *, char, size_t);
char *strDotLeader(char *st, size_t len) { return strLeader(st, '.', len); }


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

x86 assembly (clang, -O2):
<strDotLeader>:
mov    %rsi,%rdx
mov    $0x2e,%esi
jmp    1030 <strLeader@plt>

LLVM IR (-O0):
define i8* @strDotLeader(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 i8* @strLeader(i8* %5, i8 signext 46, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strDotLeader(i8* %0, i64 %1) {
%3 = tail call i8* @strLeader(i8* %0, i8 signext 46, i64 %1)
ret i8* %3
}
void test___atomic_fetch_sub_1(short *mem) { __atomic_fetch_sub(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_sub_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%ax
neg    %ax
lock xadd %ax,(%rcx)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_sub_1>:
lock subw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_sub_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw sub i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_sub_1(i16* nocapture %0) {
%2 = atomicrmw sub i16* %0, i16 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int *int_vec_alloc(int n) {
  int *v;
  v = (int *)calloc(n, sizeof(int));
  if (v == NULL) {
    fprintf(stderr, "could not allocate memory");
    exit(EXIT_FAILURE);
  }
  return v;
}


x86 assembly (clang, -O0):
<int_vec_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117a <int_vec_alloc+0x4a>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_vec_alloc>:
push   %rax
mov    $0x4,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <int_vec_alloc+0x12>
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"could not allocate memory\00"
@EXIT_FAILURE = global i32 0
define i32* @int_vec_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"could not allocate memory\00"
@EXIT_FAILURE = global i32 0
define i32* @int_vec_alloc(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %2 to i32*
ret i32* %10
}
char *skipwhitespaces(char *p) {
  unsigned char c;
  while ((c = *p)) {
    if (c == '\t' || c == '\r' || c == '\n' || c == ' ' || c == 0xa0) {
      ++p;
    } else
      break;
  }
  return p;
}


x86 assembly (clang, -O0):
<skipwhitespaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1177 <skipwhitespaces+0x77>
movzbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     115c <skipwhitespaces+0x5c>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
je     115c <skipwhitespaces+0x5c>
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     115c <skipwhitespaces+0x5c>
movzbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     115c <skipwhitespaces+0x5c>
movzbl -0x9(%rbp),%eax
cmp    $0xa0,%eax
jne    116d <skipwhitespaces+0x6d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <skipwhitespaces+0x72>
jmp    1177 <skipwhitespaces+0x77>
jmp    1108 <skipwhitespaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhitespaces>:
mov    %rdi,%rax
movabs $0x100002600,%rcx
jmp    111a <skipwhitespaces+0x1a>
nop
bt     %rdx,%rcx
jae    1123 <skipwhitespaces+0x23>
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
jbe    1110 <skipwhitespaces+0x10>
cmp    $0xa0,%dl
je     1116 <skipwhitespaces+0x16>
ret

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

LLVM IR (-O2):
define i8* @skipwhitespaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 -96, label %5
i8 32, label %5
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
#define SIGUSR1 128
int /*<<< orphan*/ printf(char *);
void handler(int signal) {
  switch (signal) {
  case SIGUSR1:
    printf("received SIGUSR1..\n");
    break;
  default:;
    ;
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    113f <handler+0x2f>
jmp    112e <handler+0x1e>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    1144 <handler+0x34>
jmp    1144 <handler+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
cmp    $0x80,%edi
jne    1124 <handler+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [20 x i8] c"received SIGUSR1..\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"received SIGUSR1..\00"
define void @handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
void SWAP(unsigned char *p1, unsigned char *p2) {
  unsigned char c = *p2;
  *p2 = *p1;
  *p1 = c;
}


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

x86 assembly (clang, -O2):
<SWAP>:
mov    (%rsi),%al
mov    (%rdi),%cl
mov    %cl,(%rsi)
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @SWAP(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** %4
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = load i8*, i8** %4
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %3
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @SWAP(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8, i8* %0
store i8 %4, i8* %1
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void *wrap_puts(void *data) {
  puts((char *)data);
  return data;
}


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

x86 assembly (clang, -O2):
<wrap_puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @wrap_puts(i8* returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i8* %0
}
int rsock_unknown_level_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 6:
    return -1;
  case 10:
    return -1;
  default:
    if (!str || !valp) {
    }
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_unknown_level_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
sub    $0x6,%rax
je     113a <rsock_unknown_level_to_int+0x3a>
jmp    1127 <rsock_unknown_level_to_int+0x27>
mov    -0x28(%rbp),%rax
sub    $0xa,%rax
je     1146 <rsock_unknown_level_to_int+0x46>
jmp    1152 <rsock_unknown_level_to_int+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <rsock_unknown_level_to_int+0x74>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <rsock_unknown_level_to_int+0x74>
cmpq   $0x0,-0x10(%rbp)
je     1168 <rsock_unknown_level_to_int+0x68>
cmpq   $0x0,-0x20(%rbp)
jne    116d <rsock_unknown_level_to_int+0x6d>
jmp    116d <rsock_unknown_level_to_int+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_unknown_level_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello, I'm a C program\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"hello, I'm a C program\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"hello, I'm a C program\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}