xunge/DecIR huggingface dataset:
/* Variables and functions */
int calcPostfix(char *);
char *infix2Postfix(char const *, size_t);
int /*<<< orphan*/ printf(char *, int);
size_t strlen(char const *);
int main_Postfix() {
  const char *infix = "(1+2)*4-2*6/2";
  size_t length = strlen(infix);
  char *postfix = infix2Postfix(infix, length + 1);
  int ret = calcPostfix(postfix);
  printf("Result is:%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main_Postfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1050 <infix2Postfix@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <calcPostfix@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_Postfix>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xe,%esi
call   1040 <infix2Postfix@plt>
mov    %rax,%rdi
call   1050 <calcPostfix@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"(1+2)*4-2*6/2\00"
@.str.1 = [14 x i8] c"Result is:%d\0A\00"
define i32 @main_Postfix() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = load i8*, i8** %1
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %2
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i8* @infix2Postfix(i8* %7, i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @calcPostfix(i8* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"(1+2)*4-2*6/2\00"
@.str.1 = [14 x i8] c"Result is:%d\0A\00"
define i32 @main_Postfix() {
%1 = tail call i8* @infix2Postfix(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 14)
%2 = tail call i32 @calcPostfix(i8* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(void) {
  printf("usage: %s <product> <band> [<sub-sampl>]\n", "epr_subset_test");
}


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

x86 assembly (clang, -O2):
<printUsage>:
lea    0xee9(%rip),%rdi
lea    0xf0c(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"usage: %s <product> <band> [<sub-sampl>]\0A\00"
@.str.1 = [16 x i8] c"epr_subset_test\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"usage: %s <product> <band> [<sub-sampl>]\0A\00"
@.str.1 = [16 x i8] c"epr_subset_test\00"
define void @printUsage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OAL_CREATE_SEMAPHORE();
int fc8300_i2c_init(void *handle, unsigned short param1,
                    unsigned short param2) {
  OAL_CREATE_SEMAPHORE();
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <OAL_CREATE_SEMAPHORE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fc8300_i2c_init(i8* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_i2c_init(i8* nocapture readnone %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 (...) @OAL_CREATE_SEMAPHORE()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcd44780_wait();
void lcd44780_command(unsigned char c) {
  *((volatile unsigned char *)0xbe020000) = c;
  lcd44780_wait();
}


x86 assembly (clang, -O0):
<lcd44780_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xbe020000,%eax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <lcd44780_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd44780_command>:
mov    $0xbe020000,%eax
mov    %dil,(%rax)
xor    %eax,%eax
jmp    1030 <lcd44780_wait@plt>

LLVM IR (-O0):
define void @lcd44780_command(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 3187802112 to i8*)
%4 = call i32 (...) @lcd44780_wait()
ret void
}

LLVM IR (-O2):
define void @lcd44780_command(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 3187802112 to i8*)
%2 = tail call i32 (...) @lcd44780_wait()
ret void
}
/* Variables and functions */
unsigned int get_uart_base_addr(unsigned int);
void write_uart(unsigned int reg_offs, unsigned int value,
                unsigned int uartid) {
  volatile unsigned int *reg_ptr =
      (unsigned int *)(get_uart_base_addr(uartid) | reg_offs);
  *reg_ptr = value;
}


x86 assembly (clang, -O0):
<write_uart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_uart_base_addr@plt>
or     -0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write_uart(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
%8 = load i32, i32* %6
%9 = call i32 @get_uart_base_addr(i32 %8)
%10 = load i32, i32* %4
%11 = or i32 %9, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %7
%14 = load i32, i32* %5
%15 = load i32*, i32** %7
store volatile i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @write_uart(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_uart_base_addr(i32 %2)
%5 = or i32 %4, %0
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *,
                  char const *);
char *get_task_log_dir(const char *log_dir, const char *job_id,
                       const char *attempt_id) {
  return concatenate("%s/userlogs/%s"
                     "/%s",
                     "task_log_dir", 3, log_dir, job_id, attempt_id);
}


x86 assembly (clang, -O0):
<get_task_log_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xec9(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x3,%edx
call   1030 <concatenate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_task_log_dir>:
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s/userlogs/%s/%s\00"
@.str.1 = [13 x i8] c"task_log_dir\00"
define i8* @get_task_log_dir(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @concatenate(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s/userlogs/%s/%s\00"
@.str.1 = [13 x i8] c"task_log_dir\00"
define i8* @get_task_log_dir(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @concatenate(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
struct tm {
  scalar_t__ tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ tm_normalize(struct tm *);
int tm_isdaylightsavingextrasummertime(struct tm date) {
  if (!date.tm_isdst)
    return 0;
  date.tm_isdst = 0;
  tm_normalize(&date);
  return (date.tm_isdst ? 0 : 1);
}


x86 assembly (clang, -O0):
<tm_isdaylightsavingextrasummertime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <tm_isdaylightsavingextrasummertime+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1159 <tm_isdaylightsavingextrasummertime+0x49>
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <tm_normalize@plt>
mov    -0x10(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_isdaylightsavingextrasummertime>:
test   %rdi,%rdi
je     1135 <tm_isdaylightsavingextrasummertime+0x25>
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <tm_normalize@plt>
xor    %eax,%eax
cmpq   $0x0,(%rsp)
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.tm = type { i64 }
define i32 @tm_isdaylightsavingextrasummertime(i64 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i64 %0, i64* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %17
9: ; preds = %1
%10 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i64 0, i64* %10
%11 = call i32 @tm_normalize(%struct.tm* %3)
%12 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%13 = load i64, i64* %12
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.tm = type { i64 }
define i32 @tm_isdaylightsavingextrasummertime(i64 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%4 = icmp eq i64 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %1
store i64 0, i64* %3
%6 = call i32 @tm_normalize(%struct.tm* %2)
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
char EOF;
int skip_spaces(char *, int /*<<< orphan*/);
int line_is_empty(char *line) {
  int i;
  i = skip_spaces(line, 0);
  return (line[i] == '\n' || line[i] == EOF);
}


x86 assembly (clang, -O0):
<line_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <skip_spaces@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0xd(%rbp)
je     1162 <line_is_empty+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    0x2e91(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_is_empty>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <skip_spaces@plt>
cltq
mov    (%rbx,%rax,1),%al
cmp    $0xa,%al
sete   %cl
mov    0x2ebc(%rip),%rdx
cmp    (%rdx),%al
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @line_is_empty(i8* %0) {
%2 = tail call i32 @skip_spaces(i8* %0, i32 0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %5, %7
%9 = select i1 %6, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int end_line(const char *line) {
  if (strcmp(line + 10, " _end\n") == 0) {
    return 1;
  } else if (strcmp(line + 18, " _end\n") == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<end_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1146 <end_line+0x36>
movl   $0x1,-0x4(%rbp)
jmp    117c <end_line+0x6c>
mov    -0x10(%rbp),%rdi
add    $0x12,%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1170 <end_line+0x60>
movl   $0x1,-0x4(%rbp)
jmp    117c <end_line+0x6c>
jmp    1175 <end_line+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_line>:
push   %rbx
mov    %rdi,%rbx
add    $0xa,%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1149 <end_line+0x39>
add    $0x12,%rbx
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" _end\0A\00"
define i32 @end_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 10
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 18
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %17
15: ; preds = %9
br label %16
16: ; preds = %15
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [7 x i8] c" _end\0A\00"
define i32 @end_line(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 10
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 18
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void kotlinclib_print_short(short message) { printf("%d", message); }


x86 assembly (clang, -O0):
<kotlinclib_print_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeda(%rip),%rdi
movswl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @kotlinclib_print_short(i16 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %0)
ret void
}
void ff_hevc_put_hevc_epel_v32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v32_8_sse4() {
ret void
}
int compar(const void *px, const void *py) {
  int x = *((int *)px);
  int y = *((int *)py);
  return x < y ? -1 : x > y ? 1 : 0;
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <compar+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <compar+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp sgt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = 0, i = 0;
  printf("%d\n", n);
  if (n != 0)
    (printf("DEBUG: "), printf("n is %d\n", n));
  (printf("DEBUG: "), printf("%d", i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1167 <main+0x57>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"DEBUG: \00"
@.str.2 = [9 x i8] c"n is %d\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"DEBUG: \00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ strcmp(char *, char *);
char *ws_create_accept_key(char *);
int8_t ws_validate_key(char *key, char *accept_in) {
  char *accept_key = ws_create_accept_key(key);
  int8_t r = strcmp(accept_key, accept_in) ? 0 : 1;
  free(accept_key);
  return r;
}


x86 assembly (clang, -O0):
<ws_validate_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ws_create_accept_key@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_validate_key>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
call   1040 <ws_create_accept_key@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ws_validate_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @ws_create_accept_key(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 1
store i32 %14, i32* %6
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
define i32 @ws_validate_key(i8* %0, i8* %1) {
%3 = tail call i8* @ws_create_accept_key(i8* %0)
%4 = tail call i64 @strcmp(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @free(i8* %3)
ret i32 %6
}
int test_imm_75uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x75 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_75uint64_highword_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, 32
%6 = and i64 %5, 117
%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_75uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 502511173632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *Tcl_SignalMsg(sig)
int sig;
{
  switch (sig) {}
  return "unknown signal";
}


x86 assembly (clang, -O0):
<Tcl_SignalMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"unknown signal\00"
define i8* @Tcl_SignalMsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"unknown signal\00"
define i8* @Tcl_SignalMsg(i32 %0) {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
void fp_force_evall(long double x) {
  volatile long double y;
  y = x;
  (void)y;
}


x86 assembly (clang, -O0):
<fp_force_evall>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstp   %st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_force_evall>:
fldt   0x8(%rsp)
fstpt  -0x18(%rsp)
fldt   -0x18(%rsp)
fstp   %st(0)
ret

LLVM IR (-O0):
define void @fp_force_evall(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
store volatile x86_fp80 %4, x86_fp80* %3
%5 = load volatile x86_fp80, x86_fp80* %3
ret void
}

LLVM IR (-O2):
define void @fp_force_evall(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = bitcast x86_fp80* %2 to i8*
store volatile x86_fp80 %0, x86_fp80* %2
%4 = load volatile x86_fp80, x86_fp80* %2
ret void
}
void ScaleRowDown2_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2_C() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRequest(void) {
  (*((volatile uint32_t *)(0x400FC010))) |= 0x00000002;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRequest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x400fc010,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRequest>:
orl    $0x2,0x400fc010
02
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRequest() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRequest() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = or i32 %1, 2
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ write_u32(char **, int /*<<< orphan*/);
void write_str(char **str, const char *v, uint32_t len) {
  write_u32(str, len);
  memcpy(*str, v, len);
  ;
  *str += len;
}


x86 assembly (clang, -O0):
<write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <write_u32@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_str>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
call   1040 <write_u32@plt>
mov    (%rbx),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @write_str(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %6
%9 = call i32 @write_u32(i8** %7, i32 %8)
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
%15 = load i32, i32* %6
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = sext i32 %15 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %16
ret void
}

LLVM IR (-O2):
define void @write_str(i8** %0, i8* %1, i32 %2) {
%4 = tail call i32 @write_u32(i8** %0, i32 %2)
%5 = load i8*, i8** %0
%6 = tail call i32 @memcpy(i8* %5, i8* %1, i32 %2)
%7 = load i8*, i8** %0
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %0
ret void
}
/* Variables and functions */
int strcmp(char const *, char *);
int test13b(const char *a1, const char *a2) {
  return strcmp(a1, "abcdefghijklm");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"abcdefghijklm\00"
define i32 @test13b(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [14 x i8] c"abcdefghijklm\00"
define i32 @test13b(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int lis3l02dq_probe_trigger(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @lis3l02dq_probe_trigger(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uid_t;
typedef scalar_t__ gid_t;

/* Variables and functions */
scalar_t__ getgid();
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  uid_t uid;
  gid_t gid;
  uid = getuid();
  gid = getgid();
  printf("The process is owned by uid: %d gid: %d\n", (int)uid, (int)gid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"The process is owned by uid: %d gid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i64 (...) @getuid()
store i64 %4, i64* %2
%5 = call i64 (...) @getgid()
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = trunc i64 %6 to i32
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"The process is owned by uid: %d gid: %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getuid()
%2 = tail call i64 (...) @getgid()
%3 = trunc i64 %1 to i32
%4 = trunc i64 %2 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_double_push_targets(int, int);
void b_double_push_targets_test(void **state) {
  assert_int_equal(
      0, b_double_push_targets(0x00E3140800000000ul, 0x000000E314080000ul));
  assert_int_equal(
      0x000000C000000000ul,
      b_double_push_targets(0x00E3140800000000ul, 0x0000C0E314080000ul));
}


x86 assembly (clang, -O0):
<b_double_push_targets_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x14080000,%esi
call   1040 <b_double_push_targets@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
xor    %edi,%edi
mov    $0x14080000,%esi
call   1040 <b_double_push_targets@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_double_push_targets_test>:
push   %rax
xor    %edi,%edi
mov    $0x14080000,%esi
call   1040 <b_double_push_targets@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1030 <assert_int_equal@plt>
xor    %edi,%edi
mov    $0x14080000,%esi
call   1040 <b_double_push_targets@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_double_push_targets_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_double_push_targets(i32 0, i32 336068608)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
%5 = call i32 @b_double_push_targets(i32 0, i32 336068608)
%6 = call i32 @assert_int_equal(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @b_double_push_targets_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_double_push_targets(i32 0, i32 336068608)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
%4 = tail call i32 @b_double_push_targets(i32 0, i32 336068608)
%5 = tail call i32 @assert_int_equal(i32 0, i32 %4)
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rol(uint32_t i, unsigned b) { return (i << b) | (i >> (32 - b)); }


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i, j;
  for (i = 0; i < 360; i++) {
    for (j = 0; j < 10000; j++) {
      printf("%d.%04d\n", i, j);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x168,-0x8(%rbp)
jge    117a <main+0x6a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1167 <main+0x57>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    1130 <main+0x20>
add    $0x1,%ebx
cmp    $0x168,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d.%04d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 360
br i1 %6, label %7, label %22
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %15, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d.%04d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 360
br i1 %10, label %11, label %1
11: ; preds = %8
ret i32 0
}
int do_337() { return 337; }


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

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

LLVM IR (-O0):
define i32 @do_337() {
ret i32 337
}

LLVM IR (-O2):
define i32 @do_337() {
ret i32 337
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t modbusWBE(uint8_t *p, uint16_t val) {
  *p = val >> 8;
  *(p + 1) = val & 0xff;
  return val;
}


x86 assembly (clang, -O0):
<modbusWBE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbusWBE>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %esi,%edx
sar    $0x8,%edx
mov    %edx,(%rdi)
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
define i32 @modbusWBE(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @modbusWBE(i32* nocapture writeonly %0, i32 returned %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret i32 %1
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add(struct list_head *, struct list_head *);
void list_insert_after(struct list_head *new, struct list_head *node) {
  list_add(new, node);
}


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

x86 assembly (clang, -O2):
<list_insert_after>:
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_insert_after(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_add(%struct.list_head* %5, %struct.list_head* %6)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_insert_after(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void *CRYPTO_remalloc(void *a, int num, const char *file, int line) {
  free(a);
  return malloc(num);
}


x86 assembly (clang, -O0):
<CRYPTO_remalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_remalloc>:
push   %rbx
mov    %esi,%ebx
call   1030 <free@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @CRYPTO_remalloc(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @free(i8* %9)
%11 = load i32, i32* %6
%12 = call i8* @malloc(i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @CRYPTO_remalloc(i8* nocapture %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @free(i8* %0)
%6 = tail call i8* @malloc(i32 %1)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ sysvsum(unsigned int *, void *, size_t);
void big_file_checksum(unsigned int *sum, void *buf, size_t size) {
  sysvsum(sum, buf, size);
}


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

x86 assembly (clang, -O2):
<big_file_checksum>:
jmp    1030 <sysvsum@plt>

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

LLVM IR (-O2):
define void @big_file_checksum(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @sysvsum(i32* %0, i8* %1, i64 %2)
ret void
}
int test_imm_EDint64_highword_reg(long long val) {
  return ((val >> 32) & (0xED << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EDint64_highword_reg>:
movabs $0xed00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EDint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1017907249152
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void invoke_copy_to_stack() {}


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

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

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

LLVM IR (-O2):
define void @invoke_copy_to_stack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int pthread_self();
void echoMsg(int t) {
  printf("destructor excuted in thread %d,param=%d\n", pthread_self(), t);
}


x86 assembly (clang, -O0):
<echoMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoMsg>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"destructor excuted in thread %d,param=%d\0A\00"
define void @echoMsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"destructor excuted in thread %d,param=%d\0A\00"
define void @echoMsg(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ getid(int);
int /*<<< orphan*/ print(int /*<<< orphan*/);
int /*<<< orphan*/ printid(int);
void main() {
  int n;
  getid(n);
  printid(n);
  print(f(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <getid@plt>
mov    -0x4(%rbp),%edi
call   1060 <printid@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
call   1060 <printid@plt>
call   1030 <f@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @getid(i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @printid(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @f(i32 %6)
%8 = call i32 @print(i32 %7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(i32 undef)
%2 = tail call i32 @printid(i32 undef)
%3 = tail call i32 @f(i32 undef)
%4 = tail call i32 @print(i32 %3)
ret void
}