xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ core8_print(char *, char const *, int);
void U_EMREXTTEXTOUTW_print(const char *contents) {
  core8_print("U_EMREXTTEXTOUTW", contents, 1);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"U_EMREXTTEXTOUTW\00"
define void @U_EMREXTTEXTOUTW_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core8_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"U_EMREXTTEXTOUTW\00"
define void @U_EMREXTTEXTOUTW_print(i8* %0) {
%2 = tail call i32 @core8_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
ret void
}
void XAllowEvents() {}


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

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

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

LLVM IR (-O2):
define void @XAllowEvents() {
ret void
}
int xserver_put_xauth(const char *file) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xserver_put_xauth(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int gettime(struct timespec *ts) { return clock_gettime(CLOCK_MONOTONIC, ts); }


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @gettime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @gettime(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SendCMD(int);
void SetPageAddress(uint8_t add) { SendCMD(0xB0 | add); }


x86 assembly (clang, -O0):
<SetPageAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0xb0,%edi
call   1030 <SendCMD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPageAddress>:
or     $0xb0,%edi
jmp    1030 <SendCMD@plt>

LLVM IR (-O0):
define void @SetPageAddress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 176, %3
%5 = call i32 @SendCMD(i32 %4)
ret void
}

LLVM IR (-O2):
define void @SetPageAddress(i32 %0) {
%2 = or i32 %0, 176
%3 = tail call i32 @SendCMD(i32 %2)
ret void
}
void scribe_pre_schedule(void) {}


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

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

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

LLVM IR (-O2):
define void @scribe_pre_schedule() {
ret void
}
int isspace(int ch) {
  if (ch == 0x20 || (ch >= 0x09 && ch <= 0x0D))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1125 <isspace+0x25>
cmpl   $0x9,-0x8(%rbp)
jl     1131 <isspace+0x31>
cmpl   $0xd,-0x8(%rbp)
jg     1131 <isspace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <isspace+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 13
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i32 1, i32* %2
br label %14
13: ; preds = %9, %6
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
char dois(int A) {
  char nota;
  if (A >= 0 && A <= 49)
    nota = 'D';
  if (A >= 50 && A <= 69)
    nota = 'C';
  if (A >= 70 && A <= 89)
    nota = 'B';
  if (A >= 90 && A <= 100)
    nota = 'A';
  return (nota);
}


x86 assembly (clang, -O0):
<dois>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111f <dois+0x1f>
cmpl   $0x31,-0x4(%rbp)
jg     111f <dois+0x1f>
movb   $0x44,-0x5(%rbp)
cmpl   $0x32,-0x4(%rbp)
jl     1137 <dois+0x37>
cmpl   $0x45,-0x4(%rbp)
jg     1137 <dois+0x37>
movb   $0x43,-0x5(%rbp)
cmpl   $0x46,-0x4(%rbp)
jl     114f <dois+0x4f>
cmpl   $0x59,-0x4(%rbp)
jg     114f <dois+0x4f>
movb   $0x42,-0x5(%rbp)
cmpl   $0x5a,-0x4(%rbp)
jl     1167 <dois+0x67>
cmpl   $0x64,-0x4(%rbp)
jg     1167 <dois+0x67>
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dois>:
lea    -0x32(%rdi),%eax
cmp    $0x14,%eax
mov    $0x44,%al
sbb    $0x0,%al
lea    -0x46(%rdi),%ecx
cmp    $0x14,%ecx
movzbl %al,%eax
mov    $0x42,%ecx
cmovae %eax,%ecx
add    $0xffffffa6,%edi
cmp    $0xb,%edi
mov    $0x41,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @dois(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 49
br i1 %8, label %9, label %10
9: ; preds = %6
store i8 68, i8* %3
br label %10
10: ; preds = %9, %6, %1
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 50
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 69
br i1 %15, label %16, label %17
16: ; preds = %13
store i8 67, i8* %3
br label %17
17: ; preds = %16, %13, %10
%18 = load i32, i32* %2
%19 = icmp sge i32 %18, 70
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 89
br i1 %22, label %23, label %24
23: ; preds = %20
store i8 66, i8* %3
br label %24
24: ; preds = %23, %20, %17
%25 = load i32, i32* %2
%26 = icmp sge i32 %25, 90
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 100
br i1 %29, label %30, label %31
30: ; preds = %27
store i8 65, i8* %3
br label %31
31: ; preds = %30, %27, %24
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @dois(i32 %0) {
%2 = add i32 %0, -50
%3 = icmp ult i32 %2, 20
%4 = select i1 %3, i8 67, i8 68
%5 = add i32 %0, -70
%6 = icmp ult i32 %5, 20
%7 = select i1 %6, i8 66, i8 %4
%8 = add i32 %0, -90
%9 = icmp ult i32 %8, 11
%10 = select i1 %9, i8 65, i8 %7
ret i8 %10
}
int test_imm_28int16_reg(short val) {
  return ((val) & (-0x28 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_28int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -40
%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_28int16_reg(i16 signext %0) {
%2 = and i16 %0, -40
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCSine() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(22);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCSine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x16,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCSine>:
push   %rax
mov    $0x16,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCSine() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 22)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCSine() {
%1 = tail call i32 @BNCIO(i32 22)
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_ContentDirectory_ImportResource(void *, int);
int /*<<< orphan*/ printf(char *, char *, char *);
void UPnPContentDirectory_ImportResource(void *upnptoken, char *SourceURI,
                                         char *DestinationURI) {
  printf("Invoke: UPnPContentDirectory_ImportResource(%s,%s);\r\n", SourceURI,
         DestinationURI);
  UPnPResponse_ContentDirectory_ImportResource(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPContentDirectory_ImportResource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1030 <UPnPResponse_ContentDirectory_ImportResource@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPContentDirectory_ImportResource>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1030 <UPnPResponse_ContentDirectory_ImportResource@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Invoke: UPnPContentDirectory_ImportResource(%s,%s);\0D\0A\00"
define void @UPnPContentDirectory_ImportResource(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** %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_ContentDirectory_ImportResource(i8* %10, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Invoke: UPnPContentDirectory_ImportResource(%s,%s);\0D\0A\00"
define void @UPnPContentDirectory_ImportResource(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = tail call i32 @UPnPResponse_ContentDirectory_ImportResource(i8* %0, i32 250)
ret void
}
/* Variables and functions */
size_t strlen(char *);
bool endswith(char *string, char c) {
  size_t length = strlen(string);
  return string[length - 1] == c;
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %bpl,-0x1(%rax,%rbx,1)
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @endswith(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = sub i64 %9, 1
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @endswith(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, -1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = zext i1 %7 to i32
ret i32 %8
}
int are_equal_ulong(const void *a, const void *b) {
  return *(unsigned long *)a == *(unsigned long *)b;
}


x86 assembly (clang, -O0):
<are_equal_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_equal_ulong>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @are_equal_ulong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @are_equal_ulong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int _test_pitch_wheel_change(void *buffer) {
  return (((unsigned char *)buffer)[0] & 0xf0) == (0xe << 4);
}


x86 assembly (clang, -O0):
<_test_pitch_wheel_change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_pitch_wheel_change>:
mov    (%rdi),%cl
and    $0xf0,%cl
xor    %eax,%eax
cmp    $0xe0,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @_test_pitch_wheel_change(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 240
%8 = icmp eq i32 %7, 224
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_test_pitch_wheel_change(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -16
%4 = icmp eq i8 %3, -32
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *STRDUP(const char *p) { return strcpy((char *)malloc(strlen(p) + 1), p); }


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

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

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

LLVM IR (-O2):
define i8* @STRDUP(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ join_all_stopped_workers();
void join_workers_cb(evutil_socket_t s, short what, void *arg) {
  join_all_stopped_workers();
}


x86 assembly (clang, -O0):
<join_workers_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <join_all_stopped_workers@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @join_workers_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 (...) @join_all_stopped_workers()
ret void
}

LLVM IR (-O2):
define void @join_workers_cb(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @join_all_stopped_workers()
ret void
}
int test_imm_CAint64_lowword_reg(long long val) {
  return ((val) & (0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xca,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CAint64_lowword_reg>:
test   $0xca,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CAint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 202
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void tegra20_init_speedo_data(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra20_init_speedo_data() {
ret void
}
AX0AR1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     1140 <AX0AR1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <AX0AR1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %5, i64 277777
%11 = load i32, i32* %10
%12 = icmp ule i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ FirmwareIAPObjHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void FirmwareIAPObjUpdated() { UAVObjUpdated(FirmwareIAPObjHandle()); }


x86 assembly (clang, -O0):
<FirmwareIAPObjUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FirmwareIAPObjHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FirmwareIAPObjUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <FirmwareIAPObjHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @FirmwareIAPObjUpdated() {
%1 = call i32 (...) @FirmwareIAPObjHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FirmwareIAPObjUpdated() {
%1 = tail call i32 (...) @FirmwareIAPObjHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void alarm_signal(int signum) {}


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

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

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

LLVM IR (-O2):
define void @alarm_signal(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClientConnect();
int /*<<< orphan*/ PutClientInServer();
void SpectatorConnect(void) {
  ClientConnect();
  PutClientInServer();
}


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

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

LLVM IR (-O0):
define void @SpectatorConnect() {
%1 = call i32 (...) @ClientConnect()
%2 = call i32 (...) @PutClientInServer()
ret void
}

LLVM IR (-O2):
define void @SpectatorConnect() {
%1 = tail call i32 (...) @ClientConnect()
%2 = tail call i32 (...) @PutClientInServer()
ret void
}
void __NOP() { asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @__NOP() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigsuspend(int /*<<< orphan*/ *);
void *t_fn(void *v) {
  sigset_t mask;
  sigfillset(&mask);
  sigsuspend(&mask);
  return NULL;
}


x86 assembly (clang, -O0):
<t_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <sigfillset@plt>
lea    -0xc(%rbp),%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_fn>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigfillset@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @t_fn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @sigfillset(i32* %3)
%5 = call i32 @sigsuspend(i32* %3)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t_fn(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigfillset(i32* %2)
%5 = call i32 @sigsuspend(i32* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void handler(int s) {
  printf("recv a sig=%d\n", s);
  sleep(3);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"recv a sig=%d\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"recv a sig=%d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_multiline();
int /*<<< orphan*/ test_oneline();
int main() {
  test_oneline();
  test_multiline();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_oneline@plt>
mov    $0x0,%al
call   1030 <test_multiline@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_oneline()
%2 = call i32 (...) @test_multiline()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_oneline()
%2 = tail call i32 (...) @test_multiline()
ret i32 0
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void hungarian_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<hungarian_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @hungarian_UTF_8_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @hungarian_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
int protocol_irc_is_topic(char firstchar) {
  switch (firstchar) {
  case '#':
  case '&':
  case '!':
  case '+':
  case '.':
  case '~':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<protocol_irc_is_topic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     1174 <protocol_irc_is_topic+0x74>
jmp    111f <protocol_irc_is_topic+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1174 <protocol_irc_is_topic+0x74>
jmp    1130 <protocol_irc_is_topic+0x30>
mov    -0xc(%rbp),%eax
sub    $0x26,%eax
je     1174 <protocol_irc_is_topic+0x74>
jmp    1141 <protocol_irc_is_topic+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     1174 <protocol_irc_is_topic+0x74>
jmp    1152 <protocol_irc_is_topic+0x52>
mov    -0xc(%rbp),%eax
sub    $0x2e,%eax
je     1174 <protocol_irc_is_topic+0x74>
jmp    1163 <protocol_irc_is_topic+0x63>
mov    -0xc(%rbp),%eax
sub    $0x7e,%eax
jne    1180 <protocol_irc_is_topic+0x80>
jmp    1174 <protocol_irc_is_topic+0x74>
movl   $0x1,-0x4(%rbp)
jmp    1187 <protocol_irc_is_topic+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_irc_is_topic>:
mov    $0x1,%eax
cmp    $0x2e,%edi
ja     111d <protocol_irc_is_topic+0x1d>
mov    %edi,%ecx
movabs $0x484a00000000,%rdx
bt     %rcx,%rdx
jae    111d <protocol_irc_is_topic+0x1d>
ret
cmp    $0x7e,%edi
je     111c <protocol_irc_is_topic+0x1c>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @protocol_irc_is_topic(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 35, label %6
i32 38, label %6
i32 33, label %6
i32 43, label %6
i32 46, label %6
i32 126, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @protocol_irc_is_topic(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 35, label %4
i32 38, label %4
i32 33, label %4
i32 43, label %4
i32 46, label %4
i32 126, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int main() {
  int x, y, z;
  int a, b;
  x = 0;
  y = -(a + b);
  if (x < 5) {
    x = y + x;
  }
  a = x;
  b = y;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(int, int);
int getDigit(int number, int d) {
  int digit = 0;
  int divider = (int)pow(10, d - 1);
  digit = (number / divider) % 10;
  return digit;
}


x86 assembly (clang, -O0):
<getDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigit>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    %ebx,%eax
cltd
idiv   %ecx
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getDigit(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
store i32 0, i32* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i64 @pow(i32 10, i32 %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = load i32, i32* %6
%13 = sdiv i32 %11, %12
%14 = srem i32 %13, 10
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @getDigit(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i64 @pow(i32 10, i32 %3)
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %0, %5
%7 = srem i32 %6, 10
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sync();
int main(int argc, char **argv) {
  int i = 0;
  for (; i < 1000; ++i) {
    sync();
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    114f <main+0x3f>
mov    $0x0,%al
call   1030 <sync@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sync@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1000
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 (...) @sync()
br label %12
12: ; preds = %10
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 (...) @sync()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ set(unsigned long *);
int main(void) {
  unsigned long l;
  int i;
  set(&l);
  i = (int)l;
  l = (unsigned long)(2U << i);
  if (l != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <set@plt>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <main+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <set@plt>
mov    (%rsp),%rcx
mov    $0x2,%eax
shl    %cl,%eax
mov    %rax,(%rsp)
cmp    $0x1e,%ecx
jbe    1141 <main+0x21>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @set(i64* %2)
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = shl i32 2, %7
%9 = zext i32 %8 to i64
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @set(i64* %1)
%4 = load i64, i64* %1
%5 = trunc i64 %4 to i32
%6 = shl i32 2, %5
%7 = zext i32 %6 to i64
store i64 %7, i64* %1
%8 = icmp ugt i32 %5, 30
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}
int foo() { return foo(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
float foo(float x, float y) { return __builtin_isunordered(x, y) ? x : y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jnp    112c <foo+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <foo+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps %xmm0,%xmm2
cmpordss %xmm1,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @foo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp uno float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = fcmp ord float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
void __attribute__((__section__(".text.end"))) end(void) {}


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

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

LLVM IR (-O0):
define void @end() section ".text.end" {
ret void
}

LLVM IR (-O2):
define void @end() section ".text.end" {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void backgroud_color(char *color) { fprintf(stdout, "%s", color); }


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

x86 assembly (clang, -O2):
<backgroud_color>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @backgroud_color(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  do {
    for (int i = 0; i < 1000000; ++i)
      ;
    usleep(1000);
  } while (1);
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jge    114d <main+0x3d>
jmp    113f <main+0x2f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    $0x3e8,%edi
call   1030 <usleep@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1126 <main+0x16>
jmp    1166 <main+0x56>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <usleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
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
br label %7
7: ; preds = %17, %2
store i32 0, i32* %6
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 1000000
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %8
15: ; preds = %8
%16 = call i32 @usleep(i32 1000)
br label %17
17: ; preds = %15
br i1 true, label %7, label %18
18: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @usleep(i32 1000)
br label %3
}
/* Variables and functions */
int gethostname(char *, size_t);
int lgethostname(char *buf, size_t size) { return (gethostname(buf, size)); }


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

x86 assembly (clang, -O2):
<lgethostname>:
jmp    1030 <gethostname@plt>

LLVM IR (-O0):
define i32 @lgethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @gethostname(i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lgethostname(i8* %0, i64 %1) {
%3 = tail call i32 @gethostname(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit_standout_mode;
int /*<<< orphan*/ tty_putp(int /*<<< orphan*/);
void tty_exit_standout_mode() { tty_putp(exit_standout_mode); }


x86 assembly (clang, -O0):
<tty_exit_standout_mode>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <tty_putp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_exit_standout_mode>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <tty_putp@plt>

LLVM IR (-O0):
@exit_standout_mode = global i32 0
define void @tty_exit_standout_mode() {
%1 = load i32, i32* @exit_standout_mode
%2 = call i32 @tty_putp(i32 %1)
ret void
}

LLVM IR (-O2):
@exit_standout_mode = global i32 0
define void @tty_exit_standout_mode() {
%1 = load i32, i32* @exit_standout_mode
%2 = tail call i32 @tty_putp(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_firstprivate() {
  int i;
#pragma omp parallel sections firstprivate(
  { foo(); }
#pragma omp parallel sections firstprivate(,
  { foo(); }
#pragma omp parallel sections firstprivate(, )
  { foo(); }
#pragma omp parallel sections firstprivate()
  { foo(); }
#pragma omp parallel sections firstprivate(int)
  { foo(); }
#pragma omp parallel sections firstprivate(0)
  { foo(); }
  int x, y, z;
#pragma omp parallel sections lastprivate(x) firstprivate(x)
  { foo(); }
#pragma omp parallel sections lastprivate(x, y) firstprivate(x, y)
  { foo(); }
#pragma omp parallel sections lastprivate(x, y, z) firstprivate(x, y, z)
  { foo(); }
}


x86 assembly (clang, -O0):
<test_firstprivate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_firstprivate>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_firstprivate() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
%7 = call i32 (...) @foo()
%8 = call i32 (...) @foo()
%9 = call i32 (...) @foo()
%10 = call i32 (...) @foo()
%11 = call i32 (...) @foo()
%12 = call i32 (...) @foo()
%13 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_firstprivate() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0;
  int sum_of_squares = 0;
  for (int n = 1; n <= 100; n++) {
    sum += n;
    sum_of_squares += (n * n);
  }
  printf("The difference between the sums is %d.\n",
         (sum * sum - sum_of_squares));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jg     1162 <main+0x52>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x17ff976,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"The difference between the sums is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
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
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %3
%25 = sub nsw i32 %23, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [40 x i8] c"The difference between the sums is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}