xunge/DecIR huggingface dataset:
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int mutex_signal(int semid, int sem_num) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = 1;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


x86 assembly (clang, -O0):
<mutex_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_signal>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @mutex_signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = call i32 @semop(i32 %11, %struct.sembuf* %6, i32 1)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @mutex_signal(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret i32 undef
}
void rop3_112_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_112_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_112_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_112_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_112_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %1, -1
%7 = and i8 %6, %2
%8 = or i8 %5, %7
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) { system("dir"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"dir\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"dir\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int SumOfAP(int a, int d, int n) {
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum = sum + a;
    a = a + d;
  }
  return sum;
}


x86 assembly (clang, -O0):
<SumOfAP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <SumOfAP+0x47>
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <SumOfAP+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SumOfAP>:
test   %edx,%edx
jle    111f <SumOfAP+0x1f>
lea    (%rsi,%rdi,1),%eax
lea    -0x1(%rdx),%ecx
imul   %ecx,%eax
add    $0xfffffffe,%edx
imul   %rcx,%rdx
shr    %rdx
imul   %esi,%edx
add    %edi,%eax
add    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SumOfAP(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = add i32 %1, %0
%7 = add nsw i32 %2, -1
%8 = mul i32 %6, %7
%9 = zext i32 %7 to i33
%10 = add nsw i32 %2, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = mul i32 %14, %1
%16 = add i32 %8, %0
%17 = add i32 %16, %15
br label %18
18: ; preds = %5, %3
%19 = phi i32 [ 0, %3 ], [ %17, %5 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *dummy2(void *x, void *y) { exit(0); }


x86 assembly (clang, -O0):
<dummy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<dummy2>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i8* @dummy2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define noalias i8* @dummy2(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Beep_A2B(int, int);
int /*<<< orphan*/ Tos_TaskDelay(int);
void Beep_Bee() {
  Beep_A2B(400, 600);
  Tos_TaskDelay(30);
  Beep_A2B(600, 90);
  Tos_TaskDelay(10);
  Beep_A2B(600, 90);
  Tos_TaskDelay(40);
  Beep_A2B(300, 500);
}


x86 assembly (clang, -O0):
<Beep_Bee>:
push   %rbp
mov    %rsp,%rbp
mov    $0x190,%edi
mov    $0x258,%esi
call   1030 <Beep_A2B@plt>
mov    $0x1e,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x258,%edi
mov    $0x5a,%esi
call   1030 <Beep_A2B@plt>
mov    $0xa,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x258,%edi
mov    $0x5a,%esi
call   1030 <Beep_A2B@plt>
mov    $0x28,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x12c,%edi
mov    $0x1f4,%esi
call   1030 <Beep_A2B@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Beep_Bee>:
push   %rax
mov    $0x190,%edi
mov    $0x258,%esi
call   1030 <Beep_A2B@plt>
mov    $0x1e,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x258,%edi
mov    $0x5a,%esi
call   1030 <Beep_A2B@plt>
mov    $0xa,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x258,%edi
mov    $0x5a,%esi
call   1030 <Beep_A2B@plt>
mov    $0x28,%edi
call   1040 <Tos_TaskDelay@plt>
mov    $0x12c,%edi
mov    $0x1f4,%esi
pop    %rax
jmp    1030 <Beep_A2B@plt>

LLVM IR (-O0):
define void @Beep_Bee() {
%1 = call i32 @Beep_A2B(i32 400, i32 600)
%2 = call i32 @Tos_TaskDelay(i32 30)
%3 = call i32 @Beep_A2B(i32 600, i32 90)
%4 = call i32 @Tos_TaskDelay(i32 10)
%5 = call i32 @Beep_A2B(i32 600, i32 90)
%6 = call i32 @Tos_TaskDelay(i32 40)
%7 = call i32 @Beep_A2B(i32 300, i32 500)
ret void
}

LLVM IR (-O2):
define void @Beep_Bee() {
%1 = tail call i32 @Beep_A2B(i32 400, i32 600)
%2 = tail call i32 @Tos_TaskDelay(i32 30)
%3 = tail call i32 @Beep_A2B(i32 600, i32 90)
%4 = tail call i32 @Tos_TaskDelay(i32 10)
%5 = tail call i32 @Beep_A2B(i32 600, i32 90)
%6 = tail call i32 @Tos_TaskDelay(i32 40)
%7 = tail call i32 @Beep_A2B(i32 300, i32 500)
ret void
}
int tek_coord(char *report, int offset) {
  int hi = 037 & ((unsigned char)(report[offset]));
  int lo = 037 & ((unsigned char)(report[offset + 1]));
  return (hi << 5) + lo;
}


x86 assembly (clang, -O0):
<tek_coord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tek_coord>:
movslq %esi,%rcx
movzbl (%rdi,%rcx,1),%eax
and    $0x1f,%eax
movzbl 0x1(%rdi,%rcx,1),%ecx
and    $0x1f,%ecx
shl    $0x5,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tek_coord(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 31, %12
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 31, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = shl i32 %22, 5
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @tek_coord(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = and i8 %5, 31
%7 = zext i8 %6 to i32
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = and i8 %11, 31
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %7, 5
%15 = or i32 %14, %13
ret i32 %15
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  char ch;
  while ((ch = getchar()) != '.')
    putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x2e,%eax
je     1153 <main+0x33>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x2e,%al
je     1145 <main+0x25>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 46
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @putchar(i8 signext %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 46
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
unsigned char mod_16x8(unsigned short s16, unsigned char i8) { return (0); }


x86 assembly (clang, -O0):
<mod_16x8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @mod_16x8(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @mod_16x8(i16 zeroext %0, i8 zeroext %1) {
ret i8 0
}
/* Type definitions */
struct linkedList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addBackList(struct linkedList *, int);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void addList(struct linkedList *lst, int v) {
  assert(lst != NULL);
  addBackList(lst, v);
}


x86 assembly (clang, -O0):
<addList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <addBackList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addList>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <addBackList@plt>

LLVM IR (-O0):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = alloca %struct.linkedList*
%4 = alloca i32
store %struct.linkedList* %0, %struct.linkedList** %3
store i32 %1, i32* %4
%5 = load %struct.linkedList*, %struct.linkedList** %3
%6 = icmp ne %struct.linkedList* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.linkedList*, %struct.linkedList** %3
%10 = load i32, i32* %4
%11 = call i32 @addBackList(%struct.linkedList* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.linkedList = type { i32 }
define void @addList(%struct.linkedList* %0, i32 %1) {
%3 = icmp ne %struct.linkedList* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @addBackList(%struct.linkedList* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() { system("ls -al"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"ls -al\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ls -al\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main() {
  int e = 1;
  f(&e);
#pragma omp taskwait
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 0
}
int test_imm_1Fuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x1F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 133143986176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EncodeArith(unsigned int, int, unsigned int);
void generate_value(unsigned valuex, unsigned rangex) {
  EncodeArith(valuex, 1, rangex);
}


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

x86 assembly (clang, -O2):
<generate_value>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <EncodeArith@plt>

LLVM IR (-O0):
define void @generate_value(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 @EncodeArith(i32 %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @generate_value(i32 %0, i32 %1) {
%3 = tail call i32 @EncodeArith(i32 %0, i32 1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hoic_remote_update(int, char *);
int hdoip_cli_remote_update(int fd, int fdr, char **argv, int argc) {
  hoic_remote_update(fd, argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_remote_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <hoic_remote_update@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_remote_update>:
push   %rax
mov    (%rdx),%rsi
call   1030 <hoic_remote_update@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_cli_remote_update(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8**, i8*** %7
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @hoic_remote_update(i32 %9, i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_cli_remote_update(i32 %0, i32 %1, i8** nocapture %2, i32 %3) {
%5 = load i8*, i8** %2
%6 = tail call i32 @hoic_remote_update(i32 %0, i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getloadavg(double *, int);
int /*<<< orphan*/ printf(char *, double, double, double);
int main(int argc, char *argv[]) {
  double d[3];
  getloadavg(d, 3);
  printf("%.2f,%.2f,%.2f\n", d[0], d[1], d[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <getloadavg@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%.2f,%.2f,%.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%8 = call i32 @getloadavg(double* %7, i32 3)
%9 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%10 = load double, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %10, double %12, double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.2f,%.2f,%.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @getloadavg(double* %5, i32 3)
%7 = load double, double* %5
%8 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %7, double %9, double %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_asig_section() { write("msproject.xml", "</Assignments>\n", NULL); }


x86 assembly (clang, -O0):
<end_asig_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_asig_section>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [16 x i8] c"</Assignments>\0A\00"
define void @end_asig_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [16 x i8] c"</Assignments>\0A\00"
define void @end_asig_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_ACR() { return mem_get_reg32(0x40023C00 + 0x00); }


x86 assembly (clang, -O0):
<flash_get_ACR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40023c00,%edi
call   1030 <mem_get_reg32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_get_ACR>:
mov    $0x40023c00,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_ACR() {
%1 = call i32* @mem_get_reg32(i32 1073888256)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_ACR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888256)
ret i32* %1
}
void assert(int expr) {
  if (expr == 0) {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <assert+0x1b>
jmp    1116 <assert+0x16>
jmp    1116 <assert+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1110 <assert+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <assert+0x10>

LLVM IR (-O0):
define void @assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
br label %6
6: ; preds = %6, %5
br label %6
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
void info_player_start() {}


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

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

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

LLVM IR (-O2):
define void @info_player_start() {
ret void
}
float test1(int cond, float a, float b) { return cond ? a : b; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <test1+0x2a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1134 <test1+0x34>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %edi,%edi
je     1107 <test1+0x7>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @test1(i32 %0, float %1, float %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, float %2, float %1
ret float %5
}
/* Variables and functions */
int bit_mask2(int);
int main(void) { return bit_mask2(3); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bit_mask2(i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ allocExitError(char *, size_t, size_t, char const *);
void *malloc(size_t);
void *mallocOrExit3(size_t count, size_t size, const char *name) {
  void *p = malloc(count * size);
  if (p == 0 && count > 0)
    allocExitError("malloc", count, size, name);
  return p;
}


x86 assembly (clang, -O0):
<mallocOrExit3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1174 <mallocOrExit3+0x54>
cmpq   $0x0,-0x8(%rbp)
jbe    1174 <mallocOrExit3+0x54>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe91(%rip),%rdi
call   1030 <allocExitError@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocOrExit3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
imul   %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
test   %rbx,%rbx
je     115f <mallocOrExit3+0x3f>
test   %r12,%r12
jne    115f <mallocOrExit3+0x3f>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <allocExitError@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @mallocOrExit3(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = mul i64 %8, %9
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %22
14: ; preds = %3
%15 = load i64, i64* %4
%16 = icmp ugt i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i64, i64* %4
%19 = load i64, i64* %5
%20 = load i8*, i8** %6
%21 = call i32 @allocExitError(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %18, i64 %19, i8* %20)
br label %22
22: ; preds = %17, %14, %3
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @mallocOrExit3(i64 %0, i64 %1, i8* %2) {
%4 = mul i64 %1, %0
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
%7 = icmp ne i64 %0, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @allocExitError(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i8* %2)
br label %11
11: ; preds = %9, %3
ret i8* %5
}
void XtUngrabPointer() {}


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

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

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

LLVM IR (-O2):
define void @XtUngrabPointer() {
ret void
}
/* Variables and functions */
float fabs(float);
float fastlog2(float);
float fastpow2(float);
float fastpow(float x, float p) {
  if (x < 0)
    return -fastpow2(p * fastlog2(fabs(x)));
  return fastpow2(p * fastlog2(x));
}


x86 assembly (clang, -O0):
<fastpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1190 <fastpow+0x60>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
call   1050 <fastlog2@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <fastpow2@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11ba <fastpow+0x8a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <fastlog2@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <fastpow2@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastpow>:
push   %rax
movss  %xmm1,0x4(%rsp)
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    114f <fastpow+0x2f>
andps  0xeca(%rip),%xmm0
call   1040 <fastlog2@plt>
mulss  0x4(%rsp),%xmm0
call   1030 <fastpow2@plt>
xorps  0xec3(%rip),%xmm0
pop    %rax
ret
call   1040 <fastlog2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <fastpow2@plt>

LLVM IR (-O0):
define float @fastpow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load float, float* %5
%10 = load float, float* %4
%11 = call float @fabs(float %10)
%12 = call float @fastlog2(float %11)
%13 = fmul float %9, %12
%14 = call float @fastpow2(float %13)
%15 = fneg float %14
store float %15, float* %3
br label %22
16: ; preds = %2
%17 = load float, float* %5
%18 = load float, float* %4
%19 = call float @fastlog2(float %18)
%20 = fmul float %17, %19
%21 = call float @fastpow2(float %20)
store float %21, float* %3
br label %22
22: ; preds = %16, %8
%23 = load float, float* %3
ret float %23
}

LLVM IR (-O2):
define float @fastpow(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call float @llvm.fabs.f32(float %0)
%6 = tail call float @fastlog2(float %5)
%7 = fmul float %6, %1
%8 = tail call float @fastpow2(float %7)
%9 = fneg float %8
br label %14
10: ; preds = %2
%11 = tail call float @fastlog2(float %0)
%12 = fmul float %11, %1
%13 = tail call float @fastpow2(float %12)
br label %14
14: ; preds = %10, %4
%15 = phi float [ %9, %4 ], [ %13, %10 ]
ret float %15
}
char lc(char c) {
  if (c >= 'a' && c <= 'z')
    c += 'A' - 'a';
  return c;
}


x86 assembly (clang, -O0):
<lc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <lc+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <lc+0x2e>
movsbl -0x1(%rbp),%eax
add    $0xffffffe0,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @lc(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
struct fat16_dir_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fat16_dir_struct *);
void fat16_close_dir(struct fat16_dir_struct *dd) {
  if (dd)
    free(dd);
}


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

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

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

LLVM IR (-O2):
%struct.fat16_dir_struct = type { i32 }
define void @fat16_close_dir(%struct.fat16_dir_struct* %0) {
%2 = icmp eq %struct.fat16_dir_struct* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.fat16_dir_struct* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_char();
int /*<<< orphan*/ puts(char *);
void begin() {
  puts("; Generated by Luiji's Tiny BASIC Compiler");
  puts("");
  puts("section .text");
  puts("");
  puts("\torg 0x100");
  get_char();
}


x86 assembly (clang, -O0):
<begin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <get_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <get_char@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"; Generated by Luiji's Tiny BASIC Compiler\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [14 x i8] c"section .text\00"
@.str.3 = [11 x i8] c"\09org 0x100\00"
define void @begin() {
%1 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @get_char()
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"; Generated by Luiji's Tiny BASIC Compiler\00"
@.str.2 = [14 x i8] c"section .text\00"
@.str.3 = [11 x i8] c"\09org 0x100\00"
define void @begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @get_char()
ret void
}
int test_imm_8Buint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Buint64_highword_reg>:
movabs $0x8b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Buint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 139
%6 = icmp ne i64 %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_8Buint64_highword_reg(i64 %0) {
%2 = and i64 %0, 597000454144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t multimap_write(int fd, const void *buffer, size_t size) {
  return write(fd, buffer, size);
}


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

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

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

LLVM IR (-O2):
define i32 @multimap_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
int base10() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base10() {
ret i32 0
}
double virial_m1(const double coeff[], double x) {
  return x * coeff[0] + x * x * coeff[1] + x * x * x * coeff[2];
}


x86 assembly (clang, -O0):
<virial_m1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<virial_m1>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rdi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm1
mulsd  (%rdi),%xmm0
addsd  %xmm2,%xmm0
mulsd  0x10(%rdi),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @virial_m1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double, double* %4
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = load double, double* %4
%21 = fmul double %19, %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %16)
ret double %25
}

LLVM IR (-O2):
define double @virial_m1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fmul double %1, %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = fmul double %4, %6
%8 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %7)
%9 = fmul double %4, %1
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %9, double %11, double %8)
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *Persistence_open_common(char, char *, char *, char *);
FILE *Persistence_open_sudirriptions(char mode) {
  return Persistence_open_common(mode, "amqtdd.sub", "amqtdd.1ub",
                                 "amqtdd.2ub");
}


x86 assembly (clang, -O0):
<Persistence_open_sudirriptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rsi
lea    0xedf(%rip),%rdx
lea    0xee3(%rip),%rcx
movsbl -0x1(%rbp),%edi
call   1030 <Persistence_open_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Persistence_open_sudirriptions>:
lea    0xee9(%rip),%rsi
lea    0xeed(%rip),%rdx
lea    0xef1(%rip),%rcx
jmp    1030 <Persistence_open_common@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"amqtdd.sub\00"
@.str.1 = [11 x i8] c"amqtdd.1ub\00"
@.str.2 = [11 x i8] c"amqtdd.2ub\00"
define i32* @Persistence_open_sudirriptions(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @Persistence_open_common(i8 signext %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32* %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"amqtdd.sub\00"
@.str.1 = [11 x i8] c"amqtdd.1ub\00"
@.str.2 = [11 x i8] c"amqtdd.2ub\00"
define i32* @Persistence_open_sudirriptions(i8 signext %0) {
%2 = tail call i32* @Persistence_open_common(i8 signext %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_history() { printf("History:"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"History:\00"
define void @display_history() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrf_read(int, unsigned char *, int);
unsigned char __attribute__((unused)) nrf_payload_width(void) {
  unsigned char ret;
  nrf_read(0x60, &ret, 1);
  return ret;
}


x86 assembly (clang, -O0):
<nrf_payload_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x60,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <nrf_read@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_payload_width>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x60,%edi
mov    $0x1,%edx
call   1030 <nrf_read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @nrf_payload_width() {
%1 = alloca i8
%2 = call i32 @nrf_read(i32 96, i8* %1, i32 1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @nrf_payload_width() {
%1 = alloca i8
%2 = call i32 @nrf_read(i32 96, i8* %1, i32 1)
%3 = load i8, i8* %1
ret i8 %3
}
int main() {
  int data1 = 10;
  int data2 = 20;
  __asm__ __volatile__("movl %1, %%eax\n\t"
                       "imull %%eax, %0"
                       : "=r"(data2)
                       : "r"(data1), "0"(data2)
                       : "eax");
  printf("The result is %d\n", data2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %edx,%eax
imul   %eax,%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 asm sideeffect "movl $1, %eax\0A\09imull %eax, $0", "=r,r,0,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "movl $1, %eax\0A\09imull %eax, $0", "=r,r,0,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}