xunge/DecIR huggingface dataset:
/* Type definitions */
struct in_addr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
struct in_addr *lookUpHost(char *host) {
  struct hostent *host_info;
  struct in_addr *address;
  host_info = gethostbyname(host);
  if (host_info == NULL) {
    address = NULL;
  } else {
    address = (struct in_addr *)(host_info->h_addr);
  }
  return address;
}


x86 assembly (clang, -O0):
<lookUpHost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <lookUpHost+0x31>
movq   $0x0,-0x18(%rbp)
jmp    114c <lookUpHost+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookUpHost>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     1120 <lookUpHost+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
%struct.hostent = type { i64 }
define %struct.in_addr* @lookUpHost(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
%4 = alloca %struct.in_addr*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %3
%7 = load %struct.hostent*, %struct.hostent** %3
%8 = icmp eq %struct.hostent* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store %struct.in_addr* null, %struct.in_addr** %4
br label %15
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %3
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to %struct.in_addr*
store %struct.in_addr* %14, %struct.in_addr** %4
br label %15
15: ; preds = %10, %9
%16 = load %struct.in_addr*, %struct.in_addr** %4
ret %struct.in_addr* %16
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
%struct.hostent = type { i64 }
define %struct.in_addr* @lookUpHost(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.in_addr*
br label %8
8: ; preds = %1, %4
%9 = phi %struct.in_addr* [ %7, %4 ], [ null, %1 ]
ret %struct.in_addr* %9
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long testAccumulate(unsigned int);
int main(int argc, char **argv) {
  if (argc < 2)
    return -1;
  unsigned n = atoi(argv[1]);
  unsigned long res = testAccumulate(n);
  printf("%lu\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <testAccumulate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1160 <main+0x30>
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <testAccumulate@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i64 @testAccumulate(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ addFoncT(char *, void (*)(), int /*<<< orphan*/, int);
void addFonG(char *l, void (*f)(void)) { addFoncT(l, f, 0, 8); }


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

x86 assembly (clang, -O2):
<addFonG>:
xor    %edx,%edx
mov    $0x8,%ecx
jmp    1030 <addFoncT@plt>

LLVM IR (-O0):
define void @addFonG(i8* %0, void ()* %1) {
%3 = alloca i8*
%4 = alloca void ()*
store i8* %0, i8** %3
store void ()* %1, void ()** %4
%5 = load i8*, i8** %3
%6 = load void ()*, void ()** %4
%7 = bitcast void ()* %6 to void (...)*
%8 = call i32 @addFoncT(i8* %5, void (...)* %7, i32 0, i32 8)
ret void
}

LLVM IR (-O2):
define void @addFonG(i8* %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @addFoncT(i8* %0, void (...)* %3, i32 0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exitt();
void cexitt() { exitt(); }


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

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

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

LLVM IR (-O2):
define void @cexitt() {
%1 = tail call i32 (...) @exitt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
void process_string2(char str[]) {
  char *set;
  if (set = strstr(str, "NAME=")) {
    strcpy(set + 5, set + 6);
  }
}


x86 assembly (clang, -O0):
<process_string2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <process_string2+0x3f>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rsi
add    $0x6,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_string2>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1143 <process_string2+0x23>
lea    0x5(%rax),%rdi
add    $0x6,%rax
mov    %rax,%rsi
pop    %rax
jmp    1030 <strcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"NAME=\00"
define void @process_string2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = call i32 @strcpy(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"NAME=\00"
define void @process_string2(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 5
%6 = getelementptr inbounds i8, i8* %2, i64 6
%7 = tail call i32 @strcpy(i8* %5, i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] "
          "[-l <align kB>] [[-t <type>] -p <size>...] \n",
          prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [110 x i8] c"Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [[-t <type>] -p <size>...] \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [110 x i8] c"Usage: %s [-v] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [[-t <type>] -p <size>...] \0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned short XP4RGBA_0(unsigned short BGR) {
  if (!BGR)
    return 6;
  return (((((BGR & 0x1e) << 11)) | ((BGR & 0x7800) >> 7) |
           ((BGR & 0x3c0) << 2))) |
         0xf;
}


x86 assembly (clang, -O0):
<XP4RGBA_0>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
cmpw   $0x0,-0x4(%rbp)
jne    1121 <XP4RGBA_0+0x21>
movw   $0x6,-0x2(%rbp)
jmp    1150 <XP4RGBA_0+0x50>
movzwl -0x4(%rbp),%eax
and    $0x1e,%eax
shl    $0xb,%eax
movzwl -0x4(%rbp),%ecx
and    $0x7800,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
and    $0x3c0,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
or     $0xf,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XP4RGBA_0>:
test   %edi,%edi
je     1123 <XP4RGBA_0+0x23>
movzwl %di,%eax
mov    %eax,%ecx
shl    $0xb,%ecx
shr    $0x7,%eax
or     %ecx,%eax
and    $0x3c0,%edi
and    $0xf0f0,%eax
lea    (%rax,%rdi,4),%eax
add    $0xf,%eax
ret
mov    $0x6,%ax
ret

LLVM IR (-O0):
define zeroext i16 @XP4RGBA_0(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = icmp ne i16 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i16 6, i16* %2
br label %24
7: ; preds = %1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = and i32 %9, 30
%11 = shl i32 %10, 11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = and i32 %13, 30720
%15 = ashr i32 %14, 7
%16 = or i32 %11, %15
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = and i32 %18, 960
%20 = shl i32 %19, 2
%21 = or i32 %16, %20
%22 = or i32 %21, 15
%23 = trunc i32 %22 to i16
store i16 %23, i16* %2
br label %24
24: ; preds = %7, %6
%25 = load i16, i16* %2
ret i16 %25
}

LLVM IR (-O2):
define zeroext i16 @XP4RGBA_0(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = shl i16 %0, 11
%5 = and i16 %4, -4096
%6 = lshr i16 %0, 7
%7 = and i16 %6, 240
%8 = shl i16 %0, 2
%9 = and i16 %8, 3840
%10 = or i16 %7, %5
%11 = or i16 %10, %9
%12 = or i16 %11, 15
br label %13
13: ; preds = %1, %3
%14 = phi i16 [ %12, %3 ], [ 6, %1 ]
ret i16 %14
}
int getc_nowait(unsigned char *pChar) {
  if (((*((volatile unsigned long *)0x7F005018)) & (1 << 6)) == 0 &&
      ((*((volatile unsigned long *)0x7F005018)) & 0x3f) == 0) {
    return -1;
  } else {
    *pChar = (*((volatile unsigned char *)0x7F005024));
    return 0;
  }
}


x86 assembly (clang, -O0):
<getc_nowait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x40,%rax
cmp    $0x0,%rax
jne    1140 <getc_nowait+0x40>
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x3f,%rax
cmp    $0x0,%rax
jne    1140 <getc_nowait+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <getc_nowait+0x54>
mov    $0x7f005024,%eax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_nowait>:
testq  $0x40,0x7f005018
jne    111c <getc_nowait+0x1c>
testq  $0x3f,0x7f005018
je     1128 <getc_nowait+0x28>
mov    0x7f005024,%al
mov    %al,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @getc_nowait(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 64
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%9 = and i64 %8, 63
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %15
12: ; preds = %7, %1
%13 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
%14 = load i8*, i8** %3
store i8 %13, i8* %14
store i32 0, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @getc_nowait(i8* nocapture writeonly %0) {
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 64
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%7 = and i64 %6, 63
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5, %1
%10 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
store i8 %10, i8* %0
br label %11
11: ; preds = %5, %9
%12 = phi i32 [ 0, %9 ], [ -1, %5 ]
ret i32 %12
}
find(dirs, cp) char **dirs;
char *cp;
{
  while (*dirs)
    findin(*dirs++, cp);
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1150 <find+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <findin@plt>
jmp    1120 <find+0x10>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1146 <find+0x36>
mov    %rsi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <findin@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <find+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @find(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findin to i32 (i8*, i8*, ...)*)(i8* %6, i8* %1)
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ path(char *);
void spit_int(char *base, int i) {
  FILE *file = fopen(path(base), "w");
  fprintf(file, "%d\n", i);
  fclose(file);
}


x86 assembly (clang, -O0):
<spit_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <path@plt>
mov    %eax,%edi
lea    0xe9f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spit_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1050 <path@plt>
lea    0xeaf(%rip),%rsi
mov    %eax,%edi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @spit_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @path(i8* %6)
%8 = call i32* @fopen(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i32, i32* %4
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @spit_int(i8* %0, i32 %1) {
%3 = tail call i32 @path(i8* %0)
%4 = tail call i32* @fopen(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int __sys_write(int, void *, int);
int write(int file, void *ptr, int len) { return __sys_write(file, ptr, len); }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__sys_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
jmp    1030 <__sys_write@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__sys_write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_and_set(int);
int main(void) {
  int i = 0;
  for (; i < 4; ++i) {
    check_and_set(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <check_and_set@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <check_and_set@plt>
mov    $0x1,%edi
call   1030 <check_and_set@plt>
mov    $0x2,%edi
call   1030 <check_and_set@plt>
mov    $0x3,%edi
call   1030 <check_and_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @check_and_set(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check_and_set(i32 0)
%2 = tail call i32 @check_and_set(i32 1)
%3 = tail call i32 @check_and_set(i32 2)
%4 = tail call i32 @check_and_set(i32 3)
ret i32 0
}
void INT_Excep_MTU11_TGIU11(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU11_TGIU11() {
ret void
}
extern int shmem_int_fadd(int *target, int value, int pe) { return *target; }


x86 assembly (clang, -O0):
<shmem_int_fadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @shmem_int_fadd(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* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @shmem_int_fadd(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void loadgame() { printf("Load game called"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Load game called\00"
define void @loadgame() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Load game called\00"
define void @loadgame() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int info_close(void *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @info_close(i8* nocapture readnone %0) {
ret i32 0
}
void gdk_extension_mode_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_extension_mode_get_type() {
ret void
}
int connect_to_upstream(struct conn_s *connptr, struct request_s *request) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.conn_s = type opaque
%struct.request_s = type opaque
define i32 @connect_to_upstream(%struct.conn_s* %0, %struct.request_s* %1) {
%3 = alloca %struct.conn_s*
%4 = alloca %struct.request_s*
store %struct.conn_s* %0, %struct.conn_s** %3
store %struct.request_s* %1, %struct.request_s** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.conn_s = type opaque
%struct.request_s = type opaque
define i32 @connect_to_upstream(%struct.conn_s* nocapture readnone %0, %struct.request_s* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
double cos(double);
double ECcos(double x) {
  double y;
  double r;
  y = x;
  r = cos(y);
  return (r);
}


x86 assembly (clang, -O0):
<ECcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECcos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @ECcos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ arch();
int main(void) {
  arch();
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @arch()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_write(int /*<<< orphan*/, int, int);
int ehrpwm_et_frc_int(uint8_t module) {
  ehrpwm_write(module, 0x3A, (1));
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_et_frc_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3a,%esi
mov    $0x1,%edx
call   1030 <ehrpwm_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_et_frc_int>:
push   %rax
mov    $0x3a,%esi
mov    $0x1,%edx
call   1030 <ehrpwm_write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ehrpwm_et_frc_int(i32 %0) {
%2 = tail call i32 @ehrpwm_write(i32 %0, i32 58, i32 1)
ret i32 0
}
unsigned int F(unsigned int X, unsigned int Y, unsigned int Z) {
  return (X & Y) | ((~X) & Z);
}


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @F(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 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ testFancySwap();
int /*<<< orphan*/ testSwap();
int main(int argc, char *argv[]) {
  testSwap();
  testFancySwap();
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1030 <testSwap@plt>
mov    $0x0,%al
call   1040 <testFancySwap@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testSwap@plt>
xor    %eax,%eax
call   1040 <testFancySwap@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = call i32 (...) @testSwap()
%7 = call i32 (...) @testFancySwap()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testSwap()
%4 = tail call i32 (...) @testFancySwap()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
const char *dictdb_error(void *dict_data) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @dictdb_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dictdb_error(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ sum1(int, int);
int /*<<< orphan*/ sum2(int, int);
int main() {
  sum1(10, 23);
  sum2(10, 23);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x17,%esi
call   1030 <sum1@plt>
mov    $0xa,%edi
mov    $0x17,%esi
call   1040 <sum2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x17,%esi
call   1030 <sum1@plt>
mov    $0xa,%edi
mov    $0x17,%esi
call   1040 <sum2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sum1(i32 10, i32 23)
%2 = call i32 @sum2(i32 10, i32 23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum1(i32 10, i32 23)
%2 = tail call i32 @sum2(i32 10, i32 23)
ret i32 0
}
int test_imm_BCint16_mem(short *val) {
  return ((*val) & (0xBC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BCint16_mem>:
testb  $0xbc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BCint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 188
%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_BCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 188
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int foo(int, int /*<<< orphan*/);
int /*<<< orphan*/ nd();
int main() {
  int x = 5;
  int res = foo(x, nd());
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nd@plt>
mov    $0x5,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (...) @nd()
%6 = call i32 @foo(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nd()
%2 = tail call i32 @foo(i32 5, i32 %1)
ret i32 %2
}
/* Variables and functions */
int flushLRUFPR();
int getAvailableFPR();
int mapFPRTemp(void) {
  int available = getAvailableFPR();
  if (available >= 0)
    return available;
  int lru = flushLRUFPR();
  return lru;
}


x86 assembly (clang, -O0):
<mapFPRTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getAvailableFPR@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1147 <mapFPRTemp+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <mapFPRTemp+0x37>
mov    $0x0,%al
call   1040 <flushLRUFPR@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapFPRTemp>:
push   %rax
xor    %eax,%eax
call   1030 <getAvailableFPR@plt>
test   %eax,%eax
js     112e <mapFPRTemp+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <flushLRUFPR@plt>

LLVM IR (-O0):
define i32 @mapFPRTemp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @getAvailableFPR()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %12
9: ; preds = %0
%10 = call i32 (...) @flushLRUFPR()
store i32 %10, i32* %3
%11 = load i32, i32* %3
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @mapFPRTemp() {
%1 = tail call i32 (...) @getAvailableFPR()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @flushLRUFPR()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
char *iupStrGetSmallMem();
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *iupStrReturnRGBA(unsigned char r, unsigned char g, unsigned char b,
                       unsigned char a) {
  char *str = iupStrGetSmallMem();
  sprintf(str, "%d %d %d %d", (int)r, (int)g, (int)b, (int)a);
  return str;
}


x86 assembly (clang, -O0):
<iupStrReturnRGBA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    $0x0,%al
call   1030 <iupStrGetSmallMem@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movzbl -0x1(%rbp),%edx
movzbl -0x2(%rbp),%ecx
movzbl -0x3(%rbp),%r8d
movzbl -0x4(%rbp),%r9d
lea    0xe99(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrReturnRGBA>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <iupStrGetSmallMem@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
define i8* @iupStrReturnRGBA(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = call i8* (...) @iupStrGetSmallMem()
store i8* %10, i8** %9
%11 = load i8*, i8** %9
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15, i32 %17, i32 %19)
%21 = load i8*, i8** %9
ret i8* %21
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
define i8* @iupStrReturnRGBA(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i8* (...) @iupStrGetSmallMem()
%6 = zext i8 %0 to i32
%7 = zext i8 %1 to i32
%8 = zext i8 %2 to i32
%9 = zext i8 %3 to i32
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %9)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void warning(const char *message, const char *functionname) {
  fprintf(stderr, "Warning in function %s: %s\n", functionname, message);
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Warning in function %s: %s\0A\00"
define void @warning(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Warning in function %s: %s\0A\00"
define void @warning(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
double ep2jd(epoch)
double epoch;
{
  double dj;
  double date, time;
  ep2dt(epoch, &date, &time);
  dj = dt2jd(date, time);
  return (dj);
}


x86 assembly (clang, -O0):
<ep2jd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%al
call   1030 <ep2dt@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1040 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ep2jd>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%al
call   1030 <ep2dt@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1040 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ep2jd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ep2dt to i32 (double, double*, double*, ...)*)(double %6, double* %4, double* %5)
%8 = load double, double* %4
%9 = load double, double* %5
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %8, double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @ep2jd(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ep2dt to i32 (double, double*, double*, ...)*)(double %0, double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  sig = sig;
  int status = 0;
  while (waitpid(-1, &status, WNOHANG) != -1) {
  }
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <waitpid@plt>
cmp    $0xffffffff,%eax
je     114d <traitement_signal+0x3d>
jmp    1128 <traitement_signal+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec5(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    1130 <traitement_signal+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %3, i32 %6)
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %2, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %4
8: ; preds = %4
ret void
}
void unpack0(unsigned int *p, unsigned int *w) {
  int i;
  for (i = 0; i < 128; i++)
    p[i] = 0;
}


x86 assembly (clang, -O0):
<unpack0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    113d <unpack0+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <unpack0+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack0>:
push   %rax
mov    $0x200,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @unpack0(i32* nocapture writeonly %0, i32* nocapture readnone %1) {
%3 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hand(void *arg) { printf("do nothing"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"do nothing\00"
define void @hand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"do nothing\00"
define void @hand(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, char *);
int read_from_user(char *prompt, char *buffer) {
  int ret;
  printf("%s", prompt);
  ret = scanf("%10s", buffer);
  return ret;
}


x86 assembly (clang, -O0):
<read_from_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_user>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%10s\00"
define i32 @read_from_user(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%10s\00"
define i32 @read_from_user(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 %4
}
void(up)(struct semaphore *sem) {
  {
    ;
    return;
  }
}


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

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

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

LLVM IR (-O2):
%struct.semaphore = type opaque
define void @up(%struct.semaphore* nocapture %0) {
ret void
}
void i18n_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @i18n_initialize() {
ret void
}
int test_imm_22uint16_reg(unsigned short val) {
  return ((val) & (-0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22uint16_reg>:
test   $0xffde,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_22uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -34
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}