xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_DimmingService_SetLoadLevelTarget(void *);
int /*<<< orphan*/ printf(char *, unsigned char);
void DimmingService_SetLoadLevelTarget(void *upnptoken,
                                       unsigned char NewLoadLevelTarget) {
  printf("UPnP Invoke: DimmingService_SetLoadLevelTarget(%d);\r\n",
         NewLoadLevelTarget);
  UPnPResponse_DimmingService_SetLoadLevelTarget(upnptoken);
}


x86 assembly (clang, -O0):
<DimmingService_SetLoadLevelTarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0xec7(%rip),%rdi
movzbl -0x9(%rbp),%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UPnPResponse_DimmingService_SetLoadLevelTarget@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DimmingService_SetLoadLevelTarget>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UPnPResponse_DimmingService_SetLoadLevelTarget@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"UPnP Invoke: DimmingService_SetLoadLevelTarget(%d);\0D\0A\00"
define void @DimmingService_SetLoadLevelTarget(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_DimmingService_SetLoadLevelTarget(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"UPnP Invoke: DimmingService_SetLoadLevelTarget(%d);\0D\0A\00"
define void @DimmingService_SetLoadLevelTarget(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
%4 = tail call i32 @UPnPResponse_DimmingService_SetLoadLevelTarget(i8* %0)
ret void
}
char *chrcat(s, c)
register char *s, c;
{
  register char *org;
  org = s;
  {
    while (*(s))
      (s)++;
  };
  *s++ = c;
  *s = '\0';
  return (org);
}


x86 assembly (clang, -O0):
<chrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1134 <chrcat+0x34>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <chrcat+0x16>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <chrcat+0x10>
mov    %sil,-0x1(%rcx)
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @chrcat(i8* returned %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = trunc i32 %1 to i8
store i8 %9, i8* %4
store i8 0, i8* %7
ret i8* %0
}
void chrToStr(char aChar, char aStr[2]) {
  aStr[0] = aChar;
  aStr[1] = '\0';
}


x86 assembly (clang, -O0):
<chrToStr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrToStr>:
mov    %dil,(%rsi)
movb   $0x0,0x1(%rsi)
ret

LLVM IR (-O0):
define void @chrToStr(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @chrToStr(i8 signext %0, i8* nocapture writeonly %1) {
store i8 %0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %3
ret void
}
int test_imm_48int16_mem(short *val) {
  return ((*val) & (-0x48 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_48int16_mem>:
movzwl (%rdi),%eax
test   $0xffb8,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -72
%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_48int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -72
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int compared2(long const *, long const *);
int __ledf2(double a, double b) {
  return compared2(((const long *)&a), ((const long *)&b));
}


x86 assembly (clang, -O0):
<__ledf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <compared2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ledf2>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <compared2@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @__ledf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i64*
%6 = bitcast double* %4 to i64*
%7 = call i32 @compared2(i64* %5, i64* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__ledf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i64*
%6 = bitcast double* %4 to i64*
%7 = call i32 @compared2(i64* %5, i64* %6)
ret i32 %7
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_resolve_detach_event(void *resolve) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_detach_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_detach_event>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_resolve_detach_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_resolve_detach_event(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int0(void) { print("!! Divide by 0\n "); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"!! Divide by 0\0A \00"
define void @idt_int0() {
%1 = call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"!! Divide by 0\0A \00"
define void @idt_int0() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTSTP;
int getpid();
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ vttidy();
bktoshell() {
  int pid;
  vttidy();
  pid = getpid();
  kill(pid, SIGTSTP);
}


x86 assembly (clang, -O0):
<bktoshell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <vttidy@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bktoshell>:
push   %rax
xor    %eax,%eax
call   1050 <vttidy@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2ea2(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGTSTP = global i32 0
define i32 @bktoshell() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @vttidy()
%4 = call i32 (...) @getpid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @SIGTSTP
%7 = call i32 @kill(i32 %5, i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@SIGTSTP = global i32 0
define i32 @bktoshell() {
%1 = tail call i32 (...) @vttidy()
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGTSTP
%4 = tail call i32 @kill(i32 %2, i32 %3)
ret i32 undef
}
double dmax(double a, double b) {
  if (a > b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<dmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <dmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <dmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @dmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ tst_get_unused_pid_(void (*)());
pid_t tst_get_unused_pid(void (*cleanup_fn)(void)) {
  return tst_get_unused_pid_(cleanup_fn);
}


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

x86 assembly (clang, -O2):
<tst_get_unused_pid>:
jmp    1030 <tst_get_unused_pid_@plt>

LLVM IR (-O0):
define i32 @tst_get_unused_pid(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @tst_get_unused_pid_(void (...)* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @tst_get_unused_pid(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @tst_get_unused_pid_(void (...)* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprint_timestamp(int /*<<< orphan*/, char const *, int,
                                    char const *, int, char const *,
                                    char const *);
int /*<<< orphan*/ stderr;
void stderr_msg(const char *file, int line, const char *func, int priority,
                const char *message, const char *appendix) {
  fprint_timestamp(stderr, file, line, func, priority, message, appendix);
}


x86 assembly (clang, -O0):
<stderr_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <fprint_timestamp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr_msg>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eba(%rip),%rdi
mov    (%rdi),%edi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <fprint_timestamp@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
define void @stderr_msg(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = call i32 @fprint_timestamp(i32 %13, i8* %14, i32 %15, i8* %16, i32 %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @stderr_msg(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5) {
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprint_timestamp(i32 %7, i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int command_undefined(int argc, char *argv[]) {
  fprintf(stderr, "%s: Missing arguments.\n", argv[0]);
  fprintf(stdout, "Try '%s --help' for further information.\n", argv[0]);
}


x86 assembly (clang, -O0):
<command_undefined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_undefined>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xed9(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s: Missing arguments.\0A\00"
@stdout = global i32 0
@.str.1 = [42 x i8] c"Try '%s --help' for further information.\0A\00"
define i32 @command_undefined(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @stdout
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s: Missing arguments.\0A\00"
@stdout = global i32 0
@.str.1 = [42 x i8] c"Try '%s --help' for further information.\0A\00"
define i32 @command_undefined(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 undef
}
int cmp_ulong(unsigned long check, unsigned long baseline) {
  return (((((check)) <= ((baseline)))
               ? ((((check)) < ((baseline))) ? ((-1)) : ((0)))
               : ((1))));
}


x86 assembly (clang, -O0):
<cmp_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1137 <cmp_ulong+0x37>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovb  %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <cmp_ulong+0x44>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <cmp_ulong+0x44>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ulong>:
cmp    %rsi,%rdi
sbb    %ecx,%ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_ulong(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 = load i64, i64* %4
%7 = icmp ule i64 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %8
%16 = phi i32 [ %13, %8 ], [ 1, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @cmp_ulong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = icmp ult i64 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void InitCpuFlags() {}


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

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

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

LLVM IR (-O2):
define void @InitCpuFlags() {
ret void
}
/* Variables and functions */
int htoi(char);
int htoa(char c, char d) {
  int high = htoi(c) * 16;
  int low = htoi(d);
  return high + low;
}


x86 assembly (clang, -O0):
<htoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <htoi@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <htoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoa>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <htoi@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %ebx,%edi
call   1030 <htoi@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @htoa(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = call i32 @htoi(i8 signext %7)
%9 = mul nsw i32 %8, 16
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = call i32 @htoi(i8 signext %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @htoa(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @htoi(i8 signext %0)
%4 = shl nsw i32 %3, 4
%5 = tail call i32 @htoi(i8 signext %1)
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int reverse_range(int val, int min, int max) {
  assert(min <= val && val <= max);
  return max - (val - min);
}


x86 assembly (clang, -O0):
<reverse_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     113e <reverse_range+0x2e>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_range>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
sub    %edi,%ebp
setle  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @reverse_range(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 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = sub nsw i32 %18, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @reverse_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %1, %0
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = sub i32 %1, %0
%10 = add i32 %9, %2
ret i32 %10
}
/* Variables and functions */
char *ltrim(char *);
char *rtrim(char *);
char *trim(char *str) {
  char *ptr;
  ptr = rtrim(str);
  str = ltrim(ptr);
  return str;
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1030 <rtrim@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ltrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @rtrim(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @ltrim(i8* %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i8* @rtrim(i8* %0)
%3 = tail call i8* @ltrim(i8* %2)
ret i8* %3
}
int __attribute__((no, noclone)) validity(int lost, int born) {
  lost = data();
  e(0, 0.0);
  asm("breakhere_validity:");
  return born;
}


x86 assembly (clang, -O0):
<validity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <data@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <e@plt>

x86 assembly (clang, -O2):
<validity>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <data@plt>
xorps  %xmm0,%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1040 <e@plt>

LLVM IR (-O0):
define i32 @validity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @data()
store i32 %5, i32* %3
%6 = call i32 (i32, double, ...) bitcast (i32 (...)* @e to i32 (i32, double, ...)*)(i32 0, double 0.000000e+00)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
define i32 @validity(i32 %0, i32 returned %1) {
%3 = tail call i32 (...) @data()
%4 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @e to i32 (i32, double, ...)*)(i32 0, double 0.000000e+00)
tail call void asm sideeffect "breakhere_validity:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XRefreshKeyboardMapping() {
  printf("XRefreshKeyboardMapping called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"XRefreshKeyboardMapping called\00"
define i32 @XRefreshKeyboardMapping() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  float fahr = 0, celsius;
  while (fahr <= 300) {
    celsius = (5.0 / 9.0) * (fahr - 32.0);
    printf("%3.0f\t%6.1f\n", fahr, celsius);
    fahr = fahr + 20;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed1(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1190 <main+0x80>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movss  0xe83(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffec,%ebp
lea    0xef1(%rip),%rbx
nop
add    $0x14,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
addsd  0xec7(%rip),%xmm1
mulsd  0xec7(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
cmp    $0x119,%ebp
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%3.0f\09%6.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
br label %4
4: ; preds = %7, %0
%5 = load float, float* %2
%6 = fcmp ole float %5, 3.000000e+02
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fsub double %9, 3.200000e+01
%11 = fmul double 0x3FE1C71C71C71C72, %10
%12 = fptrunc double %11 to float
store float %12, float* %3
%13 = load float, float* %2
%14 = load float, float* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %13, float %14)
%16 = load float, float* %2
%17 = fadd float %16, 2.000000e+01
store float %17, float* %2
br label %4
18: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%3.0f\09%6.1f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = fadd double %4, -3.200000e+01
%6 = fmul double %5, 0x3FE1C71C71C71C72
%7 = fptrunc double %6 to float
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %3, float %7)
%9 = add nuw nsw i32 %2, 20
%10 = icmp ugt i32 %2, 280
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_xmalloc0() {
  printf("NOT IMPLEMENTED:"
         "pa_xmalloc0"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"NOT IMPLEMENTED:pa_xmalloc0\0A\00"
define i32 @pa_xmalloc0() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_xmalloc0\00"
define i32 @pa_xmalloc0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void __bitmap_intersects(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__bitmap_intersects>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bitmap_intersects>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__bitmap_intersects = [20 x i8] c"__bitmap_intersects\00"
define void @__bitmap_intersects() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.__bitmap_intersects, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__bitmap_intersects = [20 x i8] c"__bitmap_intersects\00"
define void @__bitmap_intersects() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.__bitmap_intersects, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n1 = 5, n2 = 6, n3;
  n3 = n1 & n2;
  printf("n1 & n2 = %d\n", n3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%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
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"n1 & n2 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 6, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"n1 & n2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcrtomb(char *, int /*<<< orphan*/, int /*<<< orphan*/ *);
int wctomb(char *s, wchar_t wc) { return wcrtomb(s, wc, NULL); }


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <wcrtomb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
xor    %edx,%edx
jmp    1030 <wcrtomb@plt>

LLVM IR (-O0):
define i32 @wctomb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @wcrtomb(i8* %5, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wctomb(i8* %0, i32 %1) {
%3 = tail call i32 @wcrtomb(i8* %0, i32 %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay1KTCYx(unsigned char);
void Delay10KTCYx(unsigned char unit) {
  int i;
  for (i = 0; i < 10; i++) {
    Delay1KTCYx(unit);
  }
}


x86 assembly (clang, -O0):
<Delay10KTCYx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <Delay10KTCYx+0x36>
movzbl -0x1(%rbp),%edi
call   1030 <Delay1KTCYx@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <Delay10KTCYx+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay10KTCYx>:
push   %rbx
mov    %edi,%ebx
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
call   1030 <Delay1KTCYx@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <Delay1KTCYx@plt>

LLVM IR (-O0):
define void @Delay10KTCYx(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i8, i8* %2
%9 = call i32 @Delay1KTCYx(i8 zeroext %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay10KTCYx(i8 zeroext %0) {
%2 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%3 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%4 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%5 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%6 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%7 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%8 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%9 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%10 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
%11 = tail call i32 @Delay1KTCYx(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fput16b(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ fput32b(int /*<<< orphan*/ *, int /*<<< orphan*/);
void tiff_write_entry(FILE *fp, uint16_t tag, uint16_t type, uint32_t nb_val,
                      uint32_t val) {
  fput16b(fp, tag);
  fput16b(fp, type);
  fput32b(fp, nb_val);
  fput32b(fp, val);
}


x86 assembly (clang, -O0):
<tiff_write_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <fput16b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <fput16b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <fput32b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <fput32b@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiff_write_entry>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rdi,%rbp
call   1040 <fput16b@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
call   1040 <fput16b@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
call   1030 <fput32b@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fput32b@plt>

LLVM IR (-O0):
define void @tiff_write_entry(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @fput16b(i32* %11, i32 %12)
%14 = load i32*, i32** %6
%15 = load i32, i32* %8
%16 = call i32 @fput16b(i32* %14, i32 %15)
%17 = load i32*, i32** %6
%18 = load i32, i32* %9
%19 = call i32 @fput32b(i32* %17, i32 %18)
%20 = load i32*, i32** %6
%21 = load i32, i32* %10
%22 = call i32 @fput32b(i32* %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @tiff_write_entry(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @fput16b(i32* %0, i32 %1)
%7 = tail call i32 @fput16b(i32* %0, i32 %2)
%8 = tail call i32 @fput32b(i32* %0, i32 %3)
%9 = tail call i32 @fput32b(i32* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strptime(char const *, char *, struct tm *);
time_t makeTs(const char *dateTxt) {
  struct tm t;
  t.tm_isdst = -1;
  strptime(dateTxt, "%Y-%m-%d %H:%M:%S", &t);
  return mktime(&t);
}


x86 assembly (clang, -O0):
<makeTs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <strptime@plt>
lea    -0x10(%rbp),%rdi
call   1030 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeTs>:
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffff,0x8(%rsp)
ff
lea    0xecc(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <strptime@plt>
mov    %rbx,%rdi
call   1030 <mktime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @makeTs(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
store i8* %0, i8** %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 -1, i32* %4
%5 = load i8*, i8** %2
%6 = call i32 @strptime(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%7 = call i32 @mktime(%struct.tm* %3)
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @makeTs(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i32 -1, i32* %4
%5 = call i32 @strptime(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = call i32 @mktime(%struct.tm* %2)
ret i32 %6
}
void writehint(void *p) { (void)p; }


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

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

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

LLVM IR (-O2):
define void @writehint(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void exit_usage(char *program) {
  fprintf(stderr,
          "usage: %s [-h <lines>] [-a] [-l] [-p <n>] [-w <n>] g3-file ...\n",
          program);
  exit(1);
}


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

x86 assembly (clang, -O2):
<exit_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s [-h <lines>] [-a] [-l] [-p <n>] [-w <n>] g3-file ...\0A\00"
define void @exit_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"usage: %s [-h <lines>] [-a] [-l] [-p <n>] [-w <n>] g3-file ...\0A\00"
define void @exit_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_tree_sortable_set_sort_column_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_sortable_set_sort_column_id() {
ret void
}
int test_imm_BCint64_lowword_mem(long long *val) {
  return ((*val) & (0xBC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BCint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 188
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void WaitForIpcAck(unsigned long int flag) {
  while (((*((volatile unsigned long *)(0x400FB700 + 0x000000010))) & flag) ==
         0) {
  }
  return;
}


x86 assembly (clang, -O0):
<WaitForIpcAck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fb710,%eax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
jne    1123 <WaitForIpcAck+0x23>
jmp    1108 <WaitForIpcAck+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitForIpcAck>:
mov    0x400fb710,%rax
40
and    %rdi,%rax
je     1100 <WaitForIpcAck>
ret

LLVM IR (-O0):
define void @WaitForIpcAck(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%5 = load i64, i64* %2
%6 = and i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @WaitForIpcAck(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1074771728 to i64*)
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
double newtons_2nd_law(double mass, double acceleration) {
  double force = 0.0;
  force = mass * acceleration;
  return force;
}


x86 assembly (clang, -O0):
<newtons_2nd_law>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<newtons_2nd_law>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @newtons_2nd_law(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @newtons_2nd_law(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int hydravm();
int hydra(int argc, char *argv[], void *code, long size) { return hydravm(); }


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

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

LLVM IR (-O0):
define i32 @hydra(i32 %0, i8** %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = call i32 (...) @hydravm()
ret i32 %9
}

LLVM IR (-O2):
define i32 @hydra(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = tail call i32 (...) @hydravm()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ co_active();
int /*<<< orphan*/ co_switch(int /*<<< orphan*/);
void test_initial(void) {
  int n;
  if (!co_active())
    assert(0);
  for (n = 1000; n--;)
    co_switch(co_active());
}


x86 assembly (clang, -O0):
<test_initial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <co_active@plt>
cmp    $0x0,%eax
jne    114f <test_initial+0x1f>
xor    %edi,%edi
call   1050 <assert@plt>
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     117d <test_initial+0x4d>
mov    $0x0,%al
call   1040 <co_active@plt>
mov    %eax,%edi
call   1030 <co_switch@plt>
jmp    1156 <test_initial+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_initial>:
push   %rbx
xor    %eax,%eax
call   1040 <co_active@plt>
test   %eax,%eax
jne    1143 <test_initial+0x13>
xor    %edi,%edi
call   1050 <assert@plt>
mov    $0xfffffc18,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <co_active@plt>
mov    %eax,%edi
call   1030 <co_switch@plt>
inc    %ebx
jne    1150 <test_initial+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_initial() {
%1 = alloca i32
%2 = call i32 (...) @co_active()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @assert(i32 0)
br label %6
6: ; preds = %4, %0
store i32 1000, i32* %1
br label %7
7: ; preds = %11, %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = call i32 (...) @co_active()
%13 = call i32 @co_switch(i32 %12)
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @test_initial() {
%1 = tail call i32 (...) @co_active()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @assert(i32 0)
br label %5
5: ; preds = %3, %0
br label %6
6: ; preds = %5, %6
%7 = phi i32 [ %8, %6 ], [ 1000, %5 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 (...) @co_active()
%10 = tail call i32 @co_switch(i32 %9)
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %6
12: ; preds = %6
ret void
}
int main() {
  int i = 0;
  if (i == 0) {
    i = 2;
  } else {
    i = 3;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1128 <main+0x28>
movl   $0x2,-0x8(%rbp)
jmp    112f <main+0x2f>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%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 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 2, i32* %2
br label %7
6: ; preds = %0
store i32 3, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int PAPI_thread_init(unsigned long (*)());
void papif_thread_init__(unsigned long int (*handle)(void), int *check) {
  *check = PAPI_thread_init(handle);
}


x86 assembly (clang, -O0):
<papif_thread_init__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PAPI_thread_init@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_thread_init__>:
push   %rbx
mov    %rsi,%rbx
call   1030 <PAPI_thread_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_thread_init__(i64 ()* %0, i32* %1) {
%3 = alloca i64 ()*
%4 = alloca i32*
store i64 ()* %0, i64 ()** %3
store i32* %1, i32** %4
%5 = load i64 ()*, i64 ()** %3
%6 = bitcast i64 ()* %5 to i64 (...)*
%7 = call i32 @PAPI_thread_init(i64 (...)* %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_thread_init__(i64 ()* %0, i32* nocapture writeonly %1) {
%3 = bitcast i64 ()* %0 to i64 (...)*
%4 = tail call i32 @PAPI_thread_init(i64 (...)* %3)
store i32 %4, i32* %1
ret void
}