xunge/DecIR huggingface dataset:
int lenght(char *arr) {
  int i = 0;
  while (*(arr + i) != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<lenght>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <lenght+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lenght+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenght>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <lenght+0x10>
ret

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

LLVM IR (-O2):
define i32 @lenght(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int html_count(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  printf("resultat: %d\n", html_count(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115a <main+0x3a>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <html_count@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1153 <main+0x23>
mov    0x8(%rsi),%rdi
call   1050 <html_count@plt>
lea    0xeba(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1164 <main+0x34>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de parametres insuffisants\0A\00"
@.str.1 = [14 x i8] c"resultat: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @html_count(i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"resultat: %d\0A\00"
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @html_count(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void epr_free_string(char *str) {
  if (str == NULL)
    return;
  free(str);
}


x86 assembly (clang, -O0):
<epr_free_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <epr_free_string+0x1c>
jmp    1135 <epr_free_string+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @epr_free_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
not_exist(char *f) {
  struct stat info;
  return (stat(f, &info) == -1);
}


x86 assembly (clang, -O0):
<not_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @not_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @not_exist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
void XSetWindowColormap() {}


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

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

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

LLVM IR (-O2):
define void @XSetWindowColormap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("LevPP - A compiler for the Lev++ programming language\n");
  printf("Syntax: levpp [--help] file\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"LevPP - A compiler for the Lev++ programming language\0A\00"
@.str.1 = [29 x i8] c"Syntax: levpp [--help] file\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"LevPP - A compiler for the Lev++ programming language\00"
@str.2 = [28 x i8] c"Syntax: levpp [--help] file\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char);
char *rng_showstate(unsigned char *state, char *s) {
  sprintf(s, "%.2X%.2X...", state[0], state[1]);
  return s;
}


x86 assembly (clang, -O0):
<rng_showstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xecb(%rip),%rsi
movzbl %cl,%edx
movzbl 0x1(%rax),%ecx
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_showstate>:
push   %rbx
mov    %rsi,%rbx
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%.2X%.2X...\00"
define i8* @rng_showstate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"%.2X%.2X...\00"
define i8* @rng_showstate(i8* nocapture %0, i8* returned writeonly %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %5)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int FreeDuplicate(void *pv) {
  free(pv);
  return 1;
}


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

x86 assembly (clang, -O2):
<FreeDuplicate>:
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @FreeDuplicate(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 1
}
/* Variables and functions */
int shl_mult_ull(unsigned long long *, unsigned long);
int /*<<< orphan*/ static_assert(int, char *);
int shl_mult_ul(unsigned long *val, unsigned long factor) {
  static_assert(sizeof(unsigned long) == sizeof(unsigned long long),
                "sizeof(unsigned long) == sizeof(unsigned long long)");
  return shl_mult_ull((unsigned long long *)val, factor);
}


x86 assembly (clang, -O0):
<shl_mult_ul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xec4(%rip),%rsi
call   1040 <static_assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <shl_mult_ull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_mult_ul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    $0x1,%edi
call   1040 <static_assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <shl_mult_ull@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"sizeof(unsigned long) == sizeof(unsigned long long)\00"
define i32 @shl_mult_ul(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = call i32 @static_assert(i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%6 = load i64*, i64** %3
%7 = load i64, i64* %4
%8 = call i32 @shl_mult_ull(i64* %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [52 x i8] c"sizeof(unsigned long) == sizeof(unsigned long long)\00"
define i32 @shl_mult_ul(i64* %0, i64 %1) {
%3 = tail call i32 @static_assert(i32 1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @shl_mult_ull(i64* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x01() {
  Assert_real((isxdigit(1) == 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_isxdigit.c",
              10, ("isxdigit should be 0 for 0x01"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x01>:
push   %rax
mov    $0x1,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x01\00"
define void @t_isxdigit_0x01() {
%1 = call i64 @isxdigit(i32 1)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x01\00"
define void @t_isxdigit_0x01() {
%1 = tail call i64 @isxdigit(i32 1)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void STREAM_DEBUG(unsigned char *data, int sz, char *preamble) {
  int itr;
  unsigned char *p = data;
  for (itr = 0; itr < sz; itr++) {
    printf("%02x", p[itr]);
  }
}


x86 assembly (clang, -O0):
<STREAM_DEBUG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <STREAM_DEBUG+0x54>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
lea    0xeb3(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1132 <STREAM_DEBUG+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STREAM_DEBUG>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <STREAM_DEBUG+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <STREAM_DEBUG+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @STREAM_DEBUG(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
store i8* %9, i8** %8
store i32 0, i32* %7
br label %10
10: ; preds = %21, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8*, i8** %8
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @STREAM_DEBUG(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
void init_cp1(struct cp1 *cp1,
              struct new_dynarec_hot_state *new_dynarec_hot_state) {}


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

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

LLVM IR (-O0):
%struct.cp1 = type opaque
%struct.new_dynarec_hot_state = type opaque
define void @init_cp1(%struct.cp1* %0, %struct.new_dynarec_hot_state* %1) {
%3 = alloca %struct.cp1*
%4 = alloca %struct.new_dynarec_hot_state*
store %struct.cp1* %0, %struct.cp1** %3
store %struct.new_dynarec_hot_state* %1, %struct.new_dynarec_hot_state** %4
ret void
}

LLVM IR (-O2):
%struct.cp1 = type opaque
%struct.new_dynarec_hot_state = type opaque
define void @init_cp1(%struct.cp1* nocapture %0, %struct.new_dynarec_hot_state* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ unknown_com();
int setLogYesNo(char *rel, char *val) {
  if (strcmp(rel, "=") == 0) {
    if (strcmp(val, "YES") == 0) {
      return 1;
    } else {
      return 0;
    }
  } else {
    unknown_com();
    return 0;
  }
}


x86 assembly (clang, -O0):
<setLogYesNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117c <setLogYesNo+0x5c>
mov    -0x18(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1170 <setLogYesNo+0x50>
movl   $0x1,-0x4(%rbp)
jmp    118a <setLogYesNo+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    118a <setLogYesNo+0x6a>
mov    $0x0,%al
call   1030 <unknown_com@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLogYesNo>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1140 <setLogYesNo+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <unknown_com@plt>
jmp    1157 <setLogYesNo+0x37>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @setLogYesNo(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %17
14: ; preds = %9
store i32 0, i32* %3
br label %17
15: ; preds = %2
%16 = call i32 (...) @unknown_com()
store i32 0, i32* %3
br label %17
17: ; preds = %15, %14, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [4 x i8] c"YES\00"
define i32 @setLogYesNo(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @unknown_com()
br label %11
11: ; preds = %5, %9
%12 = phi i32 [ 0, %9 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void fu_Error(const char *prefix) {
  char buf[256];
  sprintf(buf, "fu: %s: error", prefix);
  perror(buf);
}


x86 assembly (clang, -O0):
<fu_Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <perror@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_Error>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fu: %s: error\00"
define void @fu_Error(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fu: %s: error\00"
define void @fu_Error(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_concat_str();
int /*<<< orphan*/ do_cons_str();
int /*<<< orphan*/ do_swapd();
void do_enconcat_str(void) {
  do_swapd();
  do_cons_str();
  do_concat_str();
}


x86 assembly (clang, -O0):
<do_enconcat_str>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <do_swapd@plt>
mov    $0x0,%al
call   1040 <do_cons_str@plt>
mov    $0x0,%al
call   1030 <do_concat_str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_enconcat_str>:
push   %rax
xor    %eax,%eax
call   1050 <do_swapd@plt>
xor    %eax,%eax
call   1040 <do_cons_str@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_concat_str@plt>

LLVM IR (-O0):
define void @do_enconcat_str() {
%1 = call i32 (...) @do_swapd()
%2 = call i32 (...) @do_cons_str()
%3 = call i32 (...) @do_concat_str()
ret void
}

LLVM IR (-O2):
define void @do_enconcat_str() {
%1 = tail call i32 (...) @do_swapd()
%2 = tail call i32 (...) @do_cons_str()
%3 = tail call i32 (...) @do_concat_str()
ret void
}
/* Variables and functions */
void *Cyc_AssnDef_binop(unsigned int, void *, void *, void *);
void *Cyc_AssnDef_plus(void *t1, void *t2, void *tp) {
  void *_T0;
  _T0 = Cyc_AssnDef_binop(0U, t1, t2, tp);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_AssnDef_plus>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <Cyc_AssnDef_binop@plt>

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

LLVM IR (-O2):
define i8* @Cyc_AssnDef_plus(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @Cyc_AssnDef_binop(i32 0, i8* %0, i8* %1, i8* %2)
ret i8* %4
}
const char *DELEGATE_srcsign() {
  return "\n{SRCSIGN=9.9.2-pre3:20090215114817+0900:9fd8879636f9934b:Author@"
         "DeleGate.ORG:s7F+zgs2D6yvuw+"
         "K1c3xJg4C9AJLSTuOGi2TAIPVQ52AwW0aqwRdJl3vME+/"
         "AaJpt3gKiH7b\r\nod6uyzyUFdkSIOgaTrMMdJBYBvCm0s7YhOpqCePnThu4e4RnMYTTp"
         "sI693BTt80KFXHwz4X3\r\nKO5W8Q4noFBPBme3yWwx/frGMMw=\r\n}\n" +
         10;
}


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

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

LLVM IR (-O0):
@.str = [259 x i8] c"\0A{SRCSIGN=9.9.2-pre3:20090215114817+0900:9fd8879636f9934b:Author@DeleGate.ORG:s7F+zgs2D6yvuw+K1c3xJg4C9AJLSTuOGi2TAIPVQ52AwW0aqwRdJl3vME+/AaJpt3gKiH7b\0D\0Aod6uyzyUFdkSIOgaTrMMdJBYBvCm0s7YhOpqCePnThu4e4RnMYTTpsI693BTt80KFXHwz4X3\0D\0AKO5W8Q4noFBPBme3yWwx/frGMMw=\0D\0A}\0A\00"
define i8* @DELEGATE_srcsign() {
ret i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 10)
}

LLVM IR (-O2):
@.str = [259 x i8] c"\0A{SRCSIGN=9.9.2-pre3:20090215114817+0900:9fd8879636f9934b:Author@DeleGate.ORG:s7F+zgs2D6yvuw+K1c3xJg4C9AJLSTuOGi2TAIPVQ52AwW0aqwRdJl3vME+/AaJpt3gKiH7b\0D\0Aod6uyzyUFdkSIOgaTrMMdJBYBvCm0s7YhOpqCePnThu4e4RnMYTTpsI693BTt80KFXHwz4X3\0D\0AKO5W8Q4noFBPBme3yWwx/frGMMw=\0D\0A}\0A\00"
define i8* @DELEGATE_srcsign() {
ret i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 10)
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void ssd_stop_scan(void) { system("spectraltool stopscan"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"spectraltool stopscan\00"
define void @ssd_stop_scan() {
%1 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"spectraltool stopscan\00"
define void @ssd_stop_scan() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long write(int, char *, int);
long OsSetEvent(long evt) { return (write(((int *)evt)[1], "", 1)); }


x86 assembly (clang, -O0):
<OsSetEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
lea    0xed6(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsSetEvent>:
mov    0x4(%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i64 @OsSetEvent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
%7 = call i64 @write(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %7
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i64 @OsSetEvent(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
%5 = tail call i64 @write(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
void isAlreadyClosed(void) { printPrivate("That is already closed.\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"That is already closed.\0A\00"
define void @isAlreadyClosed() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"That is already closed.\0A\00"
define void @isAlreadyClosed() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
int execute_umount2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_umount2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: wordsort dict ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: wordsort dict ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: wordsort dict ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef enum clnt_stat { ____Placeholder_clnt_stat } clnt_stat;

/* Variables and functions */
int /*<<< orphan*/ clnt_sperrno(int);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void clnt_perrno(enum clnt_stat num) { (void)fputs(clnt_sperrno(num), stderr); }


x86 assembly (clang, -O0):
<clnt_perrno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <clnt_sperrno@plt>
mov    %eax,%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clnt_perrno>:
push   %rax
call   1040 <clnt_sperrno@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @clnt_perrno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @clnt_sperrno(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @clnt_perrno(i32 %0) {
%2 = tail call i32 @clnt_sperrno(i32 %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_version(int *, int *, int *);
void NLOPTV(int *major, int *minor, int *bugfix) {
  nlopt_version(major, minor, bugfix);
}


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

x86 assembly (clang, -O2):
<NLOPTV>:
jmp    1030 <nlopt_version@plt>

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

LLVM IR (-O2):
define void @NLOPTV(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @nlopt_version(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
unsigned char nrf_reg_read(int, int);
int /*<<< orphan*/ nrf_reg_write(int, unsigned char, int);
void _nrf_setrx(unsigned char prx) {
  unsigned char config;
  config = nrf_reg_read(0x00, 1);
  if (prx)
    config |= (1 << 0);
  else
    config &= ~(1 << 0);
  nrf_reg_write(0x00, config, 1);
}


x86 assembly (clang, -O0):
<_nrf_setrx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nrf_reg_read@plt>
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1156 <_nrf_setrx+0x36>
movzbl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x2(%rbp)
jmp    1160 <_nrf_setrx+0x40>
movzbl -0x2(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x2(%rbp)
xor    %edi,%edi
mov    $0x1,%edx
movzbl -0x2(%rbp),%esi
call   1040 <nrf_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nrf_setrx>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <nrf_reg_read@plt>
test   %ebx,%ebx
setne  %cl
and    $0xfe,%al
or     %cl,%al
movzbl %al,%esi
xor    %edi,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <nrf_reg_write@plt>

LLVM IR (-O0):
define void @_nrf_setrx(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call zeroext i8 @nrf_reg_read(i32 0, i32 1)
store i8 %4, i8* %3
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = or i32 %9, 1
%11 = trunc i32 %10 to i8
store i8 %11, i8* %3
br label %17
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, -2
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %17
17: ; preds = %12, %7
%18 = load i8, i8* %3
%19 = call i32 @nrf_reg_write(i32 0, i8 zeroext %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @_nrf_setrx(i8 zeroext %0) {
%2 = tail call zeroext i8 @nrf_reg_read(i32 0, i32 1)
%3 = icmp ne i8 %0, 0
%4 = and i8 %2, -2
%5 = zext i1 %3 to i8
%6 = or i8 %4, %5
%7 = tail call i32 @nrf_reg_write(i32 0, i8 zeroext %6, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gnutls_global_init();
void _httpTLSInitialize(void) { gnutls_global_init(); }


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

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

LLVM IR (-O0):
define void @_httpTLSInitialize() {
%1 = call i32 (...) @gnutls_global_init()
ret void
}

LLVM IR (-O2):
define void @_httpTLSInitialize() {
%1 = tail call i32 (...) @gnutls_global_init()
ret void
}
int rs_get_char_port(int port) {
  volatile unsigned char *uartp;
  if (port == 0)
    uartp = (volatile unsigned char *)(0x80000000 + 0x8600);
  else
    uartp = (volatile unsigned char *)(0x80000000 + 0x8700);
  return (uartp[0x0c]);
}


x86 assembly (clang, -O0):
<rs_get_char_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111f <rs_get_char_port+0x1f>
mov    $0x80008600,%eax
mov    %rax,-0x10(%rbp)
jmp    1128 <rs_get_char_port+0x28>
mov    $0x80008700,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_get_char_port>:
mov    $0x8000860c,%eax
lea    0x100(%rax),%rcx
test   %edi,%edi
cmove  %rax,%rcx
movzbl (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @rs_get_char_port(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* inttoptr (i64 2147517952 to i8*), i8** %3
br label %8
7: ; preds = %1
store i8* inttoptr (i64 2147518208 to i8*), i8** %3
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 12
%11 = load volatile i8, i8* %10
%12 = zext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @rs_get_char_port(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* inttoptr (i64 2147517964 to i8*), i8* inttoptr (i64 2147518220 to i8*)
%4 = load volatile i8, i8* %3
%5 = zext i8 %4 to i32
ret i32 %5
}
int SetBit(int x, int n) { return x | (1 << n); }


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

x86 assembly (clang, -O2):
<SetBit>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @SetBit(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @SetBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
int test_imm_3Cuint16_mem(unsigned short *val) {
  return ((*val) & (-0x3C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Cuint16_mem>:
movzwl (%rdi),%eax
test   $0xffc4,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -60
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void exch4(int *a, int *b) { *a ^= *b ^= *a ^= *b; }


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

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

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

LLVM IR (-O2):
define void @exch4(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ sai;

/* Variables and functions */
int accept(int, struct sockaddr *, unsigned int *);
int /*<<< orphan*/ perror(char *);
int server_accept(int fd) {
  struct sockaddr_in sai;
  int new_fd;
  unsigned int len = sizeof(sai);
  new_fd = accept(fd, (struct sockaddr *)&sai, &len);
  if (-1 == new_fd) {
    perror("accept");
    return -1;
  }
  return new_fd;
}


x86 assembly (clang, -O0):
<server_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    116b <server_accept+0x4b>
lea    0xea6(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <server_accept+0x51>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_accept>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     114b <server_accept+0x2b>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1030 <perror@plt>
jmp    1143 <server_accept+0x23>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @server_accept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %6)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 -1, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %5
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @server_accept(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int read_string(char s[]) {
  int ch, i = 0;
  scanf("%s", s);
  while (s[i++] != '\0')
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <read_string+0x47>
jmp    1133 <read_string+0x23>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <read_string+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @read_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %16, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %7
br label %7
17: ; preds = %7
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @read_string(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int setsockopt(int, int, int, char *, int);
int setsocktimeout(int s, int level, int optname, uint64_t timeout) {
  struct timeval t;
  t.tv_sec = timeout / 1000;
  t.tv_usec = (timeout % 1000) * 1000;
  return setsockopt(s, level, optname, (char *)&t, sizeof(t));
}


x86 assembly (clang, -O0):
<setsocktimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsocktimeout>:
push   %rax
movslq %ecx,%r8
imul   $0x10624dd3,%r8,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%eax
sub    %eax,%r8d
imul   $0x3e8,%r8d,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @setsocktimeout(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timeval
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = sdiv i32 %10, 1000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i32 %11, i32* %12
%13 = load i32, i32* %8
%14 = srem i32 %13, 1000
%15 = mul nsw i32 %14, 1000
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = bitcast %struct.timeval* %9 to i8*
%21 = call i32 @setsockopt(i32 %17, i32 %18, i32 %19, i8* %20, i32 8)
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @setsocktimeout(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %5 to i8*
%7 = sdiv i32 %3, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i32 %7, i32* %8
%9 = srem i32 %3, 1000
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i32 %10, i32* %11
%12 = call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %6, i32 8)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, char const *);
int /*<<< orphan*/ padding(int);
void sgr(const char *ps) {
  do_csi("%sm", ps);
  padding(2);
}


x86 assembly (clang, -O0):
<sgr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <do_csi@plt>
mov    $0x2,%edi
call   1040 <padding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgr>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <do_csi@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <padding@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%sm\00"
define void @sgr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @padding(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%sm\00"
define void @sgr(i8* %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @padding(i32 2)
ret void
}