xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void g(int *a) { f(a); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @g(i32* %0) {
%2 = tail call i32 @f(i32* %0)
ret void
}
char *buildString(string)
char *string;
{
  char *result;
  result = (char *)myalloc(strlen(string) + 1);
  strcpy(result, string);
  return (result);
}


x86 assembly (clang, -O0):
<buildString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1040 <myalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildString>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1040 <myalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @buildString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @myalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @buildString(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @myalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  scalar_t__ sa_family;
};
typedef scalar_t__ sa_family_t;

/* Variables and functions */
scalar_t__ PF_INET;
scalar_t__ PF_INET6;
int SockAddrLen(struct sockaddr *sap) {
  sa_family_t fam = sap->sa_family;
  if (fam == PF_INET)
    return sizeof(struct sockaddr_in);
  if (fam == PF_INET6)
    return sizeof(struct sockaddr_in6);
  return 0;
}


x86 assembly (clang, -O0):
<SockAddrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
jne    1133 <SockAddrLen+0x33>
movl   $0x4,-0x4(%rbp)
jmp    115a <SockAddrLen+0x5a>
mov    -0x18(%rbp),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
jne    1153 <SockAddrLen+0x53>
movl   $0x4,-0x4(%rbp)
jmp    115a <SockAddrLen+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SockAddrLen>:
mov    (%rdi),%rax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2ed1(%rip),%rdx
cmp    (%rdx),%rax
sete   %al
or     %cl,%al
movzbl %al,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
@PF_INET = global i64 0
@PF_INET6 = global i64 0
define i32 @SockAddrLen(%struct.sockaddr* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr*
%4 = alloca i64
store %struct.sockaddr* %0, %struct.sockaddr** %3
%5 = load %struct.sockaddr*, %struct.sockaddr** %3
%6 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %5, i32 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = load i64, i64* @PF_INET
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 4, i32* %2
br label %18
12: ; preds = %1
%13 = load i64, i64* %4
%14 = load i64, i64* @PF_INET6
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 4, i32* %2
br label %18
17: ; preds = %12
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@PF_INET = global i64 0
@PF_INET6 = global i64 0
define i32 @SockAddrLen(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @PF_INET
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @PF_INET6
%7 = icmp eq i64 %3, %6
%8 = select i1 %5, i1 true, i1 %7
%9 = select i1 %8, i32 4, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ flyback();
int /*<<< orphan*/ hvflush();
int /*<<< orphan*/ move(double, double);
int /*<<< orphan*/ printf(char *, double);
double xsc(int);
void circle(double x, double y, double r) {
  move(x - r, y);
  hvflush();
  printf("\\D'c%.3fi'\n", xsc(2 * r));
  flyback();
}


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <hvflush@plt>
movsd  0xe76(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <xsc@plt>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <flyback@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
push   %rax
movsd  %xmm2,(%rsp)
subsd  %xmm2,%xmm0
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <hvflush@plt>
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <xsc@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <flyback@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\\D'c%.3fi'\0A\00"
define void @circle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double %7, %8
%10 = load double, double* %5
%11 = call i32 @move(double %9, double %10)
%12 = call i32 (...) @hvflush()
%13 = load double, double* %6
%14 = fmul double 2.000000e+00, %13
%15 = fptosi double %14 to i32
%16 = call double @xsc(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %16)
%18 = call i32 (...) @flyback()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\\D'c%.3fi'\0A\00"
define void @circle(double %0, double %1, double %2) {
%4 = fsub double %0, %2
%5 = tail call i32 @move(double %4, double %1)
%6 = tail call i32 (...) @hvflush()
%7 = fmul double %2, 2.000000e+00
%8 = fptosi double %7 to i32
%9 = tail call double @xsc(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %9)
%11 = tail call i32 (...) @flyback()
ret void
}
void sonix_setcolors(struct usb_spca50x *spca50x) {}


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

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

LLVM IR (-O0):
%struct.usb_spca50x = type opaque
define void @sonix_setcolors(%struct.usb_spca50x* %0) {
%2 = alloca %struct.usb_spca50x*
store %struct.usb_spca50x* %0, %struct.usb_spca50x** %2
ret void
}

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @sonix_setcolors(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char temp[20];
  printf("Please input integer: ");
  scanf("%s", temp);
  printf("Your input %d.\n", atoi(temp));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Please input integer: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [16 x i8] c"Your input %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @atoi(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Please input integer: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [16 x i8] c"Your input %d.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @atoi(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void av_sample_fmt_is_planar() {}


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

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

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

LLVM IR (-O2):
define void @av_sample_fmt_is_planar() {
ret void
}
/* Variables and functions */
int core7_safe(char const *);
int U_EMRLINETO_safe(const char *record) { return (core7_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRLINETO_safe>:
jmp    1030 <core7_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRLINETO_safe(i8* %0) {
%2 = tail call i32 @core7_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECATR(const char *the_title) { return any_decrqss(the_title, ",}"); }


x86 assembly (clang, -O0):
<rpt_DECATR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <any_decrqss@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c",}\00"
define i32 @rpt_DECATR(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_fixtoflt_d_int(double *, int);
double xil_fpo_fixtoflt_d_int(int a) {
  double res_d;
  xip_fpo_fixtoflt_d_int(&res_d, a);
  return res_d;
}


x86 assembly (clang, -O0):
<xil_fpo_fixtoflt_d_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1030 <xip_fpo_fixtoflt_d_int@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_fixtoflt_d_int>:
push   %rax
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <xip_fpo_fixtoflt_d_int@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xil_fpo_fixtoflt_d_int(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @xip_fpo_fixtoflt_d_int(double* %3, i32 %4)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @xil_fpo_fixtoflt_d_int(i32 %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_fixtoflt_d_int(double* %2, i32 %0)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x06() {
  Assert_real((isupper(6) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              35, ("isupper should be 0 for 0x06"));
}


x86 assembly (clang, -O0):
<t_isupper_0x06>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x23,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x06>:
push   %rax
mov    $0x6,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x23,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x06\00"
define void @t_isupper_0x06() {
%1 = call i64 @isupper(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x06\00"
define void @t_isupper_0x06() {
%1 = tail call i64 @isupper(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ checkgame();
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  while (checkgame()) {
    usleep(250);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <checkgame@plt>
cmp    $0x0,%rax
je     1156 <main+0x36>
mov    $0xfa,%edi
call   1040 <usleep@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <checkgame@plt>
test   %rax,%rax
je     1148 <main+0x28>
mov    $0xfa,%edi
call   1040 <usleep@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %9, %2
%7 = call i64 (...) @checkgame()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @usleep(i32 250)
br label %6
11: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @checkgame()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 @usleep(i32 250)
%7 = tail call i64 (...) @checkgame()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int fill_normal_config_req(unsigned char *, int, int, int,
                           int /*<<< orphan*/ *);
int fill_mac_req(unsigned char *buf) {
  return fill_normal_config_req(buf, 0x3, 0x1, 0x0, NULL);
}


x86 assembly (clang, -O0):
<fill_mac_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <fill_normal_config_req@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_mac_req>:
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <fill_normal_config_req@plt>

LLVM IR (-O0):
define i32 @fill_mac_req(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fill_normal_config_req(i8* %3, i32 3, i32 1, i32 0, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @fill_mac_req(i8* %0) {
%2 = tail call i32 @fill_normal_config_req(i8* %0, i32 3, i32 1, i32 0, i32* null)
ret i32 %2
}
adrx0adr1_set(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (((char *)10000000)[x0]) = (*((char *)11111111)); }


x86 assembly (clang, -O0):
<adrx0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%dl
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1_set>:
mov    0xa98ac7,%al
movslq %edx,%rcx
mov    %al,0x989680(%rcx)
ret

LLVM IR (-O0):
define i32 @adrx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 11111111 to i8*)
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %18
store i8 %16, i8* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adrx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 11111111 to i8*)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %8
store i8 %7, i8* %9
ret i32 undef
}
/* Variables and functions */
double genrand();
int random_bit() {
  if (genrand() > 0.5)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<random_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <genrand@plt>
movsd  0xed9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113d <random_bit+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <random_bit+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bit>:
push   %rax
xor    %eax,%eax
call   1030 <genrand@plt>
xor    %eax,%eax
ucomisd 0xede(%rip),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_bit() {
%1 = alloca i32
%2 = call double (...) @genrand()
%3 = fcmp ogt double %2, 5.000000e-01
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @random_bit() {
%1 = tail call double (...) @genrand()
%2 = fcmp ogt double %1, 5.000000e-01
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_B5int16_reg(short val) {
  return ((val) & (0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5int16_reg>:
test   $0xb5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B5int16_reg(i16 signext %0) {
%2 = and i16 %0, 181
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int three(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @three() {
ret i32 3
}

LLVM IR (-O2):
define i32 @three() {
ret i32 3
}
float factorial(n) {
  if (n == 0) {
    return 1;
  } else {
    return n * factorial(n - 1);
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1137 <factorial+0x27>
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <factorial+0x4d>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
test   %edi,%edi
je     112f <factorial+0x1f>
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
add    $0xffffffff,%edi
call   1030 <factorial@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @factorial(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call float @factorial(i32 %11)
%13 = fmul float %9, %12
store float %13, float* %2
br label %14
14: ; preds = %7, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @factorial(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi float [ %9, %5 ], [ 1.000000e+00, %1 ]
ret float %4
5: ; preds = %1
%6 = sitofp i32 %0 to float
%7 = add nsw i32 %0, -1
%8 = tail call float @factorial(i32 %7)
%9 = fmul float %8, %6
br label %3
}
void mat4_iscale(float m[4][4], float x, float y, float z) {
  mat4_scale(m, x, y, z, m);
}


x86 assembly (clang, -O0):
<mat4_iscale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rsi
mov    $0x3,%al
call   1030 <mat4_scale@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_iscale>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
mov    %rdi,%rsi
mov    $0x3,%al
jmp    1030 <mat4_scale@plt>

LLVM IR (-O0):
define void @mat4_iscale([4 x float]* %0, float %1, float %2, float %3) {
%5 = alloca [4 x float]*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store [4 x float]* %0, [4 x float]** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load [4 x float]*, [4 x float]** %5
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = load float, float* %8
%15 = fpext float %14 to double
%16 = load [4 x float]*, [4 x float]** %5
%17 = call i32 ([4 x float]*, double, double, double, [4 x float]*, ...) bitcast (i32 (...)* @mat4_scale to i32 ([4 x float]*, double, double, double, [4 x float]*, ...)*)([4 x float]* %9, double %11, double %13, double %15, [4 x float]* %16)
ret void
}

LLVM IR (-O2):
define void @mat4_iscale([4 x float]* %0, float %1, float %2, float %3) {
%5 = fpext float %1 to double
%6 = fpext float %2 to double
%7 = fpext float %3 to double
%8 = tail call i32 ([4 x float]*, double, double, double, [4 x float]*, ...) bitcast (i32 (...)* @mat4_scale to i32 ([4 x float]*, double, double, double, [4 x float]*, ...)*)([4 x float]* %0, double %5, double %6, double %7, [4 x float]* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: netcap\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"usage: netcap\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"usage: netcap\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void check(long long *a, long long *b, int N) {
  int i;
  for (i = 0; i < N; i++)
    if (a[i] != b[i])
      abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116e <check+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
je     115b <check+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1160 <check+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <check+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
test   %edx,%edx
jle    1133 <check+0x23>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%rdi,%rcx,8),%rdx
cmp    (%rsi,%rcx,8),%rdx
jne    1135 <check+0x25>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1120 <check+0x10>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i64* %0, i64* %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %30
12: ; preds = %8
%13 = load i64*, i64** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %13, i64 %15
%17 = load i64, i64* %16
%18 = load i64*, i64** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i64, i64* %18, i64 %20
%22 = load i64, i64* %21
%23 = icmp ne i64 %17, %22
br i1 %23, label %24, label %26
24: ; preds = %12
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @check(i64* nocapture %0, i64* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %19, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i64, i64* %0, i64 %10
%12 = load i64, i64* %11
%13 = getelementptr inbounds i64, i64* %1, i64 %10
%14 = load i64, i64* %13
%15 = icmp eq i64 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9
%18 = tail call i32 (...) @abort()
unreachable
19: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *cmd) {
  printf("Photorecover version %s\nUtility to recover erased Jpeg/Exif/Jfif "
         "files from a memory card\n\nUsage:\n\t%s [flash image | device "
         "file]\n\nReport bugs to iiska@iki.fi\n",
         "0.9.1", cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xf72(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xf7f(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"Photorecover version %s\0AUtility to recover erased Jpeg/Exif/Jfif files from a memory card\0A\0AUsage:\0A\09%s [flash image | device file]\0A\0AReport bugs to iiska@iki.fi\0A\00"
@.str.1 = [6 x i8] c"0.9.1\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"Photorecover version %s\0AUtility to recover erased Jpeg/Exif/Jfif files from a memory card\0A\0AUsage:\0A\09%s [flash image | device file]\0A\0AReport bugs to iiska@iki.fi\0A\00"
@.str.1 = [6 x i8] c"0.9.1\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int foo(int *a) { return *a + *a; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: cpuid <cpu (def=0)> <cmd (def=print)>\n");
  printf("Commands:\n");
  printf("\tprint         : read index from stdin and print results\n");
  printf("\tbrand_string  : Print processor brand string\n");
  printf("\tarch_perf     : Architectural Performance Model\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
call   1030 <puts@plt>
lea    0xf56(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: cpuid <cpu (def=0)> <cmd (def=print)>\0A\00"
@.str.1 = [11 x i8] c"Commands:\0A\00"
@.str.2 = [58 x i8] c"\09print : read index from stdin and print results\0A\00"
@.str.3 = [47 x i8] c"\09brand_string : Print processor brand string\0A\00"
@.str.4 = [50 x i8] c"\09arch_perf : Architectural Performance Model\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Usage: cpuid <cpu (def=0)> <cmd (def=print)>\00"
@str.5 = [10 x i8] c"Commands:\00"
@str.6 = [57 x i8] c"\09print : read index from stdin and print results\00"
@str.7 = [46 x i8] c"\09brand_string : Print processor brand string\00"
@str.8 = [49 x i8] c"\09arch_perf : Architectural Performance Model\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *__asctime(struct tm const *, char *);
char *asctime(const struct tm *tm) {
  static char buf[26];
  return __asctime(tm, buf);
}


x86 assembly (clang, -O0):
<asctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f19(%rip),%rsi
call   1030 <__asctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <__asctime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@asctime.buf = internal global [26 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i8* @__asctime(%struct.tm* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@asctime.buf = internal global [26 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = tail call i8* @__asctime(%struct.tm* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %2
}
void g3(void) { __typeof__(int(*)[f3()]) x; }


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f3@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g3() {
%1 = alloca i32*
%2 = call i32 (...) @f3()
%3 = zext i32 %2 to i64
ret void
}

LLVM IR (-O2):
define void @g3() {
%1 = tail call i32 (...) @f3()
ret void
}
int ne(int x) { return x != 0; }


x86 assembly (clang, -O0):
<ne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @ne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ne(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/ *);
int /*<<< orphan*/ g(int /*<<< orphan*/ *);
int /*<<< orphan*/ init(int /*<<< orphan*/ *);
int main() {
  uint8_t array[(1 << 12)];
  init(array);
  f(array);
  g(array);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x4000,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <init@plt>
mov    %rbx,%rdi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1050 <g@plt>
xor    %eax,%eax
add    $0x4000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%4 = call i32 @init(i32* %3)
%5 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%6 = call i32 @f(i32* %5)
%7 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
%8 = call i32 @g(i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4096 x i32]
%2 = bitcast [4096 x i32]* %1 to i8*
%3 = getelementptr inbounds [4096 x i32], [4096 x i32]* %1, i64 0, i64 0
%4 = call i32 @init(i32* %3)
%5 = call i32 @f(i32* %3)
%6 = call i32 @g(i32* %3)
ret i32 0
}
void INT_Excep_ICU_GROUP2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_GROUP2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
void Sys_mkdir(const char *path) { mkdir(path, 0777); }


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

x86 assembly (clang, -O2):
<Sys_mkdir>:
mov    $0x1ff,%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define void @Sys_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mkdir(i8* %3, i32 511)
ret void
}

LLVM IR (-O2):
define void @Sys_mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
ret void
}
int x17_process_synack(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x17_process_synack(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x17_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *, int *);
int /*<<< orphan*/ getlinee(char *, int);
int getnumber() {
  int num;
  char s[1000];
  getlinee(s, 1000);
  atoi(s, &num);
  return num;
}


x86 assembly (clang, -O0):
<getnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlinee@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <atoi@plt>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnumber>:
push   %rbx
sub    $0x400,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getlinee@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <atoi@plt>
mov    0xc(%rsp),%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getnumber() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @getlinee(i8* %3, i32 1000)
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @atoi(i8* %5, i32* %1)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @getnumber() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getlinee(i8* %4, i32 1000)
%6 = call i32 @atoi(i8* %4, i32* %1)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ get_string(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char string_1[100];
  char string_2[100];
  get_string(string_1, 100);
  get_string(string_2, 100);
  printf("%d\n", any(string_1, string_2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1030 <get_string@plt>
lea    -0xe0(%rbp),%rdi
mov    $0x64,%esi
call   1030 <get_string@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <any@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    $0x64,%esi
call   1030 <get_string@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <get_string@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <any@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_string(i8* %3, i32 100)
%6 = call i32 @get_string(i8* %4, i32 100)
%7 = call i32 @any(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ array_print(int *, size_t);
int *array_read(size_t *);
int array_sum(int *, size_t);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *array;
  size_t count;
  array = array_read(&count);
  array_print(array, count);
  printf("Sum is: %d\n", array_sum(array, count));
  free(array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
call   1050 <array_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <array_print@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <array_sum@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1050 <array_read@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1060 <array_print@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <array_sum@plt>
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Sum is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32* @array_read(i64* %3)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i64, i64* %3
%7 = call i32 @array_print(i32* %5, i64 %6)
%8 = load i32*, i32** %2
%9 = load i64, i64* %3
%10 = call i32 @array_sum(i32* %8, i64 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32*, i32** %2
%13 = call i32 @free(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Sum is: %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32* @array_read(i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @array_print(i32* %3, i64 %4)
%6 = load i64, i64* %1
%7 = call i32 @array_sum(i32* %3, i64 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @free(i32* %3)
ret i32 0
}
unsigned long insert_tbr(unsigned long insn, long value,
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  if (value == 0)
    value = (268);
  return insn | ((value & 0x1f) << 16) | ((value & 0x3e0) << 6);
}


x86 assembly (clang, -O0):
<insert_tbr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <insert_tbr+0x26>
movq   $0x10c,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0x3e0,%rcx
shl    $0x6,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_tbr>:
test   %rsi,%rsi
mov    $0x10c,%eax
cmovne %esi,%eax
mov    %eax,%ecx
and    $0x1f,%ecx
shl    $0x10,%rcx
or     %rdi,%rcx
shl    $0x6,%eax
and    $0xf800,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @insert_tbr(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
store i64 268, i64* %6
br label %12
12: ; preds = %11, %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = and i64 %14, 31
%16 = shl i64 %15, 16
%17 = or i64 %13, %16
%18 = load i64, i64* %6
%19 = and i64 %18, 992
%20 = shl i64 %19, 6
%21 = or i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
define i64 @insert_tbr(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = icmp eq i64 %1, 0
%6 = select i1 %5, i64 268, i64 %1
%7 = shl i64 %6, 16
%8 = and i64 %7, 2031616
%9 = or i64 %8, %0
%10 = shl i64 %6, 6
%11 = and i64 %10, 63488
%12 = or i64 %9, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signum) { printf("recv signal %d\n", signum); }


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

x86 assembly (clang, -O2):
<sig_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"recv signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"recv signal %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t select_uint8_t() { return 0 | (0 << 1); }


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

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

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

LLVM IR (-O2):
define i32 @select_uint8_t() {
ret i32 0
}