xunge/DecIR huggingface dataset:
__attribute__((always_)) int ClampMinus1023To1023(int x) {
  if (x < -1023)
    return -1023;
  if (x > 1023)
    return 1023;
  return x;
}


x86 assembly (clang, -O0):
<ClampMinus1023To1023>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffc01,-0x8(%rbp)
jge    1120 <ClampMinus1023To1023+0x20>
movl   $0xfffffc01,-0x4(%rbp)
jmp    113f <ClampMinus1023To1023+0x3f>
cmpl   $0x3ff,-0x8(%rbp)
jle    1139 <ClampMinus1023To1023+0x39>
movl   $0x3ff,-0x4(%rbp)
jmp    113f <ClampMinus1023To1023+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClampMinus1023To1023>:
cmp    $0x3ff,%edi
mov    $0x3ff,%ecx
cmovl  %edi,%ecx
cmp    $0xfffffc02,%ecx
mov    $0xfffffc01,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ClampMinus1023To1023(i32 %0) {
%2 = icmp slt i32 %0, 1023
%3 = select i1 %2, i32 %0, i32 1023
%4 = icmp sgt i32 %3, -1023
%5 = select i1 %4, i32 %3, i32 -1023
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ interactiveDisplayTest();
int main(int argc, char **argv) {
  interactiveDisplayTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @interactiveDisplayTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void *print_xs(void *unused) {
  int n = 10000;
  while (n--)
    fputc('x', stderr);
  return NULL;
}


x86 assembly (clang, -O0):
<print_xs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2710,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <print_xs+0x3f>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
jmp    1123 <print_xs+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xs>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffd8f0,%ebx
mov    0x2ec0(%rip),%r14
mov    (%r14),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
inc    %ebx
jne    1120 <print_xs+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
define i8* @print_xs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 10000, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = call i32 @fputc(i8 signext 120, i32 %9)
br label %4
11: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
define noalias i8* @print_xs(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 10000, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, -1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputc(i8 signext 120, i32 %5)
%7 = icmp eq i32 %4, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8* null
}
/* Variables and functions */
scalar_t__ memcpy(void *, void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void const *);
char *strcpy(void *s, const void *ct) {
  return (char *)memcpy(s, ct, strlen(ct));
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @memcpy(i8* %0, i8* %1, i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ button_update();
int /*<<< orphan*/ gps_update();
void update_all_inputs(void) {
  button_update();
  gps_update();
  return;
}


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

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

LLVM IR (-O0):
define void @update_all_inputs() {
%1 = call i32 (...) @button_update()
%2 = call i32 (...) @gps_update()
ret void
}

LLVM IR (-O2):
define void @update_all_inputs() {
%1 = tail call i32 (...) @button_update()
%2 = tail call i32 (...) @gps_update()
ret void
}
int main() {
  int a;
  a = 2 + 2;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int strlen(const char *str) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int br_inverse_cmd(int cmd) {
  switch (cmd) {
  case 0:
    return 1;
    break;
  case 1:
    return 0;
    break;
  case 2:
    return 3;
    break;
  case 3:
    return 2;
    break;
  case 5:
    return 4;
    break;
  case 4:
    return 5;
    break;
  case 7:
    return 6;
    break;
  case 6:
    return 7;
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<br_inverse_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     118c <br_inverse_cmd+0x8c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x0,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x3,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x2,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x4,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x5,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x6,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0x7,-0x4(%rbp)
jmp    1193 <br_inverse_cmd+0x93>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<br_inverse_cmd>:
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     1117 <br_inverse_cmd+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.br_inverse_cmd = [8 x i32] [i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6]
define i32 @br_inverse_cmd(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.br_inverse_cmd, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
int test_imm_39int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x39 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_39int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 57
%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_39int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 244813135872
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void print_define() {}


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

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

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

LLVM IR (-O2):
define void @print_define() {
ret void
}
int x(int i) {
  static const void *j[] = {&&x, &&y, &&z};
  goto *j[i];
x:
  return 2;
y:
  return 3;
z:
  return 5;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <x+0x43>
movl   $0x2,-0x4(%rbp)
jmp    113e <x+0x3e>
movl   $0x3,-0x4(%rbp)
jmp    113e <x+0x3e>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<x>:
movslq %edi,%rax
lea    0x2d26(%rip),%rcx
jmp    *(%rcx,%rax,8)
mov    $0x2,%eax
ret
mov    $0x5,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
@x.j = internal global [3 x i8*] [i8* blockaddress(@x, %8), i8* blockaddress(@x, %9), i8* blockaddress(@x, %10)]
define i32 @x(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* @x.j, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %13
8: ; preds = %13
store i32 2, i32* %2
br label %11
9: ; preds = %13
store i32 3, i32* %2
br label %11
10: ; preds = %13
store i32 5, i32* %2
br label %11
11: ; preds = %10, %9, %8
%12 = load i32, i32* %2
ret i32 %12
13: ; preds = %1
%14 = phi i8* [ %7, %1 ]
indirectbr i8* %14, [label %8, label %9, label %10]
}

LLVM IR (-O2):
@x.j = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@x, %7), i8* blockaddress(@x, %5), i8* blockaddress(@x, %6)]
define i32 @x(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* @x.j, i64 0, i64 %2
%4 = load i8*, i8** %3
indirectbr i8* %4, [label %7, label %5, label %6]
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5
%8 = phi i32 [ 5, %6 ], [ 3, %5 ], [ 2, %1 ]
ret i32 %8
}
int feunit_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @feunit_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int day, x1, x2;
  day = 9;
  x2 = 1;
  while (day > 0) {
    x1 = (x2 + 1) * 2;
    x2 = x1;
    day--;
  }
  printf("Total peach is:%d\n", x1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x9,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1150 <main+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x5fe,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Total peach is:%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1534)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotr(uint32_t x, int n) {
  if (n < 32)
    return (x >> n) | (x << (32 - n));
  return x;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1135 <rotr+0x35>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <rotr+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    %edi,%edx
mov    %esi,%ecx
sar    %cl,%edx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
or     %edx,%eax
cmp    $0x20,%esi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rotr(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 32
%4 = ashr i32 %0, %1
%5 = sub nsw i32 32, %1
%6 = shl i32 %0, %5
%7 = or i32 %6, %4
%8 = select i1 %3, i32 %7, i32 %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, int);
void primary(char const *fname, int perms, char *buffer) {
  char *template = "{\"fname\": \"%s\", \"octalMode\": %o}";
  sprintf(buffer, template, fname, perms);
}


x86 assembly (clang, -O0):
<primary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primary>:
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xee4(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"{\22fname\22: \22%s\22, \22octalMode\22: %o}\00"
define void @primary(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %6
%9 = load i8*, i8** %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @sprintf(i8* %8, i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"{\22fname\22: \22%s\22, \22octalMode\22: %o}\00"
define void @primary(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ send(int, char *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, long);
scalar_t__ strlen(char *);
void get_pid(int clientfd) {
  char buffer[11];
  pid_t pid = getpid();
  snprintf(buffer, sizeof(buffer), "%ld", (long)pid);
  send(clientfd, buffer, strlen(buffer) + 1, 0);
}


x86 assembly (clang, -O0):
<get_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x18(%rbp)
lea    -0xf(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xb,%esi
lea    0xe96(%rip),%rdx
call   1060 <snprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0xf(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xf(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1050 <send@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaa(%rip),%rdx
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
mov    %rax,%rcx
call   1060 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1050 <send@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @get_pid(i32 %0) {
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %4
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%7 = load i64, i64* %4
%8 = call i32 @snprintf(i8* %6, i32 11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i32, i32* %2
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%12 = call i64 @strlen(i8* %11)
%13 = add nsw i64 %12, 1
%14 = call i32 @send(i32 %9, i8* %10, i64 %13, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @get_pid(i32 %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = tail call i64 (...) @getpid()
%5 = call i32 @snprintf(i8* %3, i32 11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = call i64 @strlen(i8* %3)
%7 = add nsw i64 %6, 1
%8 = call i32 @send(i32 %0, i8* %3, i64 %7, i32 0)
ret void
}
unsigned int f2ui(float x) { return x; }


x86 assembly (clang, -O0):
<f2ui>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2ui>:
cvttss2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @f2ui(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptoui float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @f2ui(float %0) {
%2 = fptoui float %0 to i32
ret i32 %2
}
int hugo_hasgraphics(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hugo_hasgraphics() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_dgram();
int /*<<< orphan*/ init_vifs();
int /*<<< orphan*/ start();
int main(int argc, char **argv) {
  init_dgram();
  init_vifs();
  start();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <init_dgram@plt>
mov    $0x0,%al
call   1030 <init_vifs@plt>
mov    $0x0,%al
call   1040 <start@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init_dgram()
%7 = call i32 (...) @init_vifs()
%8 = call i32 (...) @start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_dgram()
%4 = tail call i32 (...) @init_vifs()
%5 = tail call i32 (...) @start()
ret i32 0
}
void gdk_screen_get_width_mm() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_width_mm() {
ret void
}
int f() {
  int a1;
  int a2;
  int a3;
  int a4;
  int a5;
  a1 = 1 != 1 + 2;
  a2 = 1 + 2 == 1 + 2;
  a3 = 1 + 2 <= 1 + 2;
  a4 = +1 - -2 >= - -1 + 2;
  a5 = !1 == !2;
  return a1 * 10000 + a2 * 1000 + a3 * 100 + a4 * 10 + a5;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
imul   $0x2710,-0x4(%rbp),%eax
imul   $0x3e8,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x64,-0xc(%rbp),%ecx
add    %ecx,%eax
imul   $0xa,-0x10(%rbp),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 1, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 10000
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 100
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @f() {
ret i32 11111
}
int MPI_Init_thread(int *argc, char ***argv, int required, int *provided) {
  *provided = required;
  return (0);
}


x86 assembly (clang, -O0):
<MPI_Init_thread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Init_thread>:
mov    %edx,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @MPI_Init_thread(i32* nocapture readnone %0, i8*** nocapture readnone %1, i32 %2, i32* nocapture writeonly %3) {
store i32 %2, i32* %3
ret i32 0
}
int OmronWriteBitMem(int plc_id, char type, unsigned short addr, char bit,
                     short num, short *data) {
  return -1;
}


x86 assembly (clang, -O0):
<OmronWriteBitMem>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %sil,-0x5(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
mov    %r9,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OmronWriteBitMem(i32 %0, i8 signext %1, i16 zeroext %2, i8 signext %3, i16 signext %4, i16* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i16
%10 = alloca i8
%11 = alloca i16
%12 = alloca i16*
store i32 %0, i32* %7
store i8 %1, i8* %8
store i16 %2, i16* %9
store i8 %3, i8* %10
store i16 %4, i16* %11
store i16* %5, i16** %12
ret i32 -1
}

LLVM IR (-O2):
define i32 @OmronWriteBitMem(i32 %0, i8 signext %1, i16 zeroext %2, i8 signext %3, i16 signext %4, i16* nocapture readnone %5) {
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_x(void *_p) {
  return (int)((XWindowAttributes *)_p)->x;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowAttributes_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void test_three(int x, int y) {
#pragma omp distribute simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  printf("This is before the sleep.\n");
  sleep(10);
  printf("This is after the sleep and before the for loop.\n");
  long i;
  for (i = 0; i < 999999999999999; i++)
    ;
  printf("This is after the for loop.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
movabs $0x38d7ea4c67fff,%rax
cmp    %rax,-0x10(%rbp)
jge    1183 <main+0x63>
jmp    1172 <main+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1159 <main+0x39>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <sleep@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"This is before the sleep.\0A\00"
@.str.1 = [50 x i8] c"This is after the sleep and before the for loop.\0A\00"
@.str.2 = [29 x i8] c"This is after the for loop.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
store i64 0, i64* %2
br label %6
6: ; preds = %10, %0
%7 = load i64, i64* %2
%8 = icmp slt i64 %7, 999999999999999
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 1
store i64 %12, i64* %2
br label %6
13: ; preds = %6
%14 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@str = [26 x i8] c"This is before the sleep.\00"
@str.3 = [49 x i8] c"This is after the sleep and before the for loop.\00"
@str.4 = [28 x i8] c"This is after the for loop.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
char flag_def(unsigned int flag) {
  return (flag & 1) ? 'C' : (flag & 2) ? 'R' : (flag & 4) ? 'S' : 'X';
}


x86 assembly (clang, -O0):
<flag_def>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1123 <flag_def+0x23>
mov    $0x43,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <flag_def+0x5e>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     113f <flag_def+0x3f>
mov    $0x52,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <flag_def+0x58>
mov    -0x4(%rbp),%edx
and    $0x4,%edx
mov    $0x58,%eax
mov    $0x53,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_def>:
mov    $0x43,%al
test   $0x1,%dil
jne    111f <flag_def+0x1f>
mov    $0x52,%al
test   $0x2,%dil
jne    111f <flag_def+0x1f>
xor    %eax,%eax
test   $0x4,%dil
sete   %al
lea    (%rax,%rax,4),%eax
add    $0x53,%eax
ret

LLVM IR (-O0):
define signext i8 @flag_def(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %18
12: ; preds = %7
%13 = load i32, i32* %2
%14 = and i32 %13, 4
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 83, i32 88
br label %18
18: ; preds = %12, %11
%19 = phi i32 [ 82, %11 ], [ %17, %12 ]
br label %20
20: ; preds = %18, %6
%21 = phi i32 [ 67, %6 ], [ %19, %18 ]
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @flag_def(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i32 %0, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, 4
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8 88, i8 83
br label %11
11: ; preds = %7, %4, %1
%12 = phi i8 [ 67, %1 ], [ %10, %7 ], [ 82, %4 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ main();
int /*<<< orphan*/ system(char *);
int kill(void) {
  system("cls");
  system("net use X: /delete");
  system("pause");
  main();
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
lea    0xec9(%rip),%rdi
call   1030 <system@plt>
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1040 <main@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <main@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [19 x i8] c"net use X: /delete\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @kill() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @main()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [19 x i8] c"net use X: /delete\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @kill() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @main()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
              int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int errno;
int fchmod(int fd, mode_t mode) {
  int ret = __syscall(91, fd, mode, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fchmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x5b,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1165 <fchmod+0x55>
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    0x2e89(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <fchmod+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchmod>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
xor    %ebx,%ebx
mov    $0x5b,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>
test   %eax,%eax
jns    1148 <fchmod+0x38>
neg    %eax
mov    0x2e9f(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @fchmod(i32 %0, i32 %1) {
%3 = tail call i32 @__syscall(i32 91, i32 %0, i32 %1, i32 0, i32 0, i32 0, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char name[20];
  printf("Enter name: ");
  scanf("%s", name);
  printf("Your name is %s.", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c"Your name is %s.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c"Your name is %s.\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
int test_imm_93int32_mem(int *val) {
  return ((*val) & (0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 147
%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_93int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 147
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gdk_xid_table_lookup() {}


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

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

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

LLVM IR (-O2):
define void @gdk_xid_table_lookup() {
ret void
}
int bics_si_test1(int a, int b, int c) {
  if ((a | b) == a)
    return a;
  else
    return c;
}


x86 assembly (clang, -O0):
<bics_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1127 <bics_si_test1+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <bics_si_test1+0x2d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test1>:
mov    %edx,%eax
mov    %edi,%ecx
not    %ecx
test   %esi,%ecx
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %1, %0
%5 = icmp eq i32 %4, %0
%6 = select i1 %5, i32 %0, i32 %2
ret i32 %6
}
int test_imm_DFuint8_mem(unsigned char *val) {
  return ((*val) & (-0xDF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DFuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 33
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf32(int f, int n) { return (cbuf(f, n, 32)); }


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

x86 assembly (clang, -O2):
<cbuf32>:
mov    $0x20,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf32(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 @cbuf(i32 %5, i32 %6, i32 32)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf32(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 32)
ret i32 %3
}
void ExttClusterAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttClusterAuxTable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int count4(int /*<<< orphan*/ const);
void countDigits4(size_t length, const uint32_t *dataArray, int *countArray) {
  while (length) {
    *countArray = count4(*dataArray);
    countArray++;
    dataArray++;
    length--;
  }
}


x86 assembly (clang, -O0):
<countDigits4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <countDigits4+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <count4@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <countDigits4+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits4>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <countDigits4+0x36>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <count4@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <countDigits4+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @countDigits4(i64 %0, i32* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
br label %7
7: ; preds = %10, %3
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = call i32 @count4(i32 %12)
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %6
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %5
%19 = load i64, i64* %4
%20 = add i64 %19, -1
store i64 %20, i64* %4
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @countDigits4(i64 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32* [ %11, %5 ], [ %2, %3 ]
%7 = phi i32* [ %12, %5 ], [ %1, %3 ]
%8 = phi i64 [ %13, %5 ], [ %0, %3 ]
%9 = load i32, i32* %7
%10 = tail call i32 @count4(i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds i32, i32* %6, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}