xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ mknod(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int make_device(const char *pathname, mode_t mode, dev_t dev) {
  if (mknod(pathname, mode, dev) < 0) {
    fprintf(stderr, "cannot create device %s: %m\n", pathname);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<make_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <mknod@plt>
cmp    $0x0,%rax
jge    1170 <make_device+0x50>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1177 <make_device+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_device>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mknod@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
js     1138 <make_device+0x18>
pop    %rbx
ret
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"cannot create device %s: %m\0A\00"
define i32 @make_device(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i64 @mknod(i8* %8, i32 %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %5
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 0, i32* %4
br label %18
17: ; preds = %3
store i32 1, i32* %4
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"cannot create device %s: %m\0A\00"
define i32 @make_device(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @mknod(i8* %0, i32 %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %10
}
char to_hex(char c) {
  static const char hex[] = "0123456789abcdef";
  return hex[c & 15];
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@to_hex.hex = internal constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ cdns_debug_dump();
void sigusr1_handler(int sig, short what, void *_arg) { cdns_debug_dump(); }


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

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

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

LLVM IR (-O2):
define void @sigusr1_handler(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @cdns_debug_dump()
ret void
}
void b43legacy_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @b43legacy_debugfs_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbgmem_dump_blocks();
void dbgmem_debug_heap_fini(void) { dbgmem_dump_blocks(); }


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

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

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

LLVM IR (-O2):
define void @dbgmem_debug_heap_fini() {
%1 = tail call i32 (...) @dbgmem_dump_blocks()
ret void
}
void f3() { return; }


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

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

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

LLVM IR (-O2):
define void @f3() {
ret void
}
void *foo(void) {
lab:
  return &&lab;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
lea    -0x7(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x7(%rip),%rax
ret

LLVM IR (-O0):
define i8* @foo() {
br label %1
1: ; preds = %2, %0
ret i8* blockaddress(@foo, %1)
2: ; No predecessors!
indirectbr i8* undef, [label %1]
}

LLVM IR (-O2):
define i8* @foo() {
br label %1
1: ; preds = %0
ret i8* blockaddress(@foo, %1)
}
void SwapUVRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @SwapUVRow_AVX2() {
ret void
}
/* Variables and functions */
int bar(int);
void foo(void) {
  int b = 0;
  b = bar(b);
  b = bar(b);
  b = bar(b);
  b = bar(b);
  bar(b);
}


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 0)
%2 = tail call i32 @bar(i32 %1)
%3 = tail call i32 @bar(i32 %2)
%4 = tail call i32 @bar(i32 %3)
%5 = tail call i32 @bar(i32 %4)
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double acosh(double);
double pop(struct lifo *);
double opr_acosh(struct lifo *stack) {
  double op = pop(stack);
  return acosh(op);
}


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

x86 assembly (clang, -O2):
<opr_acosh>:
push   %rax
call   1040 <pop@plt>
pop    %rax
jmp    1030 <acosh@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_acosh(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @acosh(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_acosh(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @acosh(double %2)
ret double %3
}
int funcA(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<funcA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcA>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @funcA(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @funcA(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
XResizeWindow() {}


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

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

LLVM IR (-O0):
define i32 @XResizeWindow() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XResizeWindow() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d", (a -= b) < 0 ? -a : a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1164 <main+0x44>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116a <main+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe8f(%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
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
mov    %eax,(%rsp)
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = sub nsw i32 %7, %6
store i32 %8, i32* %1
%9 = call i32 @llvm.abs.i32(i32 %8, i1 true)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wr_reg(unsigned char, unsigned short);
void GLCD_WrReg(unsigned char reg, unsigned short val) { wr_reg(reg, val); }


x86 assembly (clang, -O0):
<GLCD_WrReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzwl -0x4(%rbp),%esi
call   1030 <wr_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_WrReg>:
jmp    1030 <wr_reg@plt>

LLVM IR (-O0):
define void @GLCD_WrReg(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = call i32 @wr_reg(i8 zeroext %5, i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @GLCD_WrReg(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @wr_reg(i8 zeroext %0, i16 zeroext %1)
ret void
}
/* Variables and functions */
scalar_t__ soc_is_s3c24xx();
unsigned int pwm_tdiv_has_div1(void) {
  if (soc_is_s3c24xx())
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<pwm_tdiv_has_div1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <soc_is_s3c24xx@plt>
cmp    $0x0,%rax
je     1135 <pwm_tdiv_has_div1+0x25>
movl   $0x0,-0x4(%rbp)
jmp    113c <pwm_tdiv_has_div1+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_tdiv_has_div1>:
push   %rax
xor    %eax,%eax
call   1030 <soc_is_s3c24xx@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pwm_tdiv_has_div1() {
%1 = alloca i32
%2 = call i64 (...) @soc_is_s3c24xx()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @pwm_tdiv_has_div1() {
%1 = tail call i64 (...) @soc_is_s3c24xx()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char **argv) {
  printf("usage: %s N\n  N - max number of children threads to fork\n",
         argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"usage: %s N\0A N - max number of children threads to fork\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [58 x i8] c"usage: %s N\0A N - max number of children threads to fork\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void fd199(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    p025A:
      goto p025A;
      goto a;
    P025A:
      goto P025A;
      0;
    };
  a:;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd199>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd199+0x7>

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

LLVM IR (-O0):
define void @fd199(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd199(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ brent_local_min(double (*)(double), double, double, double,
                                   double, double *);
double macheps();
double fminbnd(double (*funcpt)(double), double a, double b) {
  double x, t, eps;
  t = 1e-012;
  eps = macheps();
  brent_local_min(funcpt, a, b, t, eps, &x);
  return x;
}


x86 assembly (clang, -O0):
<fminbnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <macheps@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    -0x20(%rbp),%rsi
call   1040 <brent_local_min@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminbnd>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <macheps@plt>
movaps %xmm0,%xmm3
movsd  0xeba(%rip),%xmm2
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <brent_local_min@plt>
movsd  0x18(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fminbnd(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
store double 0x3D719799812DEA11, double* %8
%10 = call double (...) @macheps()
store double %10, double* %9
%11 = load double (double)*, double (double)** %4
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %8
%15 = load double, double* %9
%16 = call i32 @brent_local_min(double (double)* %11, double %12, double %13, double %14, double %15, double* %7)
%17 = load double, double* %7
ret double %17
}

LLVM IR (-O2):
define double @fminbnd(double (double)* %0, double %1, double %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = tail call double (...) @macheps()
%7 = call i32 @brent_local_min(double (double)* %0, double %1, double %2, double 0x3D719799812DEA11, double %6, double* %4)
%8 = load double, double* %4
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  int anoAtual = 2017;
  int anoNascimento = 0;
  int idade = 22;
  anoNascimento = anoAtual - idade;
  printf("Ano de nascimento: %d\n", anoNascimento);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1040 <setlocale@plt>
movl   $0x7e1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x16,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
call   1040 <setlocale@plt>
lea    0xec3(%rip),%rdi
mov    $0x7cb,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [23 x i8] c"Ano de nascimento: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @LC_ALL
%6 = call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 2017, i32* %2
store i32 0, i32* %3
store i32 22, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [23 x i8] c"Ano de nascimento: %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 1995)
ret i32 0
}
/* Variables and functions */
unsigned int get_phys_address(int, unsigned short, unsigned short);
int /*<<< orphan*/ poke(unsigned int, unsigned short);
void store_raw(int bank, unsigned short as, unsigned short address,
               unsigned short value) {
  unsigned int phys_address = get_phys_address(bank, as, address);
  poke(phys_address, value);
}


x86 assembly (clang, -O0):
<store_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %edi,-0x4(%rbp)
mov    %dx,-0x6(%rbp)
mov    %cx,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x6(%rbp),%ax
movzwl %ax,%esi
movzwl -0x8(%rbp),%edx
call   1040 <get_phys_address@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
movzwl -0xa(%rbp),%esi
call   1030 <poke@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_raw>:
push   %rbx
mov    %ecx,%ebx
call   1040 <get_phys_address@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <poke@plt>

LLVM IR (-O0):
define void @store_raw(i32 %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i32
store i32 %0, i32* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = load i32, i32* %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = call i32 @get_phys_address(i32 %10, i16 zeroext %11, i16 zeroext %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = load i16, i16* %8
%16 = call i32 @poke(i32 %14, i16 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @store_raw(i32 %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @get_phys_address(i32 %0, i16 zeroext %1, i16 zeroext %2)
%6 = tail call i32 @poke(i32 %5, i16 zeroext %3)
ret void
}
unsigned thread_count(void) { return 128; }


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

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

LLVM IR (-O0):
define i32 @thread_count() {
ret i32 128
}

LLVM IR (-O2):
define i32 @thread_count() {
ret i32 128
}
int dup2(f1, f2) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copro_opc7_read_io(int /*<<< orphan*/);
uint32_t dbg_ioread(uint32_t addr) { return copro_opc7_read_io(addr); }


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

x86 assembly (clang, -O2):
<dbg_ioread>:
jmp    1030 <copro_opc7_read_io@plt>

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

LLVM IR (-O2):
define i32 @dbg_ioread(i32 %0) {
%2 = tail call i32 @copro_opc7_read_io(i32 %0)
ret i32 %2
}
/* Variables and functions */
int send_mouse_report(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int);
int send_shutdown(void) { return send_mouse_report(0, 0, 0, 01); }


x86 assembly (clang, -O0):
<send_shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <send_mouse_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_shutdown>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <send_mouse_report@plt>

LLVM IR (-O0):
define i32 @send_shutdown() {
%1 = call i32 @send_mouse_report(i32 0, i32 0, i32 0, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @send_shutdown() {
%1 = tail call i32 @send_mouse_report(i32 0, i32 0, i32 0, i32 1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ wbe32(int /*<<< orphan*/ *, int);
void wbe64(uint8_t *p, uint64_t v) {
  wbe32(p + 4, v & 0xffffffff);
  wbe32(p, (v >> 32) & 0xffffffff);
}


x86 assembly (clang, -O0):
<wbe64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
and    $0xffffffff,%esi
call   1030 <wbe32@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
and    $0xffffffff,%esi
call   1030 <wbe32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbe64>:
push   %rbx
mov    %rdi,%rbx
add    $0x10,%rdi
call   1030 <wbe32@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wbe32@plt>

LLVM IR (-O0):
define void @wbe64(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 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %4
%8 = and i32 %7, -1
%9 = call i32 @wbe32(i32* %6, i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = ashr i32 %11, 32
%13 = and i32 %12, -1
%14 = call i32 @wbe32(i32* %10, i32 %13)
ret void
}

LLVM IR (-O2):
define void @wbe64(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @wbe32(i32* %3, i32 %1)
%5 = tail call i32 @wbe32(i32* %0, i32 poison)
ret void
}
_Bool dt_valid_ymd(int y, int m, int d) {
  return ((m >= 1 && m <= 12) &&
          (d >= 1 && (d <= 28 || d <= dt_days_in_month(y, m))));
}


x86 assembly (clang, -O0):
<dt_valid_ymd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     1189 <dt_valid_ymd+0x79>
xor    %eax,%eax
cmpl   $0xc,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jg     1189 <dt_valid_ymd+0x79>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xe(%rbp)
jl     1183 <dt_valid_ymd+0x73>
mov    $0x1,%al
cmpl   $0x1c,-0xc(%rbp)
mov    %al,-0xf(%rbp)
jle    117d <dt_valid_ymd+0x6d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <dt_days_in_month@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
setle  %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_valid_ymd>:
push   %rbx
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0xb,%ecx
ja     1134 <dt_valid_ymd+0x24>
mov    %edx,%ebx
test   %edx,%edx
jle    1134 <dt_valid_ymd+0x24>
mov    $0x1,%al
cmp    $0x1d,%ebx
jb     1134 <dt_valid_ymd+0x24>
xor    %eax,%eax
call   1030 <dt_days_in_month@plt>
cmp    %ebx,%eax
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i1 @dt_valid_ymd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %28
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 12
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %6
%17 = icmp sle i32 %16, 28
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 (i32, i32, ...) bitcast (i32 (...)* @dt_days_in_month to i32 (i32, i32, ...)*)(i32 %20, i32 %21)
%23 = icmp sle i32 %19, %22
br label %24
24: ; preds = %18, %15
%25 = phi i1 [ true, %15 ], [ %23, %18 ]
br label %26
26: ; preds = %24, %12
%27 = phi i1 [ false, %12 ], [ %25, %24 ]
br label %28
28: ; preds = %26, %9, %3
%29 = phi i1 [ false, %9 ], [ false, %3 ], [ %27, %26 ]
ret i1 %29
}

LLVM IR (-O2):
define zeroext i1 @dt_valid_ymd(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, -1
%5 = icmp ult i32 %4, 12
%6 = icmp sgt i32 %2, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = icmp ult i32 %2, 29
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @dt_days_in_month to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%12 = icmp sge i32 %11, %2
br label %13
13: ; preds = %10, %8, %3
%14 = phi i1 [ false, %3 ], [ true, %8 ], [ %12, %10 ]
ret i1 %14
}
/* Variables and functions */
int num_factors(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1;
  int tri_num = 1;
  while (num_factors(tri_num) < 501) {
    ++i;
    tri_num = tri_num + i;
  }
  printf("%d\n", tri_num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <num_factors@plt>
cmp    $0x1f5,%eax
jge    1167 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x1,%edi
call   1040 <num_factors@plt>
cmp    $0x1f4,%eax
jg     1163 <main+0x43>
mov    $0x1,%ebx
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %ebp,%ebx
mov    %ebx,%edi
call   1040 <num_factors@plt>
add    $0x1,%ebp
cmp    $0x1f5,%eax
jl     1150 <main+0x30>
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @num_factors(i32 1)
%2 = icmp slt i32 %1, 501
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = phi i32 [ %6, %3 ], [ 1, %0 ]
%6 = add nuw nsw i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = tail call i32 @num_factors(i32 %7)
%9 = icmp slt i32 %8, 501
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = phi i32 [ 1, %0 ], [ %7, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
int iand_(int *a, int *b) { return *a & *b; }


x86 assembly (clang, -O0):
<iand_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
and    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iand_(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @iand_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = and i32 %4, %3
ret i32 %5
}
void XNoOp() {}


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

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

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

LLVM IR (-O2):
define void @XNoOp() {
ret void
}
/* Variables and functions */
scalar_t__ mstring_get_length(char *);
char *palloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *concat(char *s1, char *s2) {
  char *result = palloc(mstring_get_length(s1) + mstring_get_length(s2) + 1);
  strcpy(result, s1);
  strcat(result, s2);
  return result;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mstring_get_length@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mstring_get_length@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1040 <palloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1050 <mstring_get_length@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <mstring_get_length@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1040 <palloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @mstring_get_length(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @mstring_get_length(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @palloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1) {
%3 = tail call i64 @mstring_get_length(i8* %0)
%4 = tail call i64 @mstring_get_length(i8* %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @palloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
void ch_screen_refresh(void) {}


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

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

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

LLVM IR (-O2):
define void @ch_screen_refresh() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_mult() {
  gen_pop();
  gen_call("ccmul");
}


x86 assembly (clang, -O0):
<gen_mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccmul\00"
define i32 @gen_mult() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EnTab(char *, char *, int);
int GetLine(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char input[1024];
  char line[1024];
  int len;
  while ((len = GetLine(input, 1024)) > 0) {
    EnTab(input, line, 8);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
mov    %eax,-0x814(%rbp)
cmp    $0x0,%eax
jle    1192 <main+0x62>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x8,%edx
call   1050 <EnTab@plt>
lea    -0x810(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
test   %eax,%eax
jle    118c <main+0x5c>
mov    %rsp,%r14
lea    0x400(%rsp),%rbx
lea    0xea1(%rip),%r15
nop
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1050 <EnTab@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <GetLine@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @GetLine(i8* %3, i32 1024)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @EnTab(i8* %3, i8* %4, i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @GetLine(i8* %3, i32 1024)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mat4d_rotateQuatVec_new(double *, double *);
void mat4d_rotateQuat_new(double matrix[16], double x, double y, double z,
                          double w) {
  double quat[4] = {x, y, z, w};
  mat4d_rotateQuatVec_new(matrix, quat);
}


x86 assembly (clang, -O0):
<mat4d_rotateQuat_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <mat4d_rotateQuatVec_new@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_rotateQuat_new>:
sub    $0x28,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x18(%rsp)
mov    %rsp,%rsi
call   1030 <mat4d_rotateQuatVec_new@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @mat4d_rotateQuat_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [4 x double]
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%13 = load double, double* %7
store double %13, double* %12
%14 = getelementptr inbounds double, double* %12, i64 1
%15 = load double, double* %8
store double %15, double* %14
%16 = getelementptr inbounds double, double* %14, i64 1
%17 = load double, double* %9
store double %17, double* %16
%18 = getelementptr inbounds double, double* %16, i64 1
%19 = load double, double* %10
store double %19, double* %18
%20 = load double*, double** %6
%21 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%22 = call i32 @mat4d_rotateQuatVec_new(double* %20, double* %21)
ret void
}

LLVM IR (-O2):
define void @mat4d_rotateQuat_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [4 x double]
%7 = bitcast [4 x double]* %6 to i8*
%8 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
store double %1, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 1
store double %2, double* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 2
store double %3, double* %10
%11 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 3
store double %4, double* %11
%12 = call i32 @mat4d_rotateQuatVec_new(double* %0, double* %8)
ret void
}
int test_imm_61uint8_mem(unsigned char *val) {
  return ((*val) & (0x61 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_61uint8_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, 97
%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_61uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void XRootWindow() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, int const, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void dump_trace() {
  void *buffer[255];
  const int calls = backtrace(buffer, sizeof(buffer) / sizeof(void *));
  backtrace_symbols_fd(buffer, calls, 1);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<dump_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
lea    -0x800(%rbp),%rdi
mov    $0xff,%esi
call   1040 <backtrace@plt>
mov    %eax,-0x804(%rbp)
lea    -0x800(%rbp),%rdi
mov    -0x804(%rbp),%esi
mov    $0x1,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<dump_trace>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @dump_trace() {
%1 = alloca [255 x i8*]
%2 = alloca i32
%3 = getelementptr inbounds [255 x i8*], [255 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 255)
store i32 %4, i32* %2
%5 = getelementptr inbounds [255 x i8*], [255 x i8*]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @backtrace_symbols_fd(i8** %5, i32 %6, i32 1)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @dump_trace() {
%1 = alloca [255 x i8*]
%2 = bitcast [255 x i8*]* %1 to i8*
%3 = getelementptr inbounds [255 x i8*], [255 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 255)
%5 = call i32 @backtrace_symbols_fd(i8** %3, i32 %4, i32 1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}