xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void microsleep(int usec) {
  struct timespec req;
  req.tv_sec = 0;
  req.tv_nsec = 1000 * usec;
  nanosleep(&req, NULL);
}


x86 assembly (clang, -O0):
<microsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microsleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @microsleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 1000, %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @microsleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puthex(unsigned char);
int put32bits(volatile unsigned int a) {
  unsigned char c = 0;
  int i = 0;
  for (i = 3; i >= 0; i--) {
    c = ((a >> (8 * i)) & 0xff);
    puthex(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<put32bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1161 <put32bits+0x51>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <puthex@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <put32bits+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32bits>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x4(%rsp),%edi
shr    $0x18,%edi
call   1030 <puthex@plt>
mov    0x4(%rsp),%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <puthex@plt>
mov    0x4(%rsp),%eax
movzbl %ah,%edi
call   1030 <puthex@plt>
mov    0x4(%rsp),%eax
movzbl %al,%edi
call   1030 <puthex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @put32bits(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store volatile i32 %0, i32* %2
store i8 0, i8* %3
store i32 0, i32* %4
store i32 3, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load volatile i32, i32* %2
%10 = load i32, i32* %4
%11 = mul nsw i32 8, %10
%12 = lshr i32 %9, %11
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %3
%16 = call i32 @puthex(i8 zeroext %15)
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @put32bits(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
%6 = tail call i32 @puthex(i8 zeroext %5)
%7 = load volatile i32, i32* %2
%8 = lshr i32 %7, 16
%9 = trunc i32 %8 to i8
%10 = tail call i32 @puthex(i8 zeroext %9)
%11 = load volatile i32, i32* %2
%12 = lshr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = tail call i32 @puthex(i8 zeroext %13)
%15 = load volatile i32, i32* %2
%16 = trunc i32 %15 to i8
%17 = tail call i32 @puthex(i8 zeroext %16)
ret i32 0
}
char Encrypt(char plaintext) {
  char code;
  code = (char)(219 - (int)(plaintext));
  return code;
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0xdb,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
mov    $0xdb,%al
sub    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @Encrypt(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 219, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @Encrypt(i8 signext %0) {
%2 = sub i8 -37, %0
ret i8 %2
}
char *strchr(const char *s, int c) {
  const char *p = s;
  while (*p) {
    if (*p == c)
      return (char *)p;
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strchr+0x4e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ is_hex_padded(char *);
char *is_hex_padded_02a() {
  char hex[] =
      "0xB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  do {
    if (!(is_hex_padded(hex)))
      return "return true if hex string starts with '0x'";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<is_hex_padded_02a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x43,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <is_hex_padded@plt>
cmp    $0x0,%eax
jne    115f <is_hex_padded_02a+0x3f>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <is_hex_padded_02a+0x4c>
jmp    1164 <is_hex_padded_02a+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_padded_02a>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x334132,0x3f(%rsp)
mov    %rsp,%rdi
call   1030 <is_hex_padded@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xee5(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.is_hex_padded_02a.hex = [67 x i8] c"0xB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [43 x i8] c"return true if hex string starts with '0x'\00"
define i8* @is_hex_padded_02a() {
%1 = alloca i8*
%2 = alloca [67 x i8]
%3 = bitcast [67 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [67 x i8], [67 x i8]* %2, i64 0, i64 0
%6 = call i32 @is_hex_padded(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.is_hex_padded_02a.hex = [67 x i8] c"0xB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [43 x i8] c"return true if hex string starts with '0x'\00"
define i8* @is_hex_padded_02a() {
%1 = alloca [67 x i8]
%2 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%3 = call i32 @is_hex_padded(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %5
}
/* Variables and functions */
int FALSE;
int TRUE;
long get_hour(long);
int is_night(long time) {
  long h = get_hour(time);
  if (h < 6 || h > 18) {
    return TRUE;
  }
  return FALSE;
}


x86 assembly (clang, -O0):
<is_night>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_hour@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x6,-0x18(%rbp)
jl     113f <is_night+0x2f>
cmpq   $0x12,-0x18(%rbp)
jle    1150 <is_night+0x40>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <is_night+0x4c>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_night>:
push   %rax
call   1030 <get_hour@plt>
add    $0xffffffffffffffed,%rax
cmp    $0xfffffffffffffff3,%rax
jae    1129 <is_night+0x19>
mov    0x2ec1(%rip),%rax
jmp    1130 <is_night+0x20>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @is_night(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i64 @get_hour(i64 %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp slt i64 %7, 6
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i64, i64* %4
%11 = icmp sgt i64 %10, 18
br i1 %11, label %12, label %14
12: ; preds = %9, %1
%13 = load i32, i32* @TRUE
store i32 %13, i32* %2
br label %16
14: ; preds = %9
%15 = load i32, i32* @FALSE
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@TRUE = global i32 0
@FALSE = global i32 0
define i32 @is_night(i64 %0) {
%2 = tail call i64 @get_hour(i64 %0)
%3 = add i64 %2, -19
%4 = icmp ult i64 %3, -13
%5 = load i32, i32* @TRUE
%6 = load i32, i32* @FALSE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Type definitions */
struct termp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ putwchar(int);
void locale_advance(struct termp *p, size_t len) {
  size_t i;
  for (i = 0; i < len; i++)
    putwchar(L' ');
}


x86 assembly (clang, -O0):
<locale_advance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1151 <locale_advance+0x41>
mov    $0x20,%edi
call   1030 <putwchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <locale_advance+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<locale_advance>:
push   %rbx
test   %rsi,%rsi
je     1130 <locale_advance+0x20>
mov    %rsi,%rbx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putwchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <locale_advance+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.termp = type { i32 }
define void @locale_advance(%struct.termp* %0, i64 %1) {
%3 = alloca %struct.termp*
%4 = alloca i64
%5 = alloca i64
store %struct.termp* %0, %struct.termp** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %12, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = call i32 @putwchar(i32 32)
br label %12
12: ; preds = %10
%13 = load i64, i64* %5
%14 = add i64 %13, 1
store i64 %14, i64* %5
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.termp = type { i32 }
define void @locale_advance(%struct.termp* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putwchar(i32 32)
%7 = add nuw i64 %5, 1
%8 = icmp eq i64 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int f(int);
main() { return f(5); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
void test(void) {
  test1();
  test2();
  test3();
  test4();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    $0x0,%al
call   1050 <test4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test4@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 (...) @test1()
%2 = call i32 (...) @test2()
%3 = call i32 (...) @test3()
%4 = call i32 (...) @test4()
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char const *, char const *,
                          char *, char const *);
void gru_cli_option_help(const char *long_opt, const char *short_opt,
                         const char *desc) {
  printf("\t%s%s--%s (-%s short option) %s\n\t\t%s\n\n", "\x1B[00m",
         "\x1B[01;37m", long_opt, short_opt, "\x1B[00m", desc);
}


x86 assembly (clang, -O0):
<gru_cli_option_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%rax
lea    0xec9(%rip),%rdi
lea    0xee9(%rip),%r9
lea    0xee8(%rip),%rdx
mov    %r9,%rsi
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gru_cli_option_help>:
push   %rax
mov    %rsi,%r8
mov    %rdi,%rcx
mov    %rdx,(%rsp)
lea    0xede(%rip),%rdi
lea    0xf04(%rip),%rdx
lea    0xef7(%rip),%rsi
mov    %rsi,%r9
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\09%s%s--%s (-%s short option) %s\0A\09\09%s\0A\0A\00"
@.str.1 = [6 x i8] c"\1B[00m\00"
@.str.2 = [9 x i8] c"\1B[01;37m\00"
define void @gru_cli_option_help(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 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"\09%s%s--%s (-%s short option) %s\0A\09\09%s\0A\0A\00"
@.str.1 = [6 x i8] c"\1B[00m\00"
@.str.2 = [9 x i8] c"\1B[01;37m\00"
define void @gru_cli_option_help(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
char *readextpar(char *, char *, char *, int);
char *readsrcpar(char *stem, char *par, int len) {
  return readextpar(stem, ".srcpar", par, len);
}


x86 assembly (clang, -O0):
<readsrcpar>:
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),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <readextpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsrcpar>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <readextpar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c".srcpar\00"
define i8* @readsrcpar(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 i8* @readextpar(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [8 x i8] c".srcpar\00"
define i8* @readsrcpar(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @readextpar(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret i8* %4
}
int convert(int num, int *dezl, int *unil) {
  float aux, cte = 0.0100001191;
  (*dezl) = num / 10;
  aux = (float)num / 10;
  aux = aux - (*dezl);
  aux = aux + cte;
  (*unil) = aux * 10;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xec4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe8e(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvttss2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rcx
add    %edi,%ecx
mov    %ecx,(%rsi)
cvtsi2ss %eax,%xmm0
movss  0xedb(%rip),%xmm1
cvtsi2ss %ecx,%xmm2
divss  %xmm1,%xmm0
subss  %xmm2,%xmm0
addss  0xecb(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define i32 @convert(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca float
%9 = alloca float
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store float 0x3F847AF140000000, float* %9
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to float
%15 = fdiv float %14, 1.000000e+01
store float %15, float* %8
%16 = load float, float* %8
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to float
%20 = fsub float %16, %19
store float %20, float* %8
%21 = load float, float* %8
%22 = load float, float* %9
%23 = fadd float %21, %22
store float %23, float* %8
%24 = load float, float* %8
%25 = fmul float %24, 1.000000e+01
%26 = fptosi float %25 to i32
%27 = load i32*, i32** %7
store i32 %26, i32* %27
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @convert(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %0, 10
store i32 %4, i32* %1
%5 = sitofp i32 %0 to float
%6 = fdiv float %5, 1.000000e+01
%7 = sitofp i32 %4 to float
%8 = fsub float %6, %7
%9 = fadd float %8, 0x3F847AF140000000
%10 = fmul float %9, 1.000000e+01
%11 = fptosi float %10 to i32
store i32 %11, i32* %2
ret i32 undef
}
int test_imm_D5int16_mem(short *val) {
  return ((*val) & (0xD5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D5int16_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, 213
%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_D5int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 213
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct ptrlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
struct elasticarray *elasticarray_init(size_t, int);
struct ptrlist_struct *ptrlist_init(size_t nrec) {
  struct elasticarray *EA;
  EA = elasticarray_init(nrec, sizeof(void *));
  return ((struct ptrlist_struct *)EA);
}


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

x86 assembly (clang, -O2):
<ptrlist_init>:
mov    $0x8,%esi
jmp    1030 <elasticarray_init@plt>

LLVM IR (-O0):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define %struct.ptrlist_struct* @ptrlist_init(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.elasticarray*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call %struct.elasticarray* @elasticarray_init(i64 %4, i32 8)
store %struct.elasticarray* %5, %struct.elasticarray** %3
%6 = load %struct.elasticarray*, %struct.elasticarray** %3
%7 = bitcast %struct.elasticarray* %6 to %struct.ptrlist_struct*
ret %struct.ptrlist_struct* %7
}

LLVM IR (-O2):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define %struct.ptrlist_struct* @ptrlist_init(i64 %0) {
%2 = tail call %struct.elasticarray* @elasticarray_init(i64 %0, i32 8)
%3 = bitcast %struct.elasticarray* %2 to %struct.ptrlist_struct*
ret %struct.ptrlist_struct* %3
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
ulong get_duration(ulong now, ulong last) {
  if (now > last) {
    return now - last;
  }
  return (59652323 - last) + now;
}


x86 assembly (clang, -O0):
<get_duration>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <get_duration+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <get_duration+0x32>
mov    $0x38e38e3,%eax
sub    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_duration>:
mov    %edi,%eax
sub    %esi,%eax
add    $0x38e38e3,%eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_duration(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %5
%15 = sub nsw i32 59652323, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_duration(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 0, i32 59652323
%5 = sub i32 %0, %1
%6 = add i32 %5, %4
ret i32 %6
}
char *stpncpy(char *__dest, const char *__src, unsigned long int __n) {
  char *return_value___stpncpy_chk$1;
  if ((_Bool)0) {
  __CPROVER_DUMP_L1:;
    return_value___stpncpy_chk$1 =
        __stpncpy_chk(__dest, __src, __n, 18446744073709551615ul);
    return return_value___stpncpy_chk$1;
  }
  char *return_value___stpncpy_alias$2;
  return_value___stpncpy_alias$2 = __stpncpy_alias(__dest, __src, __n);
  return return_value___stpncpy_alias$2;
}


x86 assembly (clang, -O0):
<stpncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1143 <stpncpy+0x23>
jmp    1175 <stpncpy+0x55>
jmp    1148 <stpncpy+0x28>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0xffffffffffffffff,%rcx
mov    $0x0,%al
call   1040 <__stpncpy_chk@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1196 <stpncpy+0x76>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <__stpncpy_alias@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpncpy>:
push   %rax
xor    %eax,%eax
call   1030 <__stpncpy_alias@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @stpncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
br i1 false, label %10, label %19
10: ; preds = %3
br label %11
11: ; preds = %10
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = call i32 (i8*, i8*, i64, i64, ...) bitcast (i32 (...)* @__stpncpy_chk to i32 (i8*, i8*, i64, i64, ...)*)(i8* %12, i8* %13, i64 %14, i64 -1)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %8
%18 = load i8*, i8** %8
store i8* %18, i8** %4
br label %27
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = load i8*, i8** %6
%22 = load i64, i64* %7
%23 = call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__stpncpy_alias to i32 (i8*, i8*, i64, ...)*)(i8* %20, i8* %21, i64 %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %9
%26 = load i8*, i8** %9
store i8* %26, i8** %4
br label %27
27: ; preds = %19, %11
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @stpncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__stpncpy_alias to i32 (i8*, i8*, i64, ...)*)(i8* %0, i8* %1, i64 %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ error_msg_and_exit(char *);
scalar_t__ listen(int, int);
int make_socket(int);
int /*<<< orphan*/ receive_file(int);
int main(int argc, char **argv) {
  int server_socket = make_socket(12000);
  if ((listen(server_socket, 5)) < 0) {
    error_msg_and_exit("Error on listen");
  }
  while (1) {
    receive_file(server_socket);
  }
  close(server_socket);
  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)
mov    $0x2ee0,%edi
call   1040 <make_socket@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   1030 <listen@plt>
cmp    $0x0,%rax
jge    1186 <main+0x46>
lea    0xe7f(%rip),%rdi
call   1060 <error_msg_and_exit@plt>
jmp    118b <main+0x4b>
mov    -0x14(%rbp),%edi
call   1050 <receive_file@plt>
jmp    118b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2ee0,%edi
call   1040 <make_socket@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x5,%esi
call   1030 <listen@plt>
test   %rax,%rax
jns    1170 <main+0x30>
lea    0xe9b(%rip),%rdi
call   1060 <error_msg_and_exit@plt>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1050 <receive_file@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [16 x i8] c"Error on listen\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @make_socket(i32 12000)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i64 @listen(i32 %8, i32 5)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @error_msg_and_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
br label %14
14: ; preds = %13, %14
%15 = load i32, i32* %6
%16 = call i32 @receive_file(i32 %15)
br label %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error on listen\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @make_socket(i32 12000)
%4 = tail call i64 @listen(i32 %3, i32 5)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error_msg_and_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
br label %9
9: ; preds = %8, %9
%10 = tail call i32 @receive_file(i32 %3)
br label %9
}
unsigned long ROR64(unsigned long word, int i) {
  asm("rorq %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


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

x86 assembly (clang, -O2):
<ROR64>:
mov    %esi,%ecx
mov    %rdi,%rax
ror    %cl,%rax
ret

LLVM IR (-O0):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 asm "rorq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = tail call i64 asm "rorq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i32 %1)
ret i64 %3
}
/* Type definitions */
struct s_test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ serialiseTLock(struct s_test *);
int /*<<< orphan*/ serverSend();
int sendLockTest(struct s_test *tLock) {
  serialiseTLock(tLock);
  serverSend();
  return 0;
}


x86 assembly (clang, -O0):
<sendLockTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <serialiseTLock@plt>
mov    $0x0,%al
call   1040 <serverSend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendLockTest>:
push   %rax
call   1030 <serialiseTLock@plt>
xor    %eax,%eax
call   1040 <serverSend@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s_test = type { i32 }
define i32 @sendLockTest(%struct.s_test* %0) {
%2 = alloca %struct.s_test*
store %struct.s_test* %0, %struct.s_test** %2
%3 = load %struct.s_test*, %struct.s_test** %2
%4 = call i32 @serialiseTLock(%struct.s_test* %3)
%5 = call i32 (...) @serverSend()
ret i32 0
}

LLVM IR (-O2):
%struct.s_test = type { i32 }
define i32 @sendLockTest(%struct.s_test* %0) {
%2 = tail call i32 @serialiseTLock(%struct.s_test* %0)
%3 = tail call i32 (...) @serverSend()
ret i32 0
}
int dwt_getgain_real(int orient) {
  (void)orient;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dwt_getgain_real(i32 %0) {
ret i32 0
}
void __ccaprice_atomic_store(volatile int *p, int x) {
  __asm__ __volatile__("movl %1, %0\n\t" : "=m"(*p) : "r"(x) : "memory");
}


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

x86 assembly (clang, -O2):
<__ccaprice_atomic_store>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @__ccaprice_atomic_store(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
ret void
}

LLVM IR (-O2):
define void @__ccaprice_atomic_store(i32* %0, i32 %1) {
tail call void asm sideeffect "movl $1, $0\0A\09", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret void
}
long long _dpack2(unsigned int src1, unsigned int src2) {
  unsigned short s1[2], s2[2];
  *((int *)s1) = src1;
  *((int *)s2) = src2;
  return ((unsigned long long)s1[1] << 48) | ((unsigned long long)s2[1] << 32) |
         ((unsigned long long)s1[0] << 16) | ((unsigned long long)s2[0]);
}


x86 assembly (clang, -O0):
<_dpack2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x30,%rax
movzwl -0xe(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
movzwl -0xc(%rbp),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
movzwl -0x10(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dpack2>:
mov    %edi,%ecx
shr    $0x10,%ecx
movzwl %si,%eax
mov    %esi,%edx
shr    $0x10,%edx
shl    $0x30,%rcx
shl    $0x20,%rdx
or     %rcx,%rdx
shl    $0x10,%edi
or     %rdi,%rdx
or     %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @_dpack2(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = zext i32 %3 to i64
%5 = lshr i32 %1, 16
%6 = zext i32 %5 to i64
%7 = shl nuw i64 %4, 48
%8 = shl nuw nsw i64 %6, 32
%9 = or i64 %8, %7
%10 = shl i32 %0, 16
%11 = zext i32 %10 to i64
%12 = or i64 %9, %11
%13 = and i32 %1, 65535
%14 = zext i32 %13 to i64
%15 = or i64 %12, %14
ret i64 %15
}
/* Variables and functions */
char toupper(char);
char *_strupr(char *x) {
  char *y = x;
  while (*y) {
    *y = toupper(*y);
    y++;
  }
  return x;
}


x86 assembly (clang, -O0):
<_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <_strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <_strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <_strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
void RTRandAdvRestoreState(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvRestoreState() {
ret void
}
/* Variables and functions */
bool sound_loaded(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @sound_loaded() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *fbuf) {
  free(fbuf);
  fbuf = NULL;
}


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

x86 assembly (clang, -O2):
<xfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int fun881() { return 881; }


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

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

LLVM IR (-O0):
define i32 @fun881() {
ret i32 881
}

LLVM IR (-O2):
define i32 @fun881() {
ret i32 881
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_less_or_equal(void) {
  gen_pop();
  gen_call("_le");
}


x86 assembly (clang, -O0):
<gen_less_or_equal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_less_or_equal>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"_le\00"
define void @gen_less_or_equal() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"_le\00"
define void @gen_less_or_equal() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_ILL() {
  kill(getpid(), SIGILL);
  return 0;
}


x86 assembly (clang, -O0):
<gen_ILL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ILL>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGILL = global i32 0
define i32 @gen_ILL() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGILL
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGILL = global i32 0
define i32 @gen_ILL() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGILL
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ countSort(int *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int a[] = {1, 0, 1, 4, 5, 9, 0, 12, 3, 4, 4};
  printArray(a, 11);
  countSort(a, 11);
  printArray(a, 11);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1030 <countSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <countSort@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.a = [11 x i32] [i32 1, i32 0, i32 1, i32 4, i32 5, i32 9, i32 0, i32 12, i32 3, i32 4, i32 4]
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 11)
%5 = call i32 @countSort(i32* %3, i32 11)
%6 = call i32 @printArray(i32* %3, i32 11)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ multiplex(int, int, int);
void sweep(int l) {
  multiplex(l, 0, 0);
  multiplex(l, 1, 0);
  multiplex(l, 1, 1);
  multiplex(l, 0, 1);
}


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

x86 assembly (clang, -O2):
<sweep>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <multiplex@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <multiplex@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <multiplex@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <multiplex@plt>

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

LLVM IR (-O2):
define void @sweep(i32 %0) {
%2 = tail call i32 @multiplex(i32 %0, i32 0, i32 0)
%3 = tail call i32 @multiplex(i32 %0, i32 1, i32 0)
%4 = tail call i32 @multiplex(i32 %0, i32 1, i32 1)
%5 = tail call i32 @multiplex(i32 %0, i32 0, i32 1)
ret void
}
unsigned int vsub2(unsigned int a, unsigned int b) {
  unsigned int s, t;
  s = a ^ b;
  t = a - b;
  s = s ^ t;
  s = s & 0x00010000;
  t = t + s;
  return t;
}


x86 assembly (clang, -O0):
<vsub2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x10000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsub2>:
mov    %esi,%eax
xor    %edi,%eax
sub    %esi,%edi
xor    %edi,%eax
and    $0x10000,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @vsub2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = xor i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = and i32 %16, 65536
store i32 %17, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = add i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @vsub2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = sub i32 %0, %1
%5 = xor i32 %3, %4
%6 = and i32 %5, 65536
%7 = add i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void log_deinit() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @log_deinit() {
%1 = tail call i32 (...) @closelog()
ret void
}