xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strdup(char const *);
char *sstrdup(const char *s) {
  if (s)
    return strdup(s);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<sstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <sstrdup+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <sstrdup+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrdup>:
test   %rdi,%rdi
je     111a <sstrdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @sstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void ARGBToRGB565Dither() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565Dither() {
ret void
}
/* Variables and functions */
scalar_t__ is_dir_sep(char const);
int chomp_trailing_dir_sep(const char *path, int len) {
  while (len && is_dir_sep(path[len - 1]))
    len--;
  return len;
}


x86 assembly (clang, -O0):
<chomp_trailing_dir_sep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     114e <chomp_trailing_dir_sep+0x3e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_dir_sep@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115e <chomp_trailing_dir_sep+0x4e>
jmp    116c <chomp_trailing_dir_sep+0x5c>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <chomp_trailing_dir_sep+0xf>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp_trailing_dir_sep>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
movslq %esi,%rcx
lea    0x1(%rcx),%ebp
mov    %rcx,%rbx
sub    $0x1,%rbx
jb     113e <chomp_trailing_dir_sep+0x2e>
movsbl -0x1(%r14,%rcx,1),%edi
call   1030 <is_dir_sep@plt>
add    $0xffffffff,%ebp
mov    %rbx,%rcx
test   %rax,%rax
jne    1120 <chomp_trailing_dir_sep+0x10>
jmp    1140 <chomp_trailing_dir_sep+0x30>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @chomp_trailing_dir_sep(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ %8, %7 ], [ %3, %2 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = add nsw i64 %5, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i64 @is_dir_sep(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %7
%14 = trunc i64 %5 to i32
br label %15
15: ; preds = %4, %13
%16 = phi i32 [ %14, %13 ], [ 0, %4 ]
ret i32 %16
}
const char *LZ4_versionString(void) { return "1.8.1"; }


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

x86 assembly (clang, -O2):
<LZ4_versionString>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.8.1\00"
define i8* @LZ4_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.8.1\00"
define i8* @LZ4_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int UAX_Asm_RegIsDWordP(int reg) {
  if ((reg & 0xF0) == 0x00)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<UAX_Asm_RegIsDWordP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
jne    1124 <UAX_Asm_RegIsDWordP+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <UAX_Asm_RegIsDWordP+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UAX_Asm_RegIsDWordP>:
xor    %eax,%eax
test   $0xf0,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @UAX_Asm_RegIsDWordP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 240
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @UAX_Asm_RegIsDWordP(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int atoi(char const *);
int is_valid_http_port(const char *p) {
  int port = atoi(p);
  if (port < 1024 || port > 65536) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_http_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jl     1142 <is_valid_http_port+0x32>
cmpl   $0x10000,-0x14(%rbp)
jle    114e <is_valid_http_port+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <is_valid_http_port+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_http_port>:
push   %rax
call   1030 <atoi@plt>
add    $0xfffffc00,%eax
xor    %ecx,%ecx
cmp    $0xfc01,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_valid_http_port(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1024
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 65536
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 0, i32* %2
br label %14
13: ; preds = %9
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_valid_http_port(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -1024
%4 = icmp ult i32 %3, 64513
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int riotboot_hdr_validate(int /*<<< orphan*/);
int /*<<< orphan*/ riotboot_slot_get_hdr(unsigned int);
int riotboot_slot_validate(unsigned slot) {
  return riotboot_hdr_validate(riotboot_slot_get_hdr(slot));
}


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

x86 assembly (clang, -O2):
<riotboot_slot_validate>:
push   %rax
call   1030 <riotboot_slot_get_hdr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <riotboot_hdr_validate@plt>

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

LLVM IR (-O2):
define i32 @riotboot_slot_validate(i32 %0) {
%2 = tail call i32 @riotboot_slot_get_hdr(i32 %0)
%3 = tail call i32 @riotboot_hdr_validate(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ draw_string(int, int, char *, int);
void chrat(int x, int y, char c, int color) {
  char buf[2];
  buf[0] = c;
  buf[1] = '\0';
  draw_string(x * 12, y * 24, buf, color);
}


x86 assembly (clang, -O0):
<chrat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
imul   $0xc,-0x4(%rbp),%edi
imul   $0x18,-0x8(%rbp),%esi
lea    -0x12(%rbp),%rdx
mov    -0x10(%rbp),%ecx
call   1030 <draw_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrat>:
push   %rax
mov    %dl,0x6(%rsp)
movb   $0x0,0x7(%rsp)
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%edi
shl    $0x3,%esi
lea    (%rsi,%rsi,2),%esi
lea    0x6(%rsp),%rdx
call   1030 <draw_string@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @chrat(i32 %0, i32 %1, i8 signext %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca [2 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i32 %3, i32* %8
%10 = load i8, i8* %7
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
store i8 %10, i8* %11
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 1
store i8 0, i8* %12
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 12
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 24
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%18 = load i32, i32* %8
%19 = call i32 @draw_string(i32 %14, i32 %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @chrat(i32 %0, i32 %1, i8 signext %2, i32 %3) {
%5 = alloca [2 x i8]
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %2, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %7
%8 = mul nsw i32 %0, 12
%9 = mul nsw i32 %1, 24
%10 = call i32 @draw_string(i32 %8, i32 %9, i8* %6, i32 %3)
ret void
}
short test_171_14(short *mem) {
  short newval = 5;
  short prevval;
  __atomic_exchange(mem + 4, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_171_14>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x5,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xa(%rbp),%ax
xchg   %ax,0x8(%rcx)
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_171_14>:
mov    $0x5,%ax
xchg   %ax,0x8(%rdi)
ret

LLVM IR (-O0):
define signext i16 @test_171_14(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
store i16 5, i16* %3
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
%7 = load i16, i16* %3
%8 = atomicrmw xchg i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_171_14(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw xchg i16* %2, i16 5 acq_rel
ret i16 %3
}
void P_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @P_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_float_max_to_all(float *target, float *source, int nreduce,
                                   int PE_start, int logPE_stride, int PE_size,
                                   float *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_float_max_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_float_max_to_all(float* %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5, float* %6, i64* %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float*
%16 = alloca i64*
store float* %0, float** %9
store float* %1, float** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store float* %6, float** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_float_max_to_all(float* nocapture readnone %0, float* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, float* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned restoreFIQ(unsigned oldCPSR) {
  unsigned _cpsr;
  _cpsr = __get_cpsr();
  __set_cpsr((_cpsr & ~0x00000040) | (oldCPSR & 0x00000040));
  return _cpsr;
}


x86 assembly (clang, -O0):
<restoreFIQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xffffffbf,%edi
mov    -0x4(%rbp),%eax
and    $0x40,%eax
or     %eax,%edi
call   1030 <__set_cpsr@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restoreFIQ>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebp
and    $0xffffffbf,%eax
and    $0x40,%ebx
or     %eax,%ebx
mov    %ebx,%edi
call   1030 <__set_cpsr@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @restoreFIQ(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @__get_cpsr()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -65
%7 = load i32, i32* %2
%8 = and i32 %7, 64
%9 = or i32 %6, %8
%10 = call i32 @__set_cpsr(i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @restoreFIQ(i32 %0) {
%2 = tail call i32 (...) @__get_cpsr()
%3 = and i32 %2, -65
%4 = and i32 %0, 64
%5 = or i32 %3, %4
%6 = tail call i32 @__set_cpsr(i32 %5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ check_config();
int /*<<< orphan*/ kill_servers();
int /*<<< orphan*/ load_config(char *);
int /*<<< orphan*/ reset_badurls();
int /*<<< orphan*/ reset_linklines();
int /*<<< orphan*/ wipe_ojdata();
void attempt_reload_conf(char *filename) {
  reset_linklines();
  wipe_ojdata();
  kill_servers();
  reset_badurls();
  load_config(filename);
  check_config();
  return;
}


x86 assembly (clang, -O0):
<attempt_reload_conf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <reset_linklines@plt>
mov    $0x0,%al
call   1070 <wipe_ojdata@plt>
mov    $0x0,%al
call   1060 <kill_servers@plt>
mov    $0x0,%al
call   1050 <reset_badurls@plt>
mov    -0x8(%rbp),%rdi
call   1080 <load_config@plt>
mov    $0x0,%al
call   1030 <check_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attempt_reload_conf>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <reset_linklines@plt>
xor    %eax,%eax
call   1070 <wipe_ojdata@plt>
xor    %eax,%eax
call   1060 <kill_servers@plt>
xor    %eax,%eax
call   1050 <reset_badurls@plt>
mov    %rbx,%rdi
call   1080 <load_config@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <check_config@plt>

LLVM IR (-O0):
define void @attempt_reload_conf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @reset_linklines()
%4 = call i32 (...) @wipe_ojdata()
%5 = call i32 (...) @kill_servers()
%6 = call i32 (...) @reset_badurls()
%7 = load i8*, i8** %2
%8 = call i32 @load_config(i8* %7)
%9 = call i32 (...) @check_config()
ret void
}

LLVM IR (-O2):
define void @attempt_reload_conf(i8* %0) {
%2 = tail call i32 (...) @reset_linklines()
%3 = tail call i32 (...) @wipe_ojdata()
%4 = tail call i32 (...) @kill_servers()
%5 = tail call i32 (...) @reset_badurls()
%6 = tail call i32 @load_config(i8* %0)
%7 = tail call i32 (...) @check_config()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearONOFF();
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_F2MC16(void) {
  DeinitFields();
  ClearONOFF();
}


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

x86 assembly (clang, -O2):
<SwitchFrom_F2MC16>:
push   %rax
xor    %eax,%eax
call   1030 <DeinitFields@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ClearONOFF@plt>

LLVM IR (-O0):
define void @SwitchFrom_F2MC16() {
%1 = call i32 (...) @DeinitFields()
%2 = call i32 (...) @ClearONOFF()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_F2MC16() {
%1 = tail call i32 (...) @DeinitFields()
%2 = tail call i32 (...) @ClearONOFF()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("test \n");
  printf("this is a good begin!");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"test \0A\00"
@.str.1 = [22 x i8] c"this is a good begin!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"this is a good begin!\00"
@str = [6 x i8] c"test \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int BackExit(n)
int n;
{
  switch (n) {
  case 0:
    return (2);
  case 1:
    return (3);
  case 2:
    return (0);
  case 3:
    return (1);
  case 4:
    return (5);
  case 5:
    return (4);
  case 6:
    return (8);
  case 7:
    return (9);
  case 8:
    return (6);
  case 9:
    return (7);
  case 10:
    return (11);
  case 11:
    return (10);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<BackExit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xb,%rax
ja     11bc <BackExit+0xbc>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x3,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x0,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x1,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x5,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x4,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x8,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x9,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x6,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0x7,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0xb,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0xa,-0x4(%rbp)
jmp    11c3 <BackExit+0xc3>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackExit>:
mov    $0xffffffff,%eax
cmp    $0xb,%edi
ja     1117 <BackExit+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.BackExit = [12 x i32] [i32 2, i32 3, i32 0, i32 1, i32 5, i32 4, i32 8, i32 9, i32 6, i32 7, i32 11, i32 10]
define i32 @BackExit(i32 %0) {
%2 = icmp ult i32 %0, 12
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.BackExit, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t ror64(uint64_t data, unsigned int rotation) {
  return ((data >> rotation) | (data << (64 - rotation)));
}


x86 assembly (clang, -O0):
<ror64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror64>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror64(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void RTMemPoolCreate(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ XDefineCursor(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/);
int /*<<< orphan*/ XtDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XtWindow(int /*<<< orphan*/);
int /*<<< orphan*/ _DtHelpGetHourGlassCursor(int /*<<< orphan*/);
void _DtHelpTurnOnHourGlass(Widget w) {
  Cursor cursor;
  cursor = _DtHelpGetHourGlassCursor(XtDisplay(w));
  XDefineCursor(XtDisplay(w), XtWindow(w), cursor);
  XFlush(XtDisplay(w));
}


x86 assembly (clang, -O0):
<_DtHelpTurnOnHourGlass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <XtDisplay@plt>
mov    %eax,%edi
call   1040 <_DtHelpGetHourGlassCursor@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <XtDisplay@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <XtWindow@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1060 <XDefineCursor@plt>
mov    -0x4(%rbp),%edi
call   1050 <XtDisplay@plt>
mov    %eax,%edi
call   1070 <XFlush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtHelpTurnOnHourGlass>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1050 <XtDisplay@plt>
mov    %eax,%edi
call   1040 <_DtHelpGetHourGlassCursor@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1050 <XtDisplay@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <XtWindow@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %r14d,%edx
call   1060 <XDefineCursor@plt>
mov    %ebx,%edi
call   1050 <XtDisplay@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <XFlush@plt>

LLVM IR (-O0):
define void @_DtHelpTurnOnHourGlass(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @XtDisplay(i32 %4)
%6 = call i32 @_DtHelpGetHourGlassCursor(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @XtDisplay(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @XtWindow(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @XDefineCursor(i32 %8, i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @XtDisplay(i32 %13)
%15 = call i32 @XFlush(i32 %14)
ret void
}

LLVM IR (-O2):
define void @_DtHelpTurnOnHourGlass(i32 %0) {
%2 = tail call i32 @XtDisplay(i32 %0)
%3 = tail call i32 @_DtHelpGetHourGlassCursor(i32 %2)
%4 = tail call i32 @XtDisplay(i32 %0)
%5 = tail call i32 @XtWindow(i32 %0)
%6 = tail call i32 @XDefineCursor(i32 %4, i32 %5, i32 %3)
%7 = tail call i32 @XtDisplay(i32 %0)
%8 = tail call i32 @XFlush(i32 %7)
ret void
}
void gtk_about_dialog_get_translator_credits() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_translator_credits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmOr3v(int *, int *, int const *);
void glmOr3v_(bool x[3], const bool y[3]) { glmOr3v(x, x, y); }


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

x86 assembly (clang, -O2):
<glmOr3v_>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <glmOr3v@plt>

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

LLVM IR (-O2):
define void @glmOr3v_(i32* %0, i32* %1) {
%3 = tail call i32 @glmOr3v(i32* %0, i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int errno;
int ss_get_errno(void) { return errno; }


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

x86 assembly (clang, -O2):
<ss_get_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @ss_get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @ss_get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longlong_add(long long *target, long long value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longlong_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longlong_add(i64* nocapture readnone %0, i64 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct erase_info_user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ MEMERASE;
int ioctl(int, int /*<<< orphan*/, struct erase_info_user *);
int memerase(int fd, struct erase_info_user *erase) {
  return (ioctl(fd, MEMERASE, erase));
}


x86 assembly (clang, -O0):
<memerase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memerase>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.erase_info_user = type { i32 }
@MEMERASE = global i32 0
define i32 @memerase(i32 %0, %struct.erase_info_user* %1) {
%3 = alloca i32
%4 = alloca %struct.erase_info_user*
store i32 %0, i32* %3
store %struct.erase_info_user* %1, %struct.erase_info_user** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @MEMERASE
%7 = load %struct.erase_info_user*, %struct.erase_info_user** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.erase_info_user* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.erase_info_user = type { i32 }
@MEMERASE = global i32 0
define i32 @memerase(i32 %0, %struct.erase_info_user* %1) {
%3 = load i32, i32* @MEMERASE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.erase_info_user* %1)
ret i32 %4
}
void unw_get_proc_name() {}


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

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

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

LLVM IR (-O2):
define void @unw_get_proc_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_cpp_bigraph(void) { test("[ ] { } # ##;", "<: :> <% %> %: %:%:;"); }


x86 assembly (clang, -O0):
<TEST_cpp_bigraph>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_cpp_bigraph>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"[ ] { } # ##;\00"
@.str.1 = [21 x i8] c"<: :> <% %> %: %:%:;\00"
define void @TEST_cpp_bigraph() {
%1 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"[ ] { } # ##;\00"
@.str.1 = [21 x i8] c"<: :> <% %> %: %:%:;\00"
define void @TEST_cpp_bigraph() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int read_ledword(const unsigned char **in) {
  const unsigned char *p = *in;
  unsigned int ret;
  ret = *p++;
  ret |= (*p++ << 8);
  ret |= (*p++ << 16);
  ret |= (*p++ << 24);
  *in = p;
  return ret;
}


x86 assembly (clang, -O0):
<read_ledword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
shl    $0x18,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ledword>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @read_ledword(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = getelementptr inbounds i8, i8* %2, i64 2
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %2, i64 3
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 16
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %2, i64 4
%17 = load i8, i8* %11
%18 = zext i8 %17 to i32
%19 = shl nuw i32 %18, 24
%20 = or i32 %15, %19
store i8* %16, i8** %0
ret i32 %20
}
char sentenumeric(char input) {
  if ((input >= 'a') && (input <= 'z')) {
    return 1;
  }
  if ((input >= 'A') && (input <= 'Z')) {
    return 1;
  }
  if ((input >= '0') && (input <= '9')) {
    return 1;
  }
  if (input == '_') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sentenumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     112d <sentenumeric+0x2d>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     112d <sentenumeric+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    118d <sentenumeric+0x8d>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1150 <sentenumeric+0x50>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1150 <sentenumeric+0x50>
movb   $0x1,-0x1(%rbp)
jmp    118d <sentenumeric+0x8d>
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1173 <sentenumeric+0x73>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1173 <sentenumeric+0x73>
movb   $0x1,-0x1(%rbp)
jmp    118d <sentenumeric+0x8d>
movsbl -0x2(%rbp),%eax
cmp    $0x5f,%eax
jne    1189 <sentenumeric+0x89>
movb   $0x1,-0x1(%rbp)
jmp    118d <sentenumeric+0x8d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sentenumeric>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %cl
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %dl
cmp    $0x5f,%dil
sete   %al
or     %dl,%al
or     %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @sentenumeric(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = icmp eq i8 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i8
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printids(char *);
void *thr_fn(void *arg) {
  printids("new thread: ");
  return ((void *)0);
}


x86 assembly (clang, -O0):
<thr_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printids@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"new thread: \00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printids(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [13 x i8] c"new thread: \00"
define noalias i8* @thr_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @printids(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
double B3(double t) { return t * t * t; }


x86 assembly (clang, -O0):
<B3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<B3>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @B3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @B3(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc2() {
  Assert_real((isalpha(194) == 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_isalpha.c",
              975, ("isalpha should be 0 for 0xc2"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xc2>:
push   %rax
mov    $0xc2,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3cf,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc2\00"
define void @t_isalpha_0xc2() {
%1 = call i64 @isalpha(i32 194)
%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 975, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc2\00"
define void @t_isalpha_0xc2() {
%1 = tail call i64 @isalpha(i32 194)
%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 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *my_strdup(const char *str) {
  char *p;
  size_t len = strlen(str) + 1;
  p = malloc((len));
  if (p)
    memcpy(p, str, len);
  return p;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1177 <my_strdup+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <my_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void __attribute__((weak)) __aeabi_memset4_impl(void *dest, size_t n, int c) {
  memset(dest, c, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memset4_impl>:
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memset4_impl(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int utils_locale_to_utf8(const char *src, size_t is, char *dest, size_t os) {
pass_trough_as_is:
  if (os < (strlen(src) + 1))
    return -1;
  memcpy(dest, src, strlen(src) + 1);
  return 0;
}


x86 assembly (clang, -O0):
<utils_locale_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jae    116a <utils_locale_to_utf8+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    119c <utils_locale_to_utf8+0x7c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_locale_to_utf8>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rcx
mov    $0xffffffff,%eax
cmp    %r15,%rcx
ja     115b <utils_locale_to_utf8+0x3b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @utils_locale_to_utf8(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = icmp ugt i64 %7, %3
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = tail call i32 @strlen(i8* %0)
%11 = add nsw i32 %10, 1
%12 = tail call i32 @memcpy(i8* %2, i8* %0, i32 %11)
br label %13
13: ; preds = %4, %9
%14 = phi i32 [ 0, %9 ], [ -1, %4 ]
ret i32 %14
}