xunge/DecIR huggingface dataset:
int strindex(char *s, char t) {
  int i, k;
  i = 0;
  k = -1;
  while (*s) {
    if (*s++ == t)
      k = i;
    i++;
  }
  return k;
}


x86 assembly (clang, -O0):
<strindex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <strindex+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <strindex+0x4d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <strindex+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strindex>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
test   %cl,%cl
je     1123 <strindex+0x23>
xor    %edx,%edx
nopl   (%rax)
cmp    %sil,%cl
cmove  %edx,%eax
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strindex+0x10>
ret

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

LLVM IR (-O2):
define i32 @strindex(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ -1, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = phi i8* [ %10, %5 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = icmp eq i8 %6, %1
%12 = select i1 %11, i32 %8, i32 %7
%13 = add nuw nsw i32 %8, 1
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ -1, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Variables and functions */
int netHttpConnect(char *, char *, char *, char *, char *);
int netOpenHttpExt(char *url, char *method, char *optionalHeader) {
  return netHttpConnect(url, method, "HTTP/1.0", "genome.ucsc.edu/net.c",
                        optionalHeader);
}


x86 assembly (clang, -O0):
<netOpenHttpExt>:
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),%r8
lea    0xec9(%rip),%rdx
lea    0xecb(%rip),%rcx
call   1030 <netHttpConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netOpenHttpExt>:
mov    %rdx,%r8
lea    0xee6(%rip),%rdx
lea    0xee8(%rip),%rcx
jmp    1030 <netHttpConnect@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HTTP/1.0\00"
@.str.1 = [22 x i8] c"genome.ucsc.edu/net.c\00"
define i32 @netOpenHttpExt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @netHttpConnect(i8* %7, i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"HTTP/1.0\00"
@.str.1 = [22 x i8] c"genome.ucsc.edu/net.c\00"
define i32 @netOpenHttpExt(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @netHttpConnect(i8* %0, i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int is_fs_bootable(const char *part_type, const char *fs) {
  if (strcmp(fs, "freebsd-ufs") == 0 || strcmp(fs, "freebsd-zfs") == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_fs_bootable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1154 <is_fs_bootable+0x44>
mov    -0x18(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1160 <is_fs_bootable+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_fs_bootable+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fs_bootable>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1144 <is_fs_bootable+0x34>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"freebsd-ufs\00"
@.str.1 = [12 x i8] c"freebsd-zfs\00"
define i32 @is_fs_bootable(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** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 1, i32* %3
br label %15
14: ; preds = %9
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"freebsd-ufs\00"
@.str.1 = [12 x i8] c"freebsd-zfs\00"
define i32 @is_fs_bootable(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar1(char);
void printchar(char **str, char c) {
  if (str) {
    **str = c;
    ++(*str);
  } else {
    putchar1(c);
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <printchar+0x3c>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1155 <printchar+0x45>
movsbl -0x9(%rbp),%edi
call   1030 <putchar1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
movsbl %sil,%edi
jmp    1030 <putchar1@plt>

LLVM IR (-O0):
define void @printchar(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8**, i8*** %3
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8, i8* %4
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
store i8 %8, i8* %10
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %11
br label %17
14: ; preds = %2
%15 = load i8, i8* %4
%16 = call i32 @putchar1(i8 signext %15)
br label %17
17: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i8 signext %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
store i8 %1, i8* %5
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
br label %10
8: ; preds = %2
%9 = tail call i32 @putchar1(i8 signext %1)
br label %10
10: ; preds = %8, %4
ret void
}
/* Variables and functions */
char *concat(char const *, char *, char *);
char *HTMLGenDiv(const char *innerHTML) {
  return concat(innerHTML, "<div>", "</div>");
}


x86 assembly (clang, -O0):
<HTMLGenDiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <concat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTMLGenDiv>:
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
jmp    1030 <concat@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<div>\00"
@.str.1 = [7 x i8] c"</div>\00"
define i8* @HTMLGenDiv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concat(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"<div>\00"
@.str.1 = [7 x i8] c"</div>\00"
define i8* @HTMLGenDiv(i8* %0) {
%2 = tail call i8* @concat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
int caio(int c) { return c + 10; }


x86 assembly (clang, -O0):
<caio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caio>:
lea    0xa(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @caio(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}
void __attribute__((weak)) usbcb_std_set_dsc_handler() {}


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

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

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

LLVM IR (-O2):
define weak void @usbcb_std_set_dsc_handler() {
ret void
}
int emac2_rev_set(unsigned int dev_id, union emac2_rev_u *value) { return 1; }


x86 assembly (clang, -O0):
<emac2_rev_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac2_rev_u = type opaque
define i32 @emac2_rev_set(i32 %0, %union.emac2_rev_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_rev_u*
store i32 %0, i32* %3
store %union.emac2_rev_u* %1, %union.emac2_rev_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_rev_u = type opaque
define i32 @emac2_rev_set(i32 %0, %union.emac2_rev_u* nocapture readnone %1) {
ret i32 1
}
extern int divide(const int num1, const int num2) { return num1 / num2; }


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divide(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void startServoBlaster(int pan_pin, int tilt_pin) {}


x86 assembly (clang, -O0):
<startServoBlaster>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @startServoBlaster(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @startServoBlaster(i32 %0, i32 %1) {
ret void
}
int sg_win32_snapshot() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sg_win32_snapshot() {
ret i32 0
}
baseof(char c) {
  switch (c) {
  case 'u':
  case 'd':
  case 'U':
  case 'D':
    return (10);
  case 'x':
  case 'X':
    return (16);
  case 'o':
  case 'O':
    return (8);
  default:
    return (10);
  }
}


x86 assembly (clang, -O0):
<baseof>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x44,%eax
je     1196 <baseof+0x96>
jmp    111f <baseof+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     11ae <baseof+0xae>
jmp    1130 <baseof+0x30>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
je     1196 <baseof+0x96>
jmp    1141 <baseof+0x41>
mov    -0xc(%rbp),%eax
sub    $0x58,%eax
je     11a2 <baseof+0xa2>
jmp    1152 <baseof+0x52>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     1196 <baseof+0x96>
jmp    1163 <baseof+0x63>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     11ae <baseof+0xae>
jmp    1174 <baseof+0x74>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
je     1196 <baseof+0x96>
jmp    1185 <baseof+0x85>
mov    -0xc(%rbp),%eax
sub    $0x78,%eax
je     11a2 <baseof+0xa2>
jmp    11ba <baseof+0xba>
movl   $0xa,-0x4(%rbp)
jmp    11c1 <baseof+0xc1>
movl   $0x10,-0x4(%rbp)
jmp    11c1 <baseof+0xc1>
movl   $0x8,-0x4(%rbp)
jmp    11c1 <baseof+0xc1>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baseof>:
mov    $0xa,%eax
cmp    $0x6e,%edi
jg     1115 <baseof+0x15>
cmp    $0x4f,%edi
je     1125 <baseof+0x25>
cmp    $0x58,%edi
je     111f <baseof+0x1f>
ret
cmp    $0x6f,%edi
je     1125 <baseof+0x25>
cmp    $0x78,%edi
jne    1114 <baseof+0x14>
mov    $0x10,%eax
ret
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @baseof(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 117, label %6
i32 100, label %6
i32 85, label %6
i32 68, label %6
i32 120, label %7
i32 88, label %7
i32 111, label %8
i32 79, label %8
]
6: ; preds = %1, %1, %1, %1
store i32 10, i32* %2
br label %10
7: ; preds = %1, %1
store i32 16, i32* %2
br label %10
8: ; preds = %1, %1
store i32 8, i32* %2
br label %10
9: ; preds = %1
store i32 10, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @baseof(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 79, label %4
i32 111, label %4
i32 88, label %3
i32 120, label %3
]
3: ; preds = %1, %1
br label %5
4: ; preds = %1, %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i32 [ 8, %4 ], [ 16, %3 ], [ 10, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int scanf(char *, char *);
int main(void) {
  char c;
  puts("Je vais me planter dès que vous aurez entré un chiffre\n");
  return (scanf("%lf", &c) == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Je vais me planter d\C3\A8s que vous aurez entr\C3\A9 un chiffre\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [58 x i8] c"Je vais me planter d\C3\A8s que vous aurez entr\C3\A9 un chiffre\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
const char *skip_leading_whitespace(const char *str) {
  while (*str) {
    const char c = *str;
    if (!(c == ' ' || c == '\t')) {
      break;
    }
    ++str;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_leading_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <skip_leading_whitespace+0x4e>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     113d <skip_leading_whitespace+0x3d>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     113d <skip_leading_whitespace+0x3d>
jmp    114e <skip_leading_whitespace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_leading_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_leading_whitespace>:
mov    %rdi,%rax
jmp    1114 <skip_leading_whitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_leading_whitespace+0x10>
cmp    $0x9,%cl
je     1110 <skip_leading_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_leading_whitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ xalloc_die();
void *xrealloc(void *ptr, size_t new_size) {
  void *m;
  m = realloc(ptr, new_size);
  if (m == NULL)
    xalloc_die();
  return m;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @xalloc_die()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xalloc_die()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
void *_get_new_pa(long);
int /*<<< orphan*/ init_PR_var();
long p_align_to(long);
void *pralloc(long size) {
  long align_size;
  void *ret;
  if (size <= 0)
    return (void *)0;
  align_size = p_align_to(size);
  if ((long)(*(long *)(0x200100000)) == 0) {
    init_PR_var();
  }
  ret = _get_new_pa(align_size);
  return ret;
}


x86 assembly (clang, -O0):
<pralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1154 <pralloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1191 <pralloc+0x61>
mov    -0x10(%rbp),%rdi
call   1050 <p_align_to@plt>
mov    %rax,-0x18(%rbp)
movabs $0x200100000,%rax
cmpq   $0x0,(%rax)
jne    117c <pralloc+0x4c>
mov    $0x0,%al
call   1030 <init_PR_var@plt>
mov    -0x18(%rbp),%rdi
call   1040 <_get_new_pa@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pralloc>:
test   %rdi,%rdi
jle    115e <pralloc+0x2e>
push   %rbx
call   1050 <p_align_to@plt>
mov    %rax,%rbx
movabs $0x200100000,%rax
cmpq   $0x0,(%rax)
jne    1155 <pralloc+0x25>
xor    %eax,%eax
call   1030 <init_PR_var@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_get_new_pa@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @pralloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %20
9: ; preds = %1
%10 = load i64, i64* %3
%11 = call i64 @p_align_to(i64 %10)
store i64 %11, i64* %4
%12 = load i64, i64* inttoptr (i64 8590983168 to i64*)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (...) @init_PR_var()
br label %16
16: ; preds = %14, %9
%17 = load i64, i64* %4
%18 = call i8* @_get_new_pa(i64 %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %20
20: ; preds = %16, %8
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @pralloc(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @p_align_to(i64 %0)
%5 = load i64, i64* inttoptr (i64 8590983168 to i64*)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @init_PR_var()
br label %9
9: ; preds = %7, %3
%10 = tail call i8* @_get_new_pa(i64 %4)
br label %11
11: ; preds = %1, %9
%12 = phi i8* [ %10, %9 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc2(void) {
  printf("Executing exitfunc"
         "2"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc2.\0A\00"
define void @exitfunc2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc2.\00"
define void @exitfunc2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ localMalloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *localStrdup(const char *string) {
  return strcpy(localMalloc(strlen(string) + 1), string);
}


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

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

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

LLVM IR (-O2):
define i8* @localStrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @localMalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifidirect_cfg_op_channel_usage(void) {
  printf("Usage : wifidirect_cfg_op_channel [OperatingChannel]\n");
  printf("If OperatingChannel parameter is provided, 'set' is performed "
         "otherwise 'get' is performed.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Usage : wifidirect_cfg_op_channel [OperatingChannel]\0A\00"
@.str.1 = [93 x i8] c"If OperatingChannel parameter is provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wifidirect_cfg_op_channel_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"Usage : wifidirect_cfg_op_channel [OperatingChannel]\00"
@str.2 = [92 x i8] c"If OperatingChannel parameter is provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wifidirect_cfg_op_channel_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int elias_gamma_bits(int);
int count_bits(int offset, int len) {
  return 1 + (offset > 128 ? 12 : 8) + elias_gamma_bits(len - 1);
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x8,%eax
mov    $0xc,%ecx
cmp    $0x80,%edx
cmovg  %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <elias_gamma_bits@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x81,%edi
setge  %bl
lea    -0x1(%rsi),%edi
call   1030 <elias_gamma_bits@plt>
lea    (%rax,%rbx,4),%eax
add    $0x9,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @count_bits(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 = icmp sgt i32 %5, 128
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 12, i32 8
%9 = add nsw i32 1, %8
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @elias_gamma_bits(i32 %11)
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @count_bits(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 128
%4 = select i1 %3, i32 13, i32 9
%5 = add nsw i32 %1, -1
%6 = tail call i32 @elias_gamma_bits(i32 %5)
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int getbits(unsigned int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%u", getbits((unsigned)8, 3, 1)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <getbits@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x3,%esi
mov    $0x1,%edx
call   1040 <getbits@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = call i32 @getbits(i32 8, i32 3, i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = tail call i32 @getbits(i32 8, i32 3, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SafeFree(void *p) {
  if (p) {
    free(p);
    p = NULL;
  }
}


x86 assembly (clang, -O0):
<SafeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <SafeFree+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SafeFree(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 = %3, %1
ret void
}
double FMod2p(double x) {
  int i;
  double ret_val;
  ret_val = x;
  i = ret_val / 6.28318530717958623;
  ret_val -= i * 6.28318530717958623;
  if (ret_val < 0.0)
    ret_val += 6.28318530717958623;
  return ret_val;
}


x86 assembly (clang, -O0):
<FMod2p>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1181 <FMod2p+0x81>
movsd  0xe89(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FMod2p>:
movsd  0xef8(%rip),%xmm2
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @FMod2p(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %4
%6 = load double, double* %4
%7 = fdiv double %6, 0x401921FB54442D18
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = load double, double* %4
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double 0x401921FB54442D18, double %11)
store double %13, double* %4
%14 = load double, double* %4
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load double, double* %4
%18 = fadd double %17, 0x401921FB54442D18
store double %18, double* %4
br label %19
19: ; preds = %16, %1
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
define double @FMod2p(double %0) {
%2 = fdiv double %0, 0x401921FB54442D18
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x401921FB54442D18, double %0)
%7 = fcmp olt double %6, 0.000000e+00
%8 = fadd double %6, 0x401921FB54442D18
%9 = select i1 %7, double %8, double %6
ret double %9
}
void foo538() {}


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

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

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

LLVM IR (-O2):
define void @foo538() {
ret void
}
void geom_CM2_cart_xyz(double xm[], double xp[], double xc[], int dir) {
  xc[0] = 0.5 * (xm[0] + xp[0]);
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM2_cart_xyz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM2_cart_xyz>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM2_cart_xyz(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fadd double %11, %14
%16 = fmul double 5.000000e-01, %15
%17 = load double*, double** %7
%18 = getelementptr inbounds double, double* %17, i64 0
store double %16, double* %18
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = fadd double %21, %24
%26 = fmul double 5.000000e-01, %25
%27 = load double*, double** %7
%28 = getelementptr inbounds double, double* %27, i64 1
store double %26, double* %28
ret void
}

LLVM IR (-O2):
define void @geom_CM2_cart_xyz(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, i32 %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fadd double %5, %6
%8 = fmul double %7, 5.000000e-01
store double %8, double* %2
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fadd double %10, %12
%14 = fmul double %13, 5.000000e-01
%15 = getelementptr inbounds double, double* %2, i64 1
store double %14, double* %15
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO_it;
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
                                                PKCS8_PRIV_KEY_INFO **p8inf) {
  return ASN1_item_d2i_fp(&PKCS8_PRIV_KEY_INFO_it, fp, p8inf);
}


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

x86 assembly (clang, -O2):
<d2i_PKCS8_PRIV_KEY_INFO_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_fp@plt>

LLVM IR (-O0):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define i32* @d2i_PKCS8_PRIV_KEY_INFO_fp(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 = call i32* @ASN1_item_d2i_fp(i32* @PKCS8_PRIV_KEY_INFO_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define i32* @d2i_PKCS8_PRIV_KEY_INFO_fp(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_fp(i32* @PKCS8_PRIV_KEY_INFO_it, i32* %0, i32** %1)
ret i32* %3
}
int main() {
#ident "@(#)$Date: 2015/08/06 14:27:26 $$RCSfile: types.h,v $$Revision: 1.25 $"
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void ov100() {
  printf("\nIncreasing CPU VDD Voltage by 100mV\n");
  char buf[256];
  sprintf(
      buf, "/system/bin/sh -c %s",
      "'echo +100000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'");
  system(buf);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xed1(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x100,%rsp
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0AIncreasing CPU VDD Voltage by 100mV\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [70 x i8] c"'echo +100000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
define void @ov100() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [70 x i8] c"'echo +100000 > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels'\00"
@str = [37 x i8] c"\0AIncreasing CPU VDD Voltage by 100mV\00"
define void @ov100() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int _write_sysfs_int(char *, char *, int, int /*<<< orphan*/);
int write_sysfs_int(char *filename, char *basedir, int val) {
  return _write_sysfs_int(filename, basedir, val, 0);
}


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

x86 assembly (clang, -O2):
<write_sysfs_int>:
xor    %ecx,%ecx
jmp    1030 <_write_sysfs_int@plt>

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

LLVM IR (-O2):
define i32 @write_sysfs_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_write_sysfs_int(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t col_get_green(int colour) { return (colour >> 8) & 0xFF; }


x86 assembly (clang, -O0):
<col_get_green>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_get_green>:
mov    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @col_get_green(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @col_get_green(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
unsigned char f39(unsigned char x, unsigned int y) {
  return (x >> y) | (x << ((-y) & (8 - 1)));
}


x86 assembly (clang, -O0):
<f39>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f39>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0x7,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f39(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 0, %11
%13 = and i32 %12, 7
%14 = shl i32 %10, %13
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @f39(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %5, 7
%7 = shl nuw nsw i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ allot_float(double);
int /*<<< orphan*/ dpush(int /*<<< orphan*/);
void box_double(double flo) { dpush(allot_float(flo)); }


x86 assembly (clang, -O0):
<box_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <allot_float@plt>
mov    %eax,%edi
call   1030 <dpush@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @box_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @allot_float(double %3)
%5 = call i32 @dpush(i32 %4)
ret void
}

LLVM IR (-O2):
define void @box_double(double %0) {
%2 = tail call i32 @allot_float(double %0)
%3 = tail call i32 @dpush(i32 %2)
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *__wrap_memcpy(void *destination, const void *source, size_t num) {
  return memcpy(destination, source, num);
}


x86 assembly (clang, -O0):
<__wrap_memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
char *syn_sym(int syn) {
  if (syn)
    return "d";
  else
    return "s";
}


x86 assembly (clang, -O0):
<syn_sym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <syn_sym+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <syn_sym+0x2c>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syn_sym>:
test   %edi,%edi
lea    0xef9(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"d\00"
@.str.1 = [2 x i8] c"s\00"
define i8* @syn_sym(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"d\00"
@.str.1 = [2 x i8] c"s\00"
define i8* @syn_sym(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xfc() {
  Assert_real((islower(252) == 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_islower.c",
              1265, ("islower should be 0 for 0xfc"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4f1,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xfc\00"
define void @t_islower_0xfc() {
%1 = call i64 @islower(i32 252)
%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 1265, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xfc\00"
define void @t_islower_0xfc() {
%1 = tail call i64 @islower(i32 252)
%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 1265, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}