xunge/DecIR huggingface dataset:
void pattern(n) {
  if (n <= 0) {
    printf("%d ", n);
    return;
  } else {
    printf("%d ", n);
    pattern(n - 5);
    printf("%d ", n);
  }
}


x86 assembly (clang, -O0):
<pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     114b <pattern+0x2b>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1178 <pattern+0x58>
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
call   1040 <pattern@plt>
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1150 <pattern+0x30>
lea    -0x5(%rbx),%edi
call   1040 <pattern@plt>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @pattern(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 5
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %5, %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @pattern(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br i1 %2, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = add nsw i32 %0, -5
tail call void @pattern(i32 %6)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %4
}
int min(int left_ht, int right_ht) {
  return (left_ht < right_ht ? left_ht : right_ht);
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void PSG_setEnvelope(unsigned char channel, unsigned char value) {
  volatile unsigned char *pb;
  pb = (unsigned char *)0xC00011;
  *pb = 0x90 | ((channel & 3) << 5) | (value & 0xF);
}


x86 assembly (clang, -O0):
<PSG_setEnvelope>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xc00011,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x3,%eax
shl    $0x5,%eax
or     $0x90,%eax
movzbl -0x2(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSG_setEnvelope>:
shl    $0x5,%dil
and    $0xf,%sil
or     %dil,%sil
or     $0x90,%sil
mov    %sil,0xc00011
ret

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

LLVM IR (-O2):
define void @PSG_setEnvelope(i8 zeroext %0, i8 zeroext %1) {
%3 = shl i8 %0, 5
%4 = and i8 %1, 15
%5 = or i8 %4, %3
%6 = or i8 %5, -112
store volatile i8 %6, i8* inttoptr (i64 12582929 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rdp_update_vi();
__attribute__((visibility("default"))) void UpdateScreen(void) {
  rdp_update_vi();
}


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

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

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

LLVM IR (-O2):
define void @UpdateScreen() {
%1 = tail call i32 (...) @rdp_update_vi()
ret void
}
error(a) {
  printf("Error %d\n", a);
  dexit();
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <dexit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @dexit()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @error(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @dexit()
ret i32 undef
}
void memory_irq_change(void) {}


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

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

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

LLVM IR (-O2):
define void @memory_irq_change() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuAND();
int /*<<< orphan*/ cpuROLt();
void cpuRLA() {
  cpuROLt();
  cpuAND();
}


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

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

LLVM IR (-O0):
define void @cpuRLA() {
%1 = call i32 (...) @cpuROLt()
%2 = call i32 (...) @cpuAND()
ret void
}

LLVM IR (-O2):
define void @cpuRLA() {
%1 = tail call i32 (...) @cpuROLt()
%2 = tail call i32 (...) @cpuAND()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int choice(int *escolha) {
  printf("\nDigite uma escolha:\n"
         "0 - Imprime o array de notas\n"
         "1 - Acha a menor nota\n"
         "2 - Acha a maior nota\n"
         "3 - Imprime a media de todos os testes para cada aluno\n"
         "4 - Encerra o programa\n"
         "\nESCOLHA: ");
  scanf("%i", &*escolha);
  printf("\n");
}


x86 assembly (clang, -O0):
<choice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xf74(%rip),%rdi
call   1040 <scanf@plt>
lea    0xf6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xf70(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [183 x i8] c"\0ADigite uma escolha:\0A0 - Imprime o array de notas\0A1 - Acha a menor nota\0A2 - Acha a maior nota\0A3 - Imprime a media de todos os testes para cada aluno\0A4 - Encerra o programa\0A\0AESCOLHA: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @choice(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %3
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [183 x i8] c"\0ADigite uma escolha:\0A0 - Imprime o array de notas\0A1 - Acha a menor nota\0A2 - Acha a maior nota\0A3 - Imprime a media de todos os testes para cada aluno\0A4 - Encerra o programa\0A\0AESCOLHA: \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @choice(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%4 = tail call i32 @putchar(i32 10)
ret i32 undef
}
/* Type definitions */
struct ambapp_dev_hdr {
  int dummy;
};
struct ambapp_ahb_info {
  int dummy;
};

/* Variables and functions */
int ambapp_find_ahbslvs_next(struct ambapp_dev_hdr *, int, int,
                             struct ambapp_ahb_info *, int /*<<< orphan*/, int);
int ambapp_find_ahbslv(struct ambapp_dev_hdr *root, int vendor, int device,
                       struct ambapp_ahb_info *dev) {
  return ambapp_find_ahbslvs_next(root, vendor, device, dev, 0, 1);
}


x86 assembly (clang, -O0):
<ambapp_find_ahbslv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <ambapp_find_ahbslvs_next@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ambapp_find_ahbslv>:
xor    %r8d,%r8d
mov    $0x1,%r9d
jmp    1030 <ambapp_find_ahbslvs_next@plt>

LLVM IR (-O0):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslv(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3) {
%5 = alloca %struct.ambapp_dev_hdr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.ambapp_ahb_info*
store %struct.ambapp_dev_hdr* %0, %struct.ambapp_dev_hdr** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.ambapp_ahb_info* %3, %struct.ambapp_ahb_info** %8
%9 = load %struct.ambapp_dev_hdr*, %struct.ambapp_dev_hdr** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.ambapp_ahb_info*, %struct.ambapp_ahb_info** %8
%13 = call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %9, i32 %10, i32 %11, %struct.ambapp_ahb_info* %12, i32 0, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslv(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3) {
%5 = tail call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 0, i32 1)
ret i32 %5
}
/* Variables and functions */
int correspondence(char *);
int main(void) {
  if (correspondence("(())") != 3) {
    return (-1);
  }
  if (correspondence("(((((") != 5) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <correspondence@plt>
cmp    $0x3,%eax
je     1140 <main+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <main+0x58>
lea    0xebe(%rip),%rdi
call   1030 <correspondence@plt>
cmp    $0x5,%eax
je     1161 <main+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <main+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <correspondence@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x3,%ecx
jne    1141 <main+0x31>
lea    0xed5(%rip),%rdi
call   1030 <correspondence@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
setne  %al
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"(())\00"
@.str.1 = [6 x i8] c"(((((\00"
define i32 @main() {
%1 = tail call i32 @correspondence(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 3
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @correspondence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32 %4, 5
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t *event) {
  return little_endian_read_16(event, 21);
}


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

x86 assembly (clang, -O2):
<l2cap_event_channel_opened_get_flush_timeout>:
mov    $0x15,%esi
jmp    1030 <little_endian_read_16@plt>

LLVM IR (-O0):
define i32 @l2cap_event_channel_opened_get_flush_timeout(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @little_endian_read_16(i32* %3, i32 21)
ret i32 %4
}

LLVM IR (-O2):
define i32 @l2cap_event_channel_opened_get_flush_timeout(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 21)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void move_cursor(int row, int col) { printf("\033[%d;%dH", row, col); }


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

x86 assembly (clang, -O2):
<move_cursor>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int test_imm_38uint16_reg(unsigned short val) {
  return ((val) & (-0x38 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_38uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -56
%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_38uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -56
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sfxnew(void *);
void sfxunload(const char *path, void *s, void *_info) { sfxnew(s); }


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

x86 assembly (clang, -O2):
<sfxunload>:
mov    %rsi,%rdi
jmp    1030 <sfxnew@plt>

LLVM IR (-O0):
define void @sfxunload(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 = call i32 @sfxnew(i8* %7)
ret void
}

LLVM IR (-O2):
define void @sfxunload(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @sfxnew(i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ _finite(double);
scalar_t__ _isnan(double);
int isinf(double x) { return _finite(x) || _isnan(x) ? 0 : x < 0 ? -1 : 1; }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <_finite@plt>
cmp    $0x0,%rax
jne    1155 <isinf+0x35>
movsd  -0x8(%rbp),%xmm0
call   1040 <_isnan@plt>
cmp    $0x0,%rax
je     115f <isinf+0x3f>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    117b <isinf+0x5b>
movsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <_finite@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    115c <isinf+0x3c>
movsd  0x8(%rsp),%xmm0
call   1040 <_isnan@plt>
test   %rax,%rax
jne    115c <isinf+0x3c>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsp),%xmm0
setbe  %al
lea    (%rax,%rax,1),%ebx
add    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @_finite(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = call i64 @_isnan(double %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %16
11: ; preds = %6
%12 = load double, double* %2
%13 = fcmp olt double %12, 0.000000e+00
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 1
br label %16
16: ; preds = %11, %10
%17 = phi i32 [ 0, %10 ], [ %15, %11 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call i64 @_finite(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @_isnan(double %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = fcmp olt double %0, 0.000000e+00
%9 = select i1 %8, i32 -1, i32 1
br label %10
10: ; preds = %1, %4, %7
%11 = phi i32 [ %9, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ cl_int;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, scalar_t__, char const *, int);
void check_cl_error(cl_int err, const char *file, int line) {
  if (err != CL_SUCCESS) {
    printf("Error with errorcode: %d in file %s in line %d \n", err, file,
           line);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_cl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1168 <check_cl_error+0x48>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_cl_error>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %rdi,(%rax)
jne    112f <check_cl_error+0xf>
pop    %rax
ret
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@CL_SUCCESS = global i64 0
@.str = [49 x i8] c"Error with errorcode: %d in file %s in line %d \0A\00"
define void @check_cl_error(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i64, i64* @CL_SUCCESS
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %11, i8* %12, i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@CL_SUCCESS = global i64 0
@.str = [49 x i8] c"Error with errorcode: %d in file %s in line %d \0A\00"
define void @check_cl_error(i64 %0, i8* %1, i32 %2) {
%4 = load i64, i64* @CL_SUCCESS
%5 = icmp eq i64 %4, %0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %1, i32 %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
__int128_t quad_fetch_and(__int128_t *ptr, __int128_t value) {
  return __atomic_fetch_and(ptr, value, 2);
}


x86 assembly (clang, -O0):
<quad_fetch_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdi,-0x28(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x68(%rbp)
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <__atomic_fetch_and_16@plt>
mov    %rax,-0x80(%rbp)
mov    %rdx,-0x78(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%rcx
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_fetch_and>:
mov    $0x2,%ecx
jmp    1030 <__atomic_fetch_and_16@plt>

LLVM IR (-O0):
define { i64, i64 } @quad_fetch_and(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128*
%7 = alloca i128
%8 = alloca i128
%9 = alloca i128
%10 = alloca i128
%11 = alloca i128
%12 = bitcast i128* %5 to { i64, i64 }*
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 0
store i64 %1, i64* %13
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %12, i32 0, i32 1
store i64 %2, i64* %14
%15 = load i128, i128* %5
store i128* %0, i128** %6
store i128 %15, i128* %7
%16 = load i128*, i128** %6
%17 = load i128, i128* %7
store i128 %17, i128* %8
%18 = bitcast i128* %16 to i8*
%19 = load i128, i128* %8
store i128 %19, i128* %10
%20 = bitcast i128* %10 to { i64, i64 }*
%21 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 0
%22 = load i64, i64* %21
%23 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %20, i32 0, i32 1
%24 = load i64, i64* %23
%25 = call { i64, i64 } @__atomic_fetch_and_16(i8* %18, i64 %22, i64 %24, i32 2)
%26 = bitcast i128* %11 to { i64, i64 }*
%27 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 0
%28 = extractvalue { i64, i64 } %25, 0
store i64 %28, i64* %27
%29 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %26, i32 0, i32 1
%30 = extractvalue { i64, i64 } %25, 1
store i64 %30, i64* %29
%31 = load i128, i128* %11
store i128 %31, i128* %9
%32 = load i128, i128* %9
store i128 %32, i128* %4
%33 = bitcast i128* %4 to { i64, i64 }*
%34 = load { i64, i64 }, { i64, i64 }* %33
ret { i64, i64 } %34
}

LLVM IR (-O2):
define { i64, i64 } @quad_fetch_and(i128* %0, i64 %1, i64 %2) {
%4 = bitcast i128* %0 to i8*
%5 = tail call { i64, i64 } @__atomic_fetch_and_16(i8* %4, i64 %1, i64 %2, i32 2)
ret { i64, i64 } %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int mvgetch(int, int);
int /*<<< orphan*/ mvprintw(int, int, char *, int, int);
int /*<<< orphan*/ noecho();
int main() {
  int ch;
  initscr();
  noecho();
  while (1) {
    ch = mvgetch(5, 10);
    mvprintw(7, 10, "you input : %c(%d)", ch, ch);
  }
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    $0x5,%edi
mov    $0xa,%esi
call   1040 <mvgetch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x7,%edi
mov    $0xa,%esi
lea    0xe79(%rip),%rdx
call   1060 <mvprintw@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
lea    0xeaa(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    $0x5,%edi
mov    $0xa,%esi
call   1040 <mvgetch@plt>
mov    $0x7,%edi
mov    $0xa,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %eax,%r8d
call   1060 <mvprintw@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"you input : %c(%d)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @noecho()
br label %5
5: ; preds = %0, %5
%6 = call i32 @mvgetch(i32 5, i32 10)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @mvprintw(i32 7, i32 10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %5
}

LLVM IR (-O2):
@.str = [19 x i8] c"you input : %c(%d)\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 @mvgetch(i32 5, i32 10)
%5 = tail call i32 @mvprintw(i32 7, i32 10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %4)
br label %3
}
/* Variables and functions */
int f(int /*<<< orphan*/);
int g(void) { return f(0); }


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

x86 assembly (clang, -O2):
<g>:
xor    %edi,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
char *wfile_get_wd(void) {
  static char dir[512];
  getcwd(dir, 512 - 1);
  return (dir);
}


x86 assembly (clang, -O0):
<wfile_get_wd>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <getcwd@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_get_wd>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1030 <getcwd@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@wfile_get_wd.dir = internal global [512 x i8] zeroinitializer
define i8* @wfile_get_wd() {
%1 = call i32 @getcwd(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wfile_get_wd.dir, i64 0, i64 0), i32 511)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wfile_get_wd.dir, i64 0, i64 0)
}

LLVM IR (-O2):
@wfile_get_wd.dir = internal global [512 x i8] zeroinitializer
define i8* @wfile_get_wd() {
%1 = tail call i32 @getcwd(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wfile_get_wd.dir, i64 0, i64 0), i32 511)
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wfile_get_wd.dir, i64 0, i64 0)
}
/* Variables and functions */
double M_LN2;
double log(double);
double log2(double x) { return (log(x) / M_LN2); }


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
call   1030 <log@plt>
mov    0x2ec3(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_LN2 = global double 0.000000e+00
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = load double, double* @M_LN2
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_LN2 = global double 0.000000e+00
define double @log2(double %0) {
%2 = tail call double @log(double %0)
%3 = load double, double* @M_LN2
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rcr4(void) {
  uint64_t val;
  __asm volatile("movq %%cr4,%0" : "=r"(val));
  return val;
}


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

x86 assembly (clang, -O2):
<rcr4>:
mov    %cr4,%rax
ret

LLVM IR (-O0):
define i8* @rcr4() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "movq %cr4,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rcr4() {
%1 = tail call i8* asm sideeffect "movq %cr4,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char *);
void my_ui_message(int a, char *msg) {
  {
    printf((char const *__restrict)"%s\n", msg);
    return;
  }
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @my_ui_message(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int TestAccessProc2(path, mode) const char *path;
int mode;
{ return ((strstr(path, "testAccess2%.fil") == 0) ? -1 : 0); }


x86 assembly (clang, -O0):
<TestAccessProc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestAccessProc2>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"testAccess2%.fil\00"
define i32 @TestAccessProc2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
ret i32 %9
}

LLVM IR (-O2):
@.str = [17 x i8] c"testAccess2%.fil\00"
define i32 @TestAccessProc2(i8* %0, i32 %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = sext i1 %4 to i32
ret i32 %5
}
int au_br_wh_linkable(int brperm) { return !(brperm & (1 << 13)); }


x86 assembly (clang, -O0):
<au_br_wh_linkable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_br_wh_linkable>:
xor    %eax,%eax
test   $0x2000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @au_br_wh_linkable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8192
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @au_br_wh_linkable(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ unlink(char *);
void dodie() {
  unlink("/var/run/tinyupsd.pid");
  syslog(LOG_NOTICE, "stopped");
  closelog();
  exit(0);
}


x86 assembly (clang, -O0):
<dodie>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <unlink@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<dodie>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <unlink@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"/var/run/tinyupsd.pid\00"
@LOG_NOTICE = global i32 0
@.str.1 = [8 x i8] c"stopped\00"
define void @dodie() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @LOG_NOTICE
%3 = call i32 @syslog(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @closelog()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"/var/run/tinyupsd.pid\00"
@LOG_NOTICE = global i32 0
@.str.1 = [8 x i8] c"stopped\00"
define void @dodie() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @closelog()
%5 = tail call i32 @exit(i32 0)
unreachable
}
int x_fold_upper(c)
int c;
{ return x_fold_case('U'); }


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

x86 assembly (clang, -O2):
<x_fold_upper>:
mov    $0x55,%edi
xor    %eax,%eax
jmp    1030 <x_fold_case@plt>

LLVM IR (-O0):
define i32 @x_fold_upper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @x_fold_case to i32 (i32, ...)*)(i32 85)
ret i32 %3
}

LLVM IR (-O2):
define i32 @x_fold_upper(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @x_fold_case to i32 (i32, ...)*)(i32 85)
ret i32 %2
}
int fls(int x) {
  int r = 0;
  asm("bsrl %1,%0\n\t"
      "jnz 1f\n\t"
      "movl $-1,%0\n"
      "1:"
      : "=r"(r)
      : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsr    -0xc(%rbp),%eax
jne    1123 <fls+0x23>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
jne    1110 <fls+0x10>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @fls(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
int leastBitPos(int x) { return x & (-x); }


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

x86 assembly (clang, -O2):
<leastBitPos>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @leastBitPos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @leastBitPos(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
void dd_pbl_ios_testflight_submit_feedback(const char *feedback) {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_testflight_submit_feedback(i8* nocapture %0) {
ret void
}
int sqcompare(const void *va, const void *vb) {
  const int *a, *b;
  a = va;
  b = vb;
  if (*a > *b)
    return 1;
  if (*a < *b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sqcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <sqcompare+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <sqcompare+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <sqcompare+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <sqcompare+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqcompare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sqcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int FE_TONEAREST;
int fesetround(int round) { return (round == FE_TONEAREST) ? 0 : 1; }


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    0x2ed7(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @FE_TONEAREST
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @FE_TONEAREST
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int Problem006(void) {
  int input = 100;
  int i;
  int squareSum;
  int sumSquares;
  for (i = 1, sumSquares = 0, squareSum = 0; i <= input; i++) {
    sumSquares += i * i;
    squareSum += i;
  }
  squareSum = squareSum * squareSum;
  printf("%30d", (squareSum - sumSquares));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%30d\00"
define i32 @Problem006() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 100, i32* %1
store i32 1, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %9
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = load i32, i32* %3
%23 = load i32, i32* %3
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = sub nsw i32 %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%30d\00"
define i32 @Problem006() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void eigg_encode_ary_destroy(double *ary) { free(ary); }


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

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

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

LLVM IR (-O2):
define void @eigg_encode_ary_destroy(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void somefun1(void) { printf("\n somefun1() printed this.\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"\0A somefun1() printed this.\0A\00"
define void @somefun1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"\0A somefun1() printed this.\00"
define void @somefun1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void ad7298_ring_cleanup(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ad7298_ring_cleanup(%struct.iio_dev* nocapture %0) {
ret void
}
int is_ws(const char ch) {
  if (ch == ' ' || ch == '\n' || ch == '\t' || ch == '\r')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <is_ws+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     113e <is_ws+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <is_ws+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    114a <is_ws+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_ws+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ws>:
cmp    $0x20,%dil
ja     1120 <is_ws+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <is_ws+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_ws(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
%6 = icmp eq i32 %5, 32
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 13
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_ws(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void foo721(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo721(i32 %0) {
ret void
}