xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ const *, struct tm *);
int /*<<< orphan*/ strftime(char *, size_t, char const *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void util_get_date(char *datestr, size_t datestr_len, const char *format) {
  struct tm date;
  time_t t;
  time(&t);
  localtime_r((const time_t *)&t, &date);
  strftime(datestr, datestr_len, format, &date);
  datestr[datestr_len - 1] = 0;
}


x86 assembly (clang, -O0):
<util_get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
call   1040 <time@plt>
lea    -0x24(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_get_date>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xc(%rsp),%r12
mov    %r12,%rdi
call   1040 <time@plt>
lea    0x8(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <localtime_r@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r13,%rcx
call   1050 <strftime@plt>
movb   $0x0,-0x1(%r15,%rbx,1)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @util_get_date(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca %struct.tm
%8 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%9 = call i32 @time(i32* %8)
%10 = call i32 @localtime_r(i32* %8, %struct.tm* %7)
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = load i8*, i8** %6
%14 = call i32 @strftime(i8* %11, i64 %12, i8* %13, %struct.tm* %7)
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @util_get_date(i8* %0, i64 %1, i8* %2) {
%4 = alloca %struct.tm
%5 = alloca i32
%6 = bitcast %struct.tm* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @time(i32* %5)
%9 = call i32 @localtime_r(i32* %5, %struct.tm* %4)
%10 = call i32 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %4)
%11 = add i64 %1, -1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
ret void
}
int cpusupport_x86_aesni_detect(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @cpusupport_x86_aesni_detect() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @cpusupport_x86_aesni_detect() {
ret i32 -1
}
void cc_fflush_stdin() {}


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

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

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

LLVM IR (-O2):
define void @cc_fflush_stdin() {
ret void
}
int treeops_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @treeops_shutdown() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t pci_get_bus(uint32_t dev) { return (dev >> 16) & 0xff; }


x86 assembly (clang, -O0):
<pci_get_bus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_get_bus>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @pci_get_bus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @pci_get_bus(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
int function(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @function() {
ret i32 1
}

LLVM IR (-O2):
define i32 @function() {
ret i32 1
}
int isquote(char c) { return (c == '"' || c == '\''); }


x86 assembly (clang, -O0):
<isquote>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isquote+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x27,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isquote>:
cmp    $0x22,%dil
sete   %al
cmp    $0x27,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isquote(i8 signext %0) {
%2 = icmp eq i8 %0, 34
%3 = icmp eq i8 %0, 39
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned int MoveDoor(unsigned int);
unsigned int SetDoorState(unsigned int door_state) {
  return MoveDoor(door_state | (1 << 9));
}


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

x86 assembly (clang, -O2):
<SetDoorState>:
or     $0x200,%edi
jmp    1030 <MoveDoor@plt>

LLVM IR (-O0):
define i32 @SetDoorState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 512
%5 = call i32 @MoveDoor(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @SetDoorState(i32 %0) {
%2 = or i32 %0, 512
%3 = tail call i32 @MoveDoor(i32 %2)
ret i32 %3
}
void g_cclosure_new_object() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_new_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, short);
char *strdup(char *);
char *get_field_imm5(long instr) {
  char tmpstr[25];
  sprintf(tmpstr, "%d", (short)((instr & 0x0000001F) >> 0));
  return (strdup(tmpstr));
}


x86 assembly (clang, -O0):
<get_field_imm5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
sar    $0x0,%rax
lea    0xebd(%rip),%rsi
movswl %ax,%edx
call   1030 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_field_imm5>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rdx
and    $0x1f,%edx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @get_field_imm5(i64 %0) {
%2 = alloca i64
%3 = alloca [25 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = and i64 %5, 31
%7 = ashr i64 %6, 0
%8 = trunc i64 %7 to i16
%9 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %8)
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @get_field_imm5(i64 %0) {
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%4 = trunc i64 %0 to i16
%5 = and i16 %4, 31
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %5)
%7 = call i8* @strdup(i8* %3)
ret i8* %7
}
void Circle_dtor() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ posix_spawn(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void go(void) {
  pid_t pid;
  (void)posix_spawn(&pid, "/bin/ls", NULL, NULL, NULL, NULL);
  (void)waitpid(pid, NULL, 0);
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1040 <posix_spawn@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0x4(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <posix_spawn@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
define void @go() {
%1 = alloca i32
%2 = call i32 @posix_spawn(i32* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null, i32* null)
%3 = load i32, i32* %1
%4 = call i32 @waitpid(i32 %3, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
define void @go() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @posix_spawn(i32* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32* null, i32* null)
%4 = load i32, i32* %1
%5 = call i32 @waitpid(i32 %4, i32* null, i32 0)
ret void
}
int XGetWMColormapWindows() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetWMColormapWindows() {
ret i32 undef
}
void ff_hevc_put_hevc_uni_epel_hv6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv6_12_sse4() {
ret void
}
/* Variables and functions */
int arikkei_ucs2_utf8_bytelen(unsigned short const *);
int /*<<< orphan*/ arikkei_ucs2_utf8_strcpy(unsigned short const *,
                                            unsigned char *);
unsigned char *malloc(int);
unsigned char *arikkei_ucs2_utf8_strdup(const unsigned short *s) {
  unsigned char *d;
  int len;
  len = arikkei_ucs2_utf8_bytelen(s);
  d = malloc((len + 1) * sizeof(unsigned char));
  arikkei_ucs2_utf8_strcpy(s, d);
  return d;
}


x86 assembly (clang, -O0):
<arikkei_ucs2_utf8_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <arikkei_ucs2_utf8_bytelen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <arikkei_ucs2_utf8_strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_ucs2_utf8_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <arikkei_ucs2_utf8_bytelen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <arikkei_ucs2_utf8_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @arikkei_ucs2_utf8_strdup(i16* %0) {
%2 = alloca i16*
%3 = alloca i8*
%4 = alloca i32
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call i32 @arikkei_ucs2_utf8_bytelen(i16* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %3
%13 = load i16*, i16** %2
%14 = load i8*, i8** %3
%15 = call i32 @arikkei_ucs2_utf8_strcpy(i16* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @arikkei_ucs2_utf8_strdup(i16* %0) {
%2 = tail call i32 @arikkei_ucs2_utf8_bytelen(i16* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @arikkei_ucs2_utf8_strcpy(i16* %0, i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void change(int **x, int *z) {
  *x = z;
  printf("\n Change: %p \n", *x);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0A Change: %p \0A\00"
define void @change(i32** %0, i32* %1) {
%3 = alloca i32**
%4 = alloca i32*
store i32** %0, i32*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32**, i32*** %3
store i32* %5, i32** %6
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0A Change: %p \0A\00"
define void @change(i32** nocapture writeonly %0, i32* %1) {
store i32* %1, i32** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
char const *tcbdberrmsg(int);
const char *tcwdberrmsg(int ecode) { return tcbdberrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tcwdberrmsg>:
jmp    1030 <tcbdberrmsg@plt>

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

LLVM IR (-O2):
define i8* @tcwdberrmsg(i32 %0) {
%2 = tail call i8* @tcbdberrmsg(i32 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ _gettemp(char *, int *, int, int /*<<< orphan*/, int /*<<< orphan*/);
char *mkdtemp(char *path) {
  return (_gettemp(path, (int *)NULL, 1, 0, 0) ? path : (char *)NULL);
}


x86 assembly (clang, -O0):
<mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <_gettemp@plt>
cmp    $0x0,%rax
je     114b <mkdtemp+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <mkdtemp+0x46>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1156 <mkdtemp+0x46>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdtemp>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <_gettemp@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mkdtemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @_gettemp(i8* %3, i32* null, i32 1, i32 0, i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @mkdtemp(i8* %0) {
%2 = tail call i64 @_gettemp(i8* %0, i32* null, i32 1, i32 0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
/* Variables and functions */
scalar_t__ isspace(char);
unsigned int strlen(char *);
void trim(char *buffer) {
  unsigned n = strlen(buffer);
  while (n-- && isspace(buffer[n]))
    buffer[n] = 0;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     116b <trim+0x4b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    117b <trim+0x5b>
jmp    118b <trim+0x6b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
jmp    1138 <trim+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     115c <trim+0x3c>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl -0x1(%r14,%rbx,1),%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     115c <trim+0x3c>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0xffffffffffffffff,%rbx
jne    1140 <trim+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %3
%8 = add i32 %7, -1
store i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i64 @isspace(i8 signext %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %10, %6
%19 = phi i1 [ false, %6 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %6
25: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i64 @isspace(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %6
store i8 0, i8* %9
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %13, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int isnumchar(char c) {
  if (!isdigit(c) && c != '.')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isnumchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1149 <isnumchar+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     1149 <isnumchar+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isnumchar+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %eax,%eax
setne  %al
cmp    $0x2e,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isnumchar(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
%3 = icmp ne i32 %2, 0
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll16(struct __test_metadata *);
void wrapper_epoll16(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll16(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll16>:
jmp    1030 <epoll16@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll16(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll16(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll16(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll16(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
float tanhf(float);
void __hv_tanh_f(float bIn, float *bOut) { *bOut = tanhf(bIn); }


x86 assembly (clang, -O0):
<__hv_tanh_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanhf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_tanh_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <tanhf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_tanh_f(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = call float @tanhf(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @__hv_tanh_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @tanhf(float %0)
store float %3, float* %1
ret void
}
int __isxdigit_ascii(int ch) {
  return (unsigned int)(ch - '0') < 10u ||
         (unsigned int)((ch | 0x20) - 'a') < 6u;
}


x86 assembly (clang, -O0):
<__isxdigit_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
jb     112d <__isxdigit_ascii+0x2d>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x6,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isxdigit_ascii>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
or     $0x20,%edi
add    $0xffffff9f,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__isxdigit_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp ult i32 %4, 10
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
%9 = sub nsw i32 %8, 97
%10 = icmp ult i32 %9, 6
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @__isxdigit_ascii(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = or i32 %0, 32
%5 = add nsw i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = select i1 %3, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void early_init_irq_lock_class(void) {}


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

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

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

LLVM IR (-O2):
define void @early_init_irq_lock_class() {
ret void
}
/* Variables and functions */
void *util_nib_to_hex(int);
void util_byte_to_hex(char *dst, unsigned char b) {
  *(dst++) = util_nib_to_hex((int)((b >> 4) & 0x0f));
  *(dst++) = util_nib_to_hex((int)(b & 0x0f));
  *dst = 0;
}


x86 assembly (clang, -O0):
<util_byte_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
call   1030 <util_nib_to_hex@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movzbl -0x9(%rbp),%edi
and    $0xf,%edi
call   1030 <util_nib_to_hex@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_byte_to_hex>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
shr    $0x4,%edi
call   1030 <util_nib_to_hex@plt>
mov    %al,(%r14)
and    $0xf,%ebx
mov    %ebx,%edi
call   1030 <util_nib_to_hex@plt>
mov    %al,0x1(%r14)
movb   $0x0,0x2(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @util_byte_to_hex(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = call i8* @util_nib_to_hex(i32 %8)
%10 = ptrtoint i8* %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = and i32 %14, 15
%16 = call i8* @util_nib_to_hex(i32 %15)
%17 = ptrtoint i8* %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = load i8*, i8** %3
store i8 0, i8* %20
ret void
}

LLVM IR (-O2):
define void @util_byte_to_hex(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 4
%5 = tail call i8* @util_nib_to_hex(i32 %4)
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %0
%9 = and i32 %3, 15
%10 = tail call i8* @util_nib_to_hex(i32 %9)
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %12, i8* %8
store i8 0, i8* %13
ret void
}
/* Variables and functions */
int func5();
int func6() { return func5() + 1; }


x86 assembly (clang, -O0):
<func6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func5@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6>:
push   %rax
xor    %eax,%eax
call   1030 <func5@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func6() {
%1 = call i32 (...) @func5()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func6() {
%1 = tail call i32 (...) @func5()
%2 = add nsw i32 %1, 1
ret i32 %2
}
int test_imm_BCuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xBC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BCuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12320768
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int y;
  char bukva;
  do {
    scanf("%c", &bukva);
  } while (bukva < 'a' || bukva > 'z');
  y = 'a' + 'z' - bukva;
  printf("%c\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0xa(%rbp)
jl     115e <main+0x3e>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
setg   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
movsbl -0x9(%rbp),%ecx
mov    $0xdb,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x7b(%rax),%ecx
cmp    $0xe6,%cl
jb     1130 <main+0x10>
mov    $0xdb,%esi
sub    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -123
%6 = icmp ult i8 %5, -26
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = zext i8 %4 to i32
%9 = sub nuw nsw i32 219, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void floatshift(double *phi, unsigned long nvox, double dens) {
  unsigned i;
  for (i = 0; i < nvox; i++)
    *(phi + i) -= dens;
}


x86 assembly (clang, -O0):
<floatshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    114d <floatshift+0x4d>
movsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <floatshift+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatshift>:
test   %rsi,%rsi
je     1126 <floatshift+0x26>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%rdi,%rax,8),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi,%rax,8)
add    $0x1,%eax
cmp    %rsi,%rax
jb     1110 <floatshift+0x10>
ret

LLVM IR (-O0):
define void @floatshift(double* %0, i64 %1, double %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca double
%7 = alloca i32
store double* %0, double** %4
store i64 %1, i64* %5
store double %2, double* %6
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = zext i32 %9 to i64
%11 = load i64, i64* %5
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load double, double* %6
%15 = load double*, double** %4
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fsub double %19, %14
store double %20, double* %18
br label %21
21: ; preds = %13
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @floatshift(double* nocapture %0, i64 %1, double %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = load double, double* %7
%9 = fsub double %8, %2
store double %9, double* %7
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
size_t gu_page_size();
size_t gu_page_size_multiple(size_t const requested_size) {
  size_t const sys_page_size = gu_page_size();
  size_t const multiple = requested_size / sys_page_size;
  return sys_page_size * (0 == multiple ? 1 : multiple);
}


x86 assembly (clang, -O0):
<gu_page_size_multiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gu_page_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1159 <gu_page_size_multiple+0x49>
mov    $0x1,%eax
mov    %rax,-0x28(%rbp)
jmp    1161 <gu_page_size_multiple+0x51>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_page_size_multiple>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gu_page_size@plt>
mov    %rax,%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1134 <gu_page_size_multiple+0x24>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    113a <gu_page_size_multiple+0x2a>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
cmp    %rbx,%rcx
mov    $0x1,%edx
cmovbe %rax,%rdx
imul   %rcx,%rdx
mov    %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @gu_page_size_multiple(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = call i64 (...) @gu_page_size()
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = udiv i64 %6, %7
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp eq i64 0, %10
br i1 %11, label %12, label %13
12: ; preds = %1
br label %15
13: ; preds = %1
%14 = load i64, i64* %4
br label %15
15: ; preds = %13, %12
%16 = phi i64 [ 1, %12 ], [ %14, %13 ]
%17 = mul i64 %9, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @gu_page_size_multiple(i64 %0) {
%2 = tail call i64 (...) @gu_page_size()
%3 = udiv i64 %0, %2
%4 = icmp ugt i64 %2, %0
%5 = select i1 %4, i64 1, i64 %3
%6 = mul i64 %5, %2
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__22__IO__selectModuleFunc();
void HplMsp430Usart1P__UTXD__selectModuleFunc(void) {
  HplMsp430GeneralIOP__22__IO__selectModuleFunc();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart1P__UTXD__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__22__IO__selectModuleFunc()
ret void
}
/* Variables and functions */
scalar_t__ handle_open_failure();
int socket(int, int, int);
int my_socket(int domain, int type, int protocol) {
  int fd;
  do {
    fd = socket(domain, type, protocol);
  } while (fd < 0 && handle_open_failure());
  return fd;
}


x86 assembly (clang, -O0):
<my_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jge    1162 <my_socket+0x42>
mov    $0x0,%al
call   1030 <handle_open_failure@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1131 <my_socket+0x11>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_socket>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    114f <my_socket+0x2f>
xor    %eax,%eax
call   1030 <handle_open_failure@plt>
test   %rax,%rax
jne    1130 <my_socket+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @socket(i32 %9, i32 %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i64 (...) @handle_open_failure()
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ false, %13 ], [ %18, %16 ]
br i1 %20, label %8, label %21
21: ; preds = %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @my_socket(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 (...) @handle_open_failure()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdout;
int input_int(char *prompt) {
  int a;
  printf("%s: ", prompt);
  fflush(stdout);
  scanf("%d", &a);
  return a;
}


x86 assembly (clang, -O0):
<input_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_int>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @input_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @input_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
const int int_fn2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @int_fn2() {
ret i32 0
}
int main() {
  int a;
  a = 21;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 21
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_height(void *_p, int _v) { ((XImage *)_p)->height = (int)_v; }


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

x86 assembly (clang, -O2):
<set_XImage_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int linear_product_root_count(int *r) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(112, r, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<linear_product_root_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x70,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_product_root_count>:
mov    %rdi,%rsi
mov    $0x70,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @linear_product_root_count(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 112, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @linear_product_root_count(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 112, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
struct expression const *expr_generic();
const struct expression *expr_struct_deref(const struct expression *struct_,
                                           const char *field_name) {
  return expr_generic();
}


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

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

LLVM IR (-O0):
%struct.expression = type { i32 }
define %struct.expression* @expr_struct_deref(%struct.expression* %0, i8* %1) {
%3 = alloca %struct.expression*
%4 = alloca i8*
store %struct.expression* %0, %struct.expression** %3
store i8* %1, i8** %4
%5 = call %struct.expression* (...) @expr_generic()
ret %struct.expression* %5
}

LLVM IR (-O2):
%struct.expression = type { i32 }
define %struct.expression* @expr_struct_deref(%struct.expression* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call %struct.expression* (...) @expr_generic()
ret %struct.expression* %3
}
int my_f(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @my_f(i32 returned %0) {
ret i32 %0
}
void CC_PalLogLevelSet(int setLevel) { ((void)setLevel); }


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

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

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

LLVM IR (-O2):
define void @CC_PalLogLevelSet(i32 %0) {
ret void
}