xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void HeaderOUT(char *h) {
  fputs("\n@strong{", stdout);
  fputs(h, stdout);
  fputs("}@*", stdout);
}


x86 assembly (clang, -O0):
<HeaderOUT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeaderOUT>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%esi
lea    0xed8(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
lea    0xec8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0A@strong{\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"}@*\00"
define void @HeaderOUT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A@strong{\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"}@*\00"
define void @HeaderOUT(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* %0, i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ IsLedOutOfBounds(int);
int /*<<< orphan*/ setLedImageBit(int);
int /*<<< orphan*/ updateHardware();
void LedDriver_TurnOn(int ledNumber) {
  if (IsLedOutOfBounds(ledNumber))
    return;
  setLedImageBit(ledNumber);
  updateHardware();
}


x86 assembly (clang, -O0):
<LedDriver_TurnOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IsLedOutOfBounds@plt>
cmp    $0x0,%rax
je     1152 <LedDriver_TurnOn+0x22>
jmp    1161 <LedDriver_TurnOn+0x31>
mov    -0x4(%rbp),%edi
call   1040 <setLedImageBit@plt>
mov    $0x0,%al
call   1050 <updateHardware@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedDriver_TurnOn>:
push   %rbx
mov    %edi,%ebx
call   1030 <IsLedOutOfBounds@plt>
test   %rax,%rax
je     113f <LedDriver_TurnOn+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <setLedImageBit@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <updateHardware@plt>

LLVM IR (-O0):
define void @LedDriver_TurnOn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @IsLedOutOfBounds(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @setLedImageBit(i32 %8)
%10 = call i32 (...) @updateHardware()
br label %11
11: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @LedDriver_TurnOn(i32 %0) {
%2 = tail call i64 @IsLedOutOfBounds(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @setLedImageBit(i32 %0)
%6 = tail call i32 (...) @updateHardware()
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int DataManager_GetIntValue(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *nan_compress() {
  char *tmp_set = (char *)malloc(40);
  strcpy(tmp_set, "[ ] Compress Backup (slow but saves space)");
  if (DataManager_GetIntValue("tw_use_compression") == 1) {
    tmp_set[1] = 'x';
  }
  return tmp_set;
}


x86 assembly (clang, -O0):
<nan_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xece(%rip),%rdi
call   1050 <DataManager_GetIntValue@plt>
cmp    $0x1,%eax
jne    1173 <nan_compress+0x43>
mov    -0x8(%rbp),%rax
movb   $0x78,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nan_compress>:
push   %rbx
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xed7(%rip),%rdi
call   1050 <DataManager_GetIntValue@plt>
cmp    $0x1,%eax
jne    1162 <nan_compress+0x32>
movb   $0x78,0x1(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"[ ] Compress Backup (slow but saves space)\00"
@.str.1 = [19 x i8] c"tw_use_compression\00"
define i8* @nan_compress() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 40)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @DataManager_GetIntValue(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 120, i8* %10
br label %11
11: ; preds = %8, %0
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"[ ] Compress Backup (slow but saves space)\00"
@.str.1 = [19 x i8] c"tw_use_compression\00"
define i8* @nan_compress() {
%1 = tail call i64 @malloc(i32 40)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @DataManager_GetIntValue(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = getelementptr inbounds i8, i8* %2, i64 1
store i8 120, i8* %7
br label %8
8: ; preds = %6, %0
ret i8* %2
}
void RTStrNLenEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrNLenEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printnums(int, char, int, char, double, char, int);
int main() { printnums(3, 'i', 12, 'd', 23.4, 'i', 12); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x69,%r8d
mov    $0xc,%r9d
mov    $0x64,%ecx
movsd  0xece(%rip),%xmm0
mov    %r8d,%esi
mov    %r9d,%edx
call   1030 <printnums@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
mov    $0x3,%edi
mov    $0x69,%esi
mov    $0xc,%edx
mov    $0x64,%ecx
mov    $0x69,%r8d
mov    $0xc,%r9d
call   1030 <printnums@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printnums(i32 3, i8 signext 105, i32 12, i8 signext 100, double 2.340000e+01, i8 signext 105, i32 12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printnums(i32 3, i8 signext 105, i32 12, i8 signext 100, double 2.340000e+01, i8 signext 105, i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void libamg_sip_flash_save_config(void) {
  system("if [ ! -d /mnt/config/asterisk ]; then "
         "mkdir /mnt/config/asterisk; fi");
  system("cp "
         "/etc/asterisk/"
         "sip.conf"
         " /mnt/config/asterisk");
}


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

x86 assembly (clang, -O2):
<libamg_sip_flash_save_config>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xf22(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"if [ ! -d /mnt/config/asterisk ]; then mkdir /mnt/config/asterisk; fi\00"
@.str.1 = [47 x i8] c"cp /etc/asterisk/sip.conf /mnt/config/asterisk\00"
define void @libamg_sip_flash_save_config() {
%1 = call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"if [ ! -d /mnt/config/asterisk ]; then mkdir /mnt/config/asterisk; fi\00"
@.str.1 = [47 x i8] c"cp /etc/asterisk/sip.conf /mnt/config/asterisk\00"
define void @libamg_sip_flash_save_config() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double ceill(double);
double ceil(double x) { return ceill(x); }


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

x86 assembly (clang, -O2):
<ceil>:
jmp    1030 <ceill@plt>

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

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call double @ceill(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int);
void cmatrix_memcpy(double *mdest, const double *morg, int rows, int cols) {
  memcpy(mdest, morg, rows * cols * sizeof(double));
}


x86 assembly (clang, -O0):
<cmatrix_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmatrix_memcpy>:
imul   %ecx,%edx
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @cmatrix_memcpy(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i32 @memcpy(double* %9, double* %10, i32 %16)
ret void
}

LLVM IR (-O2):
define void @cmatrix_memcpy(double* %0, double* %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 3
%6 = mul i32 %5, %3
%7 = tail call i32 @memcpy(double* %0, double* %1, i32 %6)
ret void
}
/* Type definitions */
struct confstate {
  int dummy;
};

/* Variables and functions */
char *confnextsection(struct confstate *);
int /*<<< orphan*/ confreset(struct confstate *);
scalar_t__ strcmp(char const *, char *);
void conffindsection(struct confstate *c, char *section) {
  const char *s;
  confreset(c);
  while ((s = confnextsection(c)) != NULL)
    if (strcmp(s, section) == 0)
      return;
}


x86 assembly (clang, -O0):
<conffindsection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <confreset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <confnextsection@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1181 <conffindsection+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117c <conffindsection+0x4c>
jmp    1181 <conffindsection+0x51>
jmp    1149 <conffindsection+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conffindsection>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <confreset@plt>
nop
mov    %rbx,%rdi
call   1030 <confnextsection@plt>
test   %rax,%rax
je     115d <conffindsection+0x2d>
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1140 <conffindsection+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.confstate = type { i32 }
define void @conffindsection(%struct.confstate* %0, i8* %1) {
%3 = alloca %struct.confstate*
%4 = alloca i8*
%5 = alloca i8*
store %struct.confstate* %0, %struct.confstate** %3
store i8* %1, i8** %4
%6 = load %struct.confstate*, %struct.confstate** %3
%7 = call i32 @confreset(%struct.confstate* %6)
br label %8
8: ; preds = %18, %2
%9 = load %struct.confstate*, %struct.confstate** %3
%10 = call i8* @confnextsection(%struct.confstate* %9)
store i8* %10, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
br label %19
18: ; preds = %12
br label %8
19: ; preds = %17, %8
ret void
}

LLVM IR (-O2):
%struct.confstate = type { i32 }
define void @conffindsection(%struct.confstate* %0, i8* %1) {
%3 = tail call i32 @confreset(%struct.confstate* %0)
br label %4
4: ; preds = %7, %2
%5 = tail call i8* @confnextsection(%struct.confstate* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %5, i8* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open_file(int);
void op_open() { open_file(1); }


x86 assembly (clang, -O0):
<op_open>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <open_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_open>:
mov    $0x1,%edi
jmp    1030 <open_file@plt>

LLVM IR (-O0):
define void @op_open() {
%1 = call i32 @open_file(i32 1)
ret void
}

LLVM IR (-O2):
define void @op_open() {
%1 = tail call i32 @open_file(i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xbutton_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xbutton.serial;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xbutton_serial>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XEvent_xbutton_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct smaps {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ smaps_free(struct smaps *);
void smaps_freep(struct smaps **maps) {
  if (*maps)
    smaps_free(*maps);
}


x86 assembly (clang, -O0):
<smaps_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <smaps_freep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <smaps_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaps_freep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <smaps_freep+0xd>
jmp    1030 <smaps_free@plt>
ret

LLVM IR (-O0):
%struct.smaps = type { i32 }
define void @smaps_freep(%struct.smaps** %0) {
%2 = alloca %struct.smaps**
store %struct.smaps** %0, %struct.smaps*** %2
%3 = load %struct.smaps**, %struct.smaps*** %2
%4 = load %struct.smaps*, %struct.smaps** %3
%5 = icmp ne %struct.smaps* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.smaps**, %struct.smaps*** %2
%8 = load %struct.smaps*, %struct.smaps** %7
%9 = call i32 @smaps_free(%struct.smaps* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.smaps = type { i32 }
define void @smaps_freep(%struct.smaps** nocapture %0) {
%2 = load %struct.smaps*, %struct.smaps** %0
%3 = icmp eq %struct.smaps* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @smaps_free(%struct.smaps* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quoteString(char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
void testQuoteString(void) {
  test(quoteString("abcde"), "\"abcde\"");
  test(quoteString("ab\t\"\5cd"), "\"ab\\t\\\"\\005cd\"");
}


x86 assembly (clang, -O0):
<testQuoteString>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <quoteString@plt>
mov    %eax,%edi
lea    0xecd(%rip),%rsi
call   1040 <test@plt>
lea    0xec9(%rip),%rdi
call   1030 <quoteString@plt>
mov    %eax,%edi
lea    0xec3(%rip),%rsi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testQuoteString>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <quoteString@plt>
lea    0xed2(%rip),%rsi
mov    %eax,%edi
call   1040 <test@plt>
lea    0xecc(%rip),%rdi
call   1030 <quoteString@plt>
lea    0xec8(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [8 x i8] c"\22abcde\22\00"
@.str.2 = [8 x i8] c"ab\09\22\05cd\00"
@.str.3 = [15 x i8] c"\22ab\\t\\\22\\005cd\22\00"
define void @testQuoteString() {
%1 = call i32 @quoteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @quoteString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [8 x i8] c"\22abcde\22\00"
@.str.2 = [8 x i8] c"ab\09\22\05cd\00"
@.str.3 = [15 x i8] c"\22ab\\t\\\22\\005cd\22\00"
define void @testQuoteString() {
%1 = tail call i32 @quoteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @quoteString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int f(int a, int b) {
  if (a < -3 || a > 13)
    __builtin_unreachable();
  if (b < -6 || b > 9)
    __builtin_unreachable();
  int c = a % b;
  return c >= -3 && c <= 8;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
jl     111e <f+0x1e>
cmpl   $0xd,-0x4(%rbp)
jle    111e <f+0x1e>
cmpl   $0xfffffffa,-0x8(%rbp)
jl     1132 <f+0x32>
cmpl   $0x9,-0x8(%rbp)
jle    1132 <f+0x32>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xfffffffd,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1155 <f+0x55>
cmpl   $0x8,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add i32 %0, 3
%4 = icmp ult i32 %3, 17
tail call void @llvm.assume(i1 %4)
%5 = add i32 %1, 6
%6 = icmp ult i32 %5, 16
tail call void @llvm.assume(i1 %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldm(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_mult_op();
void t16_ldm() { arm_memio_ldm(t16_memio_mult_op()); }


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

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

LLVM IR (-O0):
define void @t16_ldm() {
%1 = call i32 (...) @t16_memio_mult_op()
%2 = call i32 @arm_memio_ldm(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_ldm() {
%1 = tail call i32 (...) @t16_memio_mult_op()
%2 = tail call i32 @arm_memio_ldm(i32 %1)
ret void
}
double MMtoIN(double MM) { return MM / 25.4; }


x86 assembly (clang, -O0):
<MMtoIN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMtoIN>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MMtoIN(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.540000e+01
ret double %4
}

LLVM IR (-O2):
define double @MMtoIN(double %0) {
%2 = fdiv double %0, 2.540000e+01
ret double %2
}
int bwn_clamp_val(int val, int lo, int hi) {
  if (val < lo)
    return lo;
  if (val > hi)
    return hi;
  return val;
}


x86 assembly (clang, -O0):
<bwn_clamp_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <bwn_clamp_val+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <bwn_clamp_val+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <bwn_clamp_val+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <bwn_clamp_val+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwn_clamp_val>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bwn_clamp_val(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int data_print(char *data) {
  printf("| DATA:\t\t%s\n", data);
  return 1;
}


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

x86 assembly (clang, -O2):
<data_print>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"| DATA:\09\09%s\0A\00"
define i32 @data_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"| DATA:\09\09%s\0A\00"
define i32 @data_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ extractunique(int *, int);
int main() {
  int a[] = {1, 2, 3, 4, 4, 4, 5, 5, 8, 8, 8, 9, 10, 10};
  extractunique(a, 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xc,%esi
call   1040 <extractunique@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xc,%esi
call   1030 <extractunique@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [14 x i32] [i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 5, i32 5, i32 8, i32 8, i32 8, i32 9, i32 10, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i32]
store i32 0, i32* %1
%3 = bitcast [14 x i32]* %2 to i8*
%4 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%5 = call i32 @extractunique(i32* %4, i32 12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [14 x i32] [i32 1, i32 2, i32 3, i32 4, i32 4, i32 4, i32 5, i32 5, i32 8, i32 8, i32 8, i32 9, i32 10, i32 10]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @extractunique(i32* %3, i32 12)
ret i32 0
}
int isspace(int a) { return (a == 32 || a == 10) ? 1 : 0; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isspace+0x20>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
cmp    $0xa,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 10
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
size_t strlen(char *string) {
  uint32_t i = 0;
  while (string[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int kgsl_mmu_start(struct kgsl_device *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define i32 @kgsl_mmu_start(%struct.kgsl_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void redundant_call() {
  int i, z;
  char s[] = "Some meaningless chars array to call strlen.";
  for (i = 0, z = 0; i < strlen(s); i++)
    z++;
  return;
}


x86 assembly (clang, -O0):
<redundant_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
jge    117e <redundant_call+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <redundant_call+0x2b>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redundant_call>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movups 0xf00(%rip),%xmm0
movups %xmm0,0x1d(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0xffffffff,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%ebp
cmp    %eax,%ebp
jl     1150 <redundant_call+0x40>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.redundant_call.s = [45 x i8] c"Some meaningless chars array to call strlen.\00"
define void @redundant_call() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [45 x i8]
%4 = bitcast [45 x i8]* %3 to i8*
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = getelementptr inbounds [45 x i8], [45 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %10
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
@__const.redundant_call.s = [45 x i8] c"Some meaningless chars array to call strlen.\00"
define void @redundant_call() {
%1 = alloca [45 x i8]
%2 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = call i32 @strlen(i8* %2)
%6 = icmp slt i32 %4, %5
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret void
}
const char *ajRefseqinTypeGetQlinks(void) { return "|"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
define i8* @ajRefseqinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i8* @ajRefseqinTypeGetQlinks() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
void DiskPerfUnload(int DriverObject) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @DiskPerfUnload(i32 %0) {
ret void
}
/* Variables and functions */
int ap_set_string_set_int(int, int, char const *, int);
int ap_insert(int session, const char *path, int val) {
  return ap_set_string_set_int(session, 0xcc33, path, val);
}


x86 assembly (clang, -O0):
<ap_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xcc33,%esi
call   1030 <ap_set_string_set_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_insert>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xcc33,%esi
jmp    1030 <ap_set_string_set_int@plt>

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

LLVM IR (-O2):
define i32 @ap_insert(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ap_set_string_set_int(i32 %0, i32 52275, i8* %1, i32 %2)
ret i32 %4
}
long shell(string)
char *string[];
{
  char *pstr;
  for (pstr = *string; *pstr == ' '; pstr++) {
  }
  if (system(pstr) < 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114d <shell+0x3d>
jmp    113c <shell+0x2c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <shell+0x17>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
cmp    $0x0,%eax
jge    116e <shell+0x5e>
movq   $0x0,-0x8(%rbp)
jmp    1176 <shell+0x66>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %rax
mov    (%rdi),%rdi
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rdi)
lea    0x1(%rdi),%rdi
je     1120 <shell+0x10>
xor    %eax,%eax
call   1030 <system@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @shell(i8** %0) {
%2 = alloca i64
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
store i8* %6, i8** %4
br label %7
7: ; preds = %13, %1
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %16
12: ; preds = %7
br label %13
13: ; preds = %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
br label %7
16: ; preds = %7
%17 = load i8*, i8** %4
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %17)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i64 0, i64* %2
br label %22
21: ; preds = %16
store i64 1, i64* %2
br label %22
22: ; preds = %21, %20
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @shell(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %4)
%10 = xor i32 %9, -1
%11 = lshr i32 %10, 31
%12 = zext i32 %11 to i64
ret i64 %12
}
/* Variables and functions */
short rand();
signed short range_sshrt(signed short min, signed short max) {
  signed short val = rand();
  return val < min || max < val ? min : val;
}


x86 assembly (clang, -O0):
<range_sshrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jl     1151 <range_sshrt+0x41>
movswl -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    115d <range_sshrt+0x4d>
movswl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <range_sshrt+0x54>
movswl -0x6(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_sshrt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %bx,%ax
mov    %eax,%ecx
cmovg  %ebp,%ecx
cmp    %bp,%ax
cmovl  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @range_sshrt(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = call signext i16 (...) @rand()
store i16 %6, i16* %5
%7 = load i16, i16* %5
%8 = sext i16 %7 to i32
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp slt i32 %8, %10
br i1 %11, label %18, label %12
12: ; preds = %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = load i16, i16* %5
%16 = sext i16 %15 to i32
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %21
18: ; preds = %12, %2
%19 = load i16, i16* %3
%20 = sext i16 %19 to i32
br label %24
21: ; preds = %12
%22 = load i16, i16* %5
%23 = sext i16 %22 to i32
br label %24
24: ; preds = %21, %18
%25 = phi i32 [ %20, %18 ], [ %23, %21 ]
%26 = trunc i32 %25 to i16
ret i16 %26
}

LLVM IR (-O2):
define signext i16 @range_sshrt(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 (...) @rand()
%4 = icmp slt i16 %3, %0
%5 = icmp sgt i16 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i16 %0, i16 %3
ret i16 %7
}
OP(fd, d8) { op_d8(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d8()
ret i32 undef
}
void gdk_window_shape_combine_mask() {}


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

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

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

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

/* Variables and functions */
int __attribute__((weak)) pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) {
  (void)rwlock;
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i32 @pthread_rwlock_wrlock(i32* %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *my_malloc(size_t size) {
  void *ptr = malloc(size);
  assert(ptr != NULL);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = load i64, i64* %2
%12 = call i32 @memset(i8* %10, i32 0, i64 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cdflib_E0000(int /*<<< orphan*/, int *, double *, double *,
                                unsigned long *, unsigned long *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void cdflib_dinvr(int *status, double *x, double *fx, unsigned long *qleft,
                  unsigned long *qhi) {
  cdflib_E0000(0, status, x, fx, qleft, qhi, NULL, NULL, NULL, NULL, NULL, NULL,
               NULL);
}


x86 assembly (clang, -O0):
<cdflib_dinvr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %edi,%edi
xor    %eax,%eax
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x28(%rsp)
movq   $0x0,0x30(%rsp)
call   1030 <cdflib_E0000@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_dinvr>:
sub    $0x38,%rsp
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movups %xmm0,0x10(%rsp)
movups %xmm0,(%rsp)
movq   $0x0,0x30(%rsp)
xor    %edi,%edi
call   1030 <cdflib_E0000@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @cdflib_dinvr(i32* %0, double* %1, double* %2, i64* %3, i64* %4) {
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64*
%10 = alloca i64*
store i32* %0, i32** %6
store double* %1, double** %7
store double* %2, double** %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%11 = load i32*, i32** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i64*, i64** %9
%15 = load i64*, i64** %10
%16 = call i32 @cdflib_E0000(i32 0, i32* %11, double* %12, double* %13, i64* %14, i64* %15, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @cdflib_dinvr(i32* %0, double* %1, double* %2, i64* %3, i64* %4) {
%6 = tail call i32 @cdflib_E0000(i32 0, i32* %0, double* %1, double* %2, i64* %3, i64* %4, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void assign_paren_ok() {
  bool *b = (bool *)malloc(sizeof(bool));
  int x = 42, y = 33;
  if (b) {
    *b = true;
    *b = (x == y);
    if (*b) {
      int *p = 0;
      *p = 5;
    }
    free(b);
  }
}


x86 assembly (clang, -O0):
<assign_paren_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
movl   $0x21,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1195 <assign_paren_ok+0x75>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     118c <assign_paren_ok+0x6c>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_paren_ok>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <assign_paren_ok+0x1f>
movl   $0x0,(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @assign_paren_ok() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
store i32 42, i32* %2
store i32 33, i32* %3
%7 = load i32*, i32** %1
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %24
9: ; preds = %0
%10 = load i32*, i32** %1
store i32 1, i32* %10
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
%15 = load i32*, i32** %1
store i32 %14, i32* %15
%16 = load i32*, i32** %1
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %9
store i32* null, i32** %4
%20 = load i32*, i32** %4
store i32 5, i32* %20
br label %21
21: ; preds = %19, %9
%22 = load i32*, i32** %1
%23 = call i32 @free(i32* %22)
br label %24
24: ; preds = %21, %0
ret void
}

LLVM IR (-O2):
define void @assign_paren_ok() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %0
store i32 0, i32* %2
%5 = tail call i32 @free(i32* %2)
br label %6
6: ; preds = %4, %0
ret void
}
void ff_hevc_put_hevc_epel_v48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v48_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LoadCode();
int /*<<< orphan*/ MainLoop();
int main(int argc, char *argv[]) {
  LoadCode();
  MainLoop();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @LoadCode()
%4 = tail call i32 (...) @MainLoop()
ret i32 0
}