xunge/DecIR huggingface dataset:
/* Variables and functions */
int allfact(int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("Factorial Sum from 1 to 20 is %d\n", allfact(20)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1040 <allfact@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Factorial Sum from 1 to 20 is %d\0A\00"
define i32 @main() {
%1 = call i32 @allfact(i32 20)
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Factorial Sum from 1 to 20 is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @allfact(i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int EuclideansAlgorithm(int value1, int value2) {
  if (value2 == 0) {
    return value1;
  }
  int remainder = value1 % value2;
  return EuclideansAlgorithm(value2, remainder);
}


x86 assembly (clang, -O0):
<EuclideansAlgorithm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <EuclideansAlgorithm+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <EuclideansAlgorithm+0x3b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <EuclideansAlgorithm@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EuclideansAlgorithm>:
mov    %edi,%eax
test   %esi,%esi
je     111d <EuclideansAlgorithm+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <EuclideansAlgorithm+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @EuclideansAlgorithm(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* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @EuclideansAlgorithm(i32 %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @EuclideansAlgorithm(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void badsig(int i) {
  (void)i;
  signal(SIGPIPE, SIG_IGN);
  exit(0);
}


x86 assembly (clang, -O0):
<badsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badsig>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @badsig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGPIPE
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @badsig(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = load i32, i32* @SIG_IGN
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int iso_init_locale(int flag) {
  setlocale(LC_CTYPE, "");
  return 1;
}


x86 assembly (clang, -O0):
<iso_init_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <setlocale@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_init_locale>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <setlocale@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @iso_init_locale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LC_CTYPE
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @iso_init_locale(i32 %0) {
%2 = load i32, i32* @LC_CTYPE
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *string_glob(char *);
int /*<<< orphan*/ strlen(char *);
char *variable_buffer_output(char *, char *, int /*<<< orphan*/);
char *func_wildcard(char *o, char **argv,
                    const char *funcname __attribute__((unused))) {
  char *p = string_glob(argv[0]);
  o = variable_buffer_output(o, p, strlen(p));
  return o;
}


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

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

LLVM IR (-O0):
define i8* @func_wildcard(i8* %0, i8** %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i8* @string_glob(i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %7
%14 = load i8*, i8** %7
%15 = call i32 @strlen(i8* %14)
%16 = call i8* @variable_buffer_output(i8* %12, i8* %13, i32 %15)
store i8* %16, i8** %4
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @func_wildcard(i8* %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i8* @string_glob(i8* %4)
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i8* @variable_buffer_output(i8* %0, i8* %5, i32 %6)
ret i8* %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SysCtlFlashSizeGet(void) {
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x00050000))) {
    return ((((*((volatile uint32_t *)(0x400FE008))) & 0x0000FFFF) << 11) +
            0x800);
  } else {
    return (2048 * (((*((volatile uint32_t *)(0x400FDFC0))) & 0x0000FFFF) + 1));
  }
}


x86 assembly (clang, -O0):
<SysCtlFlashSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x10050000,%eax
jne    1137 <SysCtlFlashSizeGet+0x37>
mov    $0x400fe008,%eax
mov    (%rax),%eax
and    $0xffff,%eax
shl    $0xb,%eax
add    $0x800,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <SysCtlFlashSizeGet+0x4c>
mov    $0x400fdfc0,%eax
mov    (%rax),%eax
and    $0xffff,%eax
add    $0x1,%eax
shl    $0xb,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlFlashSizeGet>:
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
cmp    $0x10050000,%eax
mov    $0x400fe008,%eax
mov    $0x400fdfc0,%ecx
cmove  %rax,%rcx
mov    (%rcx),%eax
movzwl %ax,%eax
shl    $0xb,%eax
add    $0x800,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlFlashSizeGet() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%3 = and i32 %2, 1895759872
%4 = icmp eq i32 %3, 268763136
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load volatile i32, i32* inttoptr (i64 1074782216 to i32*)
%7 = and i32 %6, 65535
%8 = shl i32 %7, 11
%9 = add nsw i32 %8, 2048
store i32 %9, i32* %1
br label %15
10: ; preds = %0
%11 = load volatile i32, i32* inttoptr (i64 1074782144 to i32*)
%12 = and i32 %11, 65535
%13 = add nsw i32 %12, 1
%14 = mul nsw i32 2048, %13
store i32 %14, i32* %1
br label %15
15: ; preds = %10, %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @SysCtlFlashSizeGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%2 = and i32 %1, 1895759872
%3 = icmp eq i32 %2, 268763136
%4 = select i1 %3, i32* inttoptr (i64 1074782216 to i32*), i32* inttoptr (i64 1074782144 to i32*)
%5 = load volatile i32, i32* %4
%6 = shl i32 %5, 11
%7 = and i32 %6, 134215680
%8 = add nuw nsw i32 %7, 2048
ret i32 %8
}
void writel(unsigned int addr, unsigned int v) {
  *((volatile unsigned int *)addr) = v;
}


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

x86 assembly (clang, -O2):
<writel>:
mov    %edi,%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @writel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
int sizeq(double f1, double f2) {
  double upperbnd, lowerbnd;
  upperbnd = f2 + (0.00002);
  lowerbnd = f2 - (0.00002);
  if ((f1 > upperbnd) || (f1 < lowerbnd))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<sizeq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     115a <sizeq+0x5a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1166 <sizeq+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <sizeq+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeq>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
setbe  %al
addsd  0xeed(%rip),%xmm1
ucomisd %xmm0,%xmm1
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sizeq(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %5
%9 = fadd double %8, 2.000000e-05
store double %9, double* %6
%10 = load double, double* %5
%11 = fsub double %10, 2.000000e-05
store double %11, double* %7
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fcmp ogt double %12, %13
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load double, double* %4
%17 = load double, double* %7
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %2
store i32 0, i32* %3
br label %21
20: ; preds = %15
store i32 1, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @sizeq(double %0, double %1) {
%3 = fadd double %1, 2.000000e-05
%4 = fcmp uge double %3, %0
%5 = fadd double %1, -2.000000e-05
%6 = fcmp ule double %5, %0
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ listen(int, int);
int os_set_listen(int fd, int backlog) { return (0 == listen(fd, backlog)); }


x86 assembly (clang, -O0):
<os_set_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @os_set_listen(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 i64 @listen(i32 %5, i32 %6)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @os_set_listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char getkey(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @getkey() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @getkey() {
ret i8 0
}
int SteamAPI_ISteamApps_GetDLCCount(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamApps_GetDLCCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamApps_GetDLCCount>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamApps_GetDLCCount = [32 x i8] c"SteamAPI_ISteamApps_GetDLCCount\00"
define i32 @SteamAPI_ISteamApps_GetDLCCount(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__func__.SteamAPI_ISteamApps_GetDLCCount, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamApps_GetDLCCount = [32 x i8] c"SteamAPI_ISteamApps_GetDLCCount\00"
define i32 @SteamAPI_ISteamApps_GetDLCCount(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @__func__.SteamAPI_ISteamApps_GetDLCCount, i64 0, i64 0), i8* %0)
ret i32 0
}
int tegra_pm_irq_set_wake_type(int irq, int flow_type) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tegra_pm_irq_set_wake_type(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 @tegra_pm_irq_set_wake_type(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (int i = 0; i < 10; i++) {
    printf("hi there OS class!!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"hi there OS class!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned long int SHR(unsigned long int x, unsigned long int n) {
  return ((x & 0xFFFFFFFF) >> n);
}


x86 assembly (clang, -O0):
<SHR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHR>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @SHR(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, 4294967295
%7 = load i64, i64* %4
%8 = lshr i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @SHR(i64 %0, i64 %1) {
%3 = and i64 %0, 4294967295
%4 = lshr i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void reset_signals_state(void) {
  signal(SIGINT, SIG_DFL);
  signal(SIGQUIT, SIG_DFL);
  signal(SIGTERM, SIG_DFL);
}


x86 assembly (clang, -O0):
<reset_signals_state>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_signals_state>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGQUIT = global i32 0
@SIGTERM = global i32 0
define void @reset_signals_state() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGTERM
%8 = load i32, i32* @SIG_DFL
%9 = call i32 @signal(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGQUIT = global i32 0
@SIGTERM = global i32 0
define void @reset_signals_state() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGQUIT
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGTERM
%8 = load i32, i32* @SIG_DFL
%9 = tail call i32 @signal(i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_and_send(int, char *);
void get_bound_sockets(int clientfd) {
  exec_and_send(clientfd, "netstat -lntp");
}


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

x86 assembly (clang, -O2):
<get_bound_sockets>:
lea    0xee9(%rip),%rsi
jmp    1030 <exec_and_send@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"netstat -lntp\00"
define void @get_bound_sockets(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exec_and_send(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"netstat -lntp\00"
define void @get_bound_sockets(i32 %0) {
%2 = tail call i32 @exec_and_send(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int int_twice(int line, int value) { return 2 * value; }


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

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

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

LLVM IR (-O2):
define i32 @int_twice(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
ret i32 %3
}
int crunch_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @crunch_init() {
ret i32 0
}
char *createStr() {
  char *str = "yangchen lalalalala";
  return str;
}


x86 assembly (clang, -O0):
<createStr>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"yangchen lalalalala\00"
define i8* @createStr() {
%1 = alloca i8*
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [20 x i8] c"yangchen lalalalala\00"
define i8* @createStr() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
void print_stats(int thread_num, struct Position const *const pos) {}


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

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

LLVM IR (-O0):
%struct.Position = type opaque
define void @print_stats(i32 %0, %struct.Position* %1) {
%3 = alloca i32
%4 = alloca %struct.Position*
store i32 %0, i32* %3
store %struct.Position* %1, %struct.Position** %4
ret void
}

LLVM IR (-O2):
%struct.Position = type opaque
define void @print_stats(i32 %0, %struct.Position* nocapture %1) {
ret void
}
int main() {
  int a = 0;
  switch (0) {
  case 0:
    a += 1;
  case 1:
    a += 2;
  default:
    a += 3;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *lastNameFromPath(const char *path) {
  const char *name = path;
  if (strrchr(name, '/'))
    name = strrchr(name, '/') + 1;
  if (strrchr(name, '\\'))
    name = strrchr(name, '\\') + 1;
  return name;
}


x86 assembly (clang, -O0):
<lastNameFromPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
cmp    $0x0,%rax
je     1152 <lastNameFromPath+0x42>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
cmp    $0x0,%rax
je     1180 <lastNameFromPath+0x70>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastNameFromPath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @lastNameFromPath(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %5, i8 signext 92)
%7 = icmp eq i8* %6, null
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = select i1 %7, i8* %5, i8* %8
ret i8* %9
}
/* Variables and functions */
int EBADF;
int /*<<< orphan*/ close(int);
int errno;
void __auto_close__(int *fd) {
  if (*fd >= 0) {
    int _e_ = errno;
    close(*fd);
    errno = _e_;
    *fd = -EBADF;
  };
}


x86 assembly (clang, -O0):
<__auto_close__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     115d <__auto_close__+0x4d>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
xor    %ecx,%ecx
mov    0x2e83(%rip),%rax
sub    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__auto_close__>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
js     113c <__auto_close__+0x2c>
mov    0x2ebc(%rip),%r14
mov    (%r14),%ebp
call   1030 <close@plt>
mov    %ebp,(%r14)
mov    0x2ea2(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    %ecx,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
@EBADF = global i32 0
define void @__auto_close__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @close(i32 %2)
store i32 %5, i32* @errno
%7 = load i32, i32* @EBADF
%8 = sub nsw i32 0, %7
store i32 %8, i32* %0
br label %9
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ direct_declarator_arr_fn();
int /*<<< orphan*/ direct_declarator_simple();
void direct_declarator() {
  direct_declarator_simple();
  direct_declarator_arr_fn();
}


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

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

LLVM IR (-O0):
define void @direct_declarator() {
%1 = call i32 (...) @direct_declarator_simple()
%2 = call i32 (...) @direct_declarator_arr_fn()
ret void
}

LLVM IR (-O2):
define void @direct_declarator() {
%1 = tail call i32 (...) @direct_declarator_simple()
%2 = tail call i32 (...) @direct_declarator_arr_fn()
ret void
}
/* Type definitions */
typedef long uint32_t;
struct itimer {
  int dummy;
};

/* Variables and functions */
long timer_interval_start(struct itimer *, long);
uint32_t timer_interval_start_minutes(struct itimer *t, uint32_t interval) {
  uint32_t elapsed = 0;
  interval *= 60L;
  interval *= 1000L;
  elapsed = timer_interval_start(t, interval);
  elapsed /= 1000L;
  elapsed /= 60L;
  return elapsed;
}


x86 assembly (clang, -O0):
<timer_interval_start_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
imul   $0x3c,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <timer_interval_start@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_interval_start_minutes>:
push   %rax
imul   $0xea60,%rsi,%rsi
call   1030 <timer_interval_start@plt>
movabs $0x45e7b272f608770f,%rcx
b2 e7 45
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xe,%rdx
add    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.itimer = type { i32 }
define i64 @timer_interval_start_minutes(%struct.itimer* %0, i64 %1) {
%3 = alloca %struct.itimer*
%4 = alloca i64
%5 = alloca i64
store %struct.itimer* %0, %struct.itimer** %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %4
%7 = mul nsw i64 %6, 60
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = mul nsw i64 %8, 1000
store i64 %9, i64* %4
%10 = load %struct.itimer*, %struct.itimer** %3
%11 = load i64, i64* %4
%12 = call i64 @timer_interval_start(%struct.itimer* %10, i64 %11)
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = sdiv i64 %13, 1000
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = sdiv i64 %15, 60
store i64 %16, i64* %5
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
%struct.itimer = type { i32 }
define i64 @timer_interval_start_minutes(%struct.itimer* %0, i64 %1) {
%3 = mul i64 %1, 60000
%4 = tail call i64 @timer_interval_start(%struct.itimer* %0, i64 %3)
%5 = sdiv i64 %4, 60000
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *const, char *, char, char,
                           int const, int const);
void pbm_writepbminit(FILE *const fileP, int const cols, int const rows,
                      int const forceplain) {
  if (!forceplain) {
    fprintf(fileP, "%c%c\n%d %d\n", 'P', '4', cols, rows);
  } else
    fprintf(fileP, "%c%c\n%d %d\n", 'P', '1', cols, rows);
}


x86 assembly (clang, -O0):
<pbm_writepbminit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1156 <pbm_writepbminit+0x46>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xebe(%rip),%rsi
mov    $0x50,%edx
mov    $0x34,%ecx
call   1030 <fprintf@plt>
jmp    1178 <pbm_writepbminit+0x68>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe97(%rip),%rsi
mov    $0x50,%edx
mov    $0x31,%ecx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_writepbminit>:
mov    %edx,%r9d
mov    %esi,%r8d
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
lea    (%rax,%rax,2),%ecx
add    $0x31,%ecx
lea    0xed6(%rip),%rsi
mov    $0x50,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%c%c\0A%d %d\0A\00"
define void @pbm_writepbminit(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 80, i8 signext 52, i32 %13, i32 %14)
br label %21
16: ; preds = %4
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 80, i8 signext 49, i32 %18, i32 %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%c%c\0A%d %d\0A\00"
define void @pbm_writepbminit(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i8 52, i8 49
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext 80, i8 signext %6, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ XFlush(int /*<<< orphan*/);
int /*<<< orphan*/ XUndefineCursor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XtDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XtWindow(int /*<<< orphan*/);
void _DtHelpTurnOffNoEnter(Widget w) {
  XUndefineCursor(XtDisplay(w), XtWindow(w));
  XFlush(XtDisplay(w));
}


x86 assembly (clang, -O0):
<_DtHelpTurnOffNoEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <XtDisplay@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <XtWindow@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1050 <XUndefineCursor@plt>
mov    -0x4(%rbp),%edi
call   1040 <XtDisplay@plt>
mov    %eax,%edi
call   1060 <XFlush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtHelpTurnOffNoEnter>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <XtDisplay@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <XtWindow@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <XUndefineCursor@plt>
mov    %ebx,%edi
call   1040 <XtDisplay@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <XFlush@plt>

LLVM IR (-O0):
define void @_DtHelpTurnOffNoEnter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @XtDisplay(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @XtWindow(i32 %5)
%7 = call i32 @XUndefineCursor(i32 %4, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @XtDisplay(i32 %8)
%10 = call i32 @XFlush(i32 %9)
ret void
}

LLVM IR (-O2):
define void @_DtHelpTurnOffNoEnter(i32 %0) {
%2 = tail call i32 @XtDisplay(i32 %0)
%3 = tail call i32 @XtWindow(i32 %0)
%4 = tail call i32 @XUndefineCursor(i32 %2, i32 %3)
%5 = tail call i32 @XtDisplay(i32 %0)
%6 = tail call i32 @XFlush(i32 %5)
ret void
}
int do_170() { return 170; }


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

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

LLVM IR (-O0):
define i32 @do_170() {
ret i32 170
}

LLVM IR (-O2):
define i32 @do_170() {
ret i32 170
}
/* Type definitions */
struct stat32 {
  int dummy;
};

/* Variables and functions */
int __fstatat_time32(int, char const *, struct stat32 *, int);
int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf,
                 int flag) {
  return __fstatat_time32(fd, path, buf, flag);
}


x86 assembly (clang, -O0):
<__fxstatat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__fstatat_time32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fxstatat64>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <__fstatat_time32@plt>

LLVM IR (-O0):
%struct.stat32 = type { i32 }
define i32 @__fxstatat64(i32 %0, i32 %1, i8* %2, %struct.stat32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.stat32*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.stat32* %3, %struct.stat32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load %struct.stat32*, %struct.stat32** %9
%14 = load i32, i32* %10
%15 = call i32 @__fstatat_time32(i32 %11, i8* %12, %struct.stat32* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.stat32 = type { i32 }
define i32 @__fxstatat64(i32 %0, i32 %1, i8* %2, %struct.stat32* %3, i32 %4) {
%6 = tail call i32 @__fstatat_time32(i32 %1, i8* %2, %struct.stat32* %3, i32 %4)
ret i32 %6
}
void h19_insline(n) {
  { register i; };
}


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

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

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

LLVM IR (-O2):
define void @h19_insline(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ use(int *);
void test_different() {
  int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  use(a);
}


x86 assembly (clang, -O0):
<test_different>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1030 <use@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_different>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <use@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_different.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @test_different() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.test_different.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define void @test_different() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @use(i32* %3)
ret void
}
/* Variables and functions */
int getb();
void skipline(void) {
  for (;;)
    switch (getb()) {
    default:
      continue;
    case '\n':
    case (-1):
      return;
    }
}


x86 assembly (clang, -O0):
<skipline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <skipline+0xd>
xor    %eax,%eax
call   1030 <getb@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0xffffffff,%eax
je     114d <skipline+0x3d>
jmp    1137 <skipline+0x27>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
je     114d <skipline+0x3d>
jmp    1148 <skipline+0x38>
jmp    111d <skipline+0xd>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipline>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getb@plt>
cmp    $0xa,%eax
je     1131 <skipline+0x21>
cmp    $0xffffffff,%eax
jne    1120 <skipline+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @skipline() {
br label %1
1: ; preds = %3, %0
%2 = call i32 (...) @getb()
switch i32 %2, label %3 [
i32 10, label %4
i32 -1, label %4
]
3: ; preds = %1
br label %1
4: ; preds = %1, %1
ret void
}

LLVM IR (-O2):
define void @skipline() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getb()
switch i32 %2, label %1 [
i32 10, label %3
i32 -1, label %3
]
3: ; preds = %1, %1
ret void
}
int spi_register_board_info(struct spi_board_info const *info, unsigned n) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.spi_board_info = type opaque
define i32 @spi_register_board_info(%struct.spi_board_info* %0, i32 %1) {
%3 = alloca %struct.spi_board_info*
%4 = alloca i32
store %struct.spi_board_info* %0, %struct.spi_board_info** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.spi_board_info = type opaque
define i32 @spi_register_board_info(%struct.spi_board_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPSPositionSensorHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GPSPositionSensorLogging() { UAVObjLogging(GPSPositionSensorHandle()); }


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

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

LLVM IR (-O0):
define void @GPSPositionSensorLogging() {
%1 = call i32 (...) @GPSPositionSensorHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSPositionSensorLogging() {
%1 = tail call i32 (...) @GPSPositionSensorHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int my_weight = 169;
  int your_weight = 175;
  if (your_weight > my_weight)
    printf("You are heavier than me.\n");
  if (your_weight < my_weight)
    printf("I'm heavier than you.\n");
  if (your_weight == my_weight)
    printf("We are exactly the same weight.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa9,-0x8(%rbp)
movl   $0xaf,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1145 <main+0x35>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115d <main+0x4d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1175 <main+0x65>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"You are heavier than me.\0A\00"
@.str.1 = [23 x i8] c"I'm heavier than you.\0A\00"
@.str.2 = [33 x i8] c"We are exactly the same weight.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 169, i32* %2
store i32 175, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"You are heavier than me.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}