xunge/DecIR huggingface dataset:
int test_imm_A3uint16_mem(unsigned short *val) {
  return ((*val) & (0xA3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 163
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SYS_memfd_create;
int syscall(int /*<<< orphan*/, char const *, unsigned int);
int memfd_create(const char *name, unsigned int flags) {
  return syscall(SYS_memfd_create, name, flags);
}


x86 assembly (clang, -O0):
<memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_memfd_create = global i32 0
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_memfd_create
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @syscall(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_memfd_create = global i32 0
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = load i32, i32* @SYS_memfd_create
%4 = tail call i32 @syscall(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void log_init() { openlog("iyell", LOG_PID, LOG_USER); }


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0xed3(%rip),%rdi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"iyell\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @log_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"iyell\00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
define void @log_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_USER
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ finalize_tar(char *);
int get_file_modified(char *);
int get_file_size(char *);
int /*<<< orphan*/ p_write_tar_entry(char *, char *, int, int,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ write_checksum(char *, int /*<<< orphan*/);
int write_tar_entry(char *tarname, char *filename) {
  int size = get_file_size(filename);
  int modified = get_file_modified(filename);
  p_write_tar_entry(tarname, filename, size, modified, 0);
  write_checksum(tarname, 0);
  finalize_tar(tarname);
  return 0;
}


x86 assembly (clang, -O0):
<write_tar_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_file_size@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_file_modified@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1040 <p_write_tar_entry@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1060 <write_checksum@plt>
mov    -0x8(%rbp),%rdi
call   1070 <finalize_tar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tar_entry>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <get_file_size@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <get_file_modified@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %r8d,%r8d
call   1040 <p_write_tar_entry@plt>
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <write_checksum@plt>
mov    %r14,%rdi
call   1070 <finalize_tar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @write_tar_entry(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** %4
%8 = call i32 @get_file_size(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @get_file_modified(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @p_write_tar_entry(i8* %11, i8* %12, i32 %13, i32 %14, i32 0)
%16 = load i8*, i8** %3
%17 = call i32 @write_checksum(i8* %16, i32 0)
%18 = load i8*, i8** %3
%19 = call i32 @finalize_tar(i8* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @write_tar_entry(i8* %0, i8* %1) {
%3 = tail call i32 @get_file_size(i8* %1)
%4 = tail call i32 @get_file_modified(i8* %1)
%5 = tail call i32 @p_write_tar_entry(i8* %0, i8* %1, i32 %3, i32 %4, i32 0)
%6 = tail call i32 @write_checksum(i8* %0, i32 0)
%7 = tail call i32 @finalize_tar(i8* %0)
ret i32 0
}
int dictEncIntKeyCompare(const void *key1, const void *key2) {
  return key1 == key2;
}


x86 assembly (clang, -O0):
<dictEncIntKeyCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictEncIntKeyCompare>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @dictEncIntKeyCompare(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 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dictEncIntKeyCompare(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  int *t = (int *)0;
  *t = 23;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x17,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
store i32 23, i32* %3
ret i32 0
}

LLVM IR (-O2):
/* Type definitions */
struct LaneDetectorParserInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct LaneDetectorParserInfo *);
int /*<<< orphan*/ clear_given(struct LaneDetectorParserInfo *);
int /*<<< orphan*/ init_args_info(struct LaneDetectorParserInfo *);
void LaneDetectorParser_init(struct LaneDetectorParserInfo *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<LaneDetectorParser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LaneDetectorParser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.LaneDetectorParserInfo = type { i32 }
define void @LaneDetectorParser_init(%struct.LaneDetectorParserInfo* %0) {
%2 = alloca %struct.LaneDetectorParserInfo*
store %struct.LaneDetectorParserInfo* %0, %struct.LaneDetectorParserInfo** %2
%3 = load %struct.LaneDetectorParserInfo*, %struct.LaneDetectorParserInfo** %2
%4 = call i32 @clear_given(%struct.LaneDetectorParserInfo* %3)
%5 = load %struct.LaneDetectorParserInfo*, %struct.LaneDetectorParserInfo** %2
%6 = call i32 @clear_args(%struct.LaneDetectorParserInfo* %5)
%7 = load %struct.LaneDetectorParserInfo*, %struct.LaneDetectorParserInfo** %2
%8 = call i32 @init_args_info(%struct.LaneDetectorParserInfo* %7)
ret void
}

LLVM IR (-O2):
%struct.LaneDetectorParserInfo = type { i32 }
define void @LaneDetectorParser_init(%struct.LaneDetectorParserInfo* %0) {
%2 = tail call i32 @clear_given(%struct.LaneDetectorParserInfo* %0)
%3 = tail call i32 @clear_args(%struct.LaneDetectorParserInfo* %0)
%4 = tail call i32 @init_args_info(%struct.LaneDetectorParserInfo* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t cmnReadRegister32(volatile void *Register) {
  return *(volatile uint32_t *)Register;
}


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

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

LLVM IR (-O0):
define i32 @cmnReadRegister32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @cmnReadRegister32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
void roadmap_screen_after_refresh(void) {}


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

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

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

LLVM IR (-O2):
define void @roadmap_screen_after_refresh() {
ret void
}
long CDRgetTN(unsigned char *buffer) {
  buffer[0] = 1;
  buffer[1] = 1;
  return 0;
}


x86 assembly (clang, -O0):
<CDRgetTN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x1(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDRgetTN>:
movw   $0x101,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @CDRgetTN(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 1, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 1, i8* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRgetTN(i8* nocapture writeonly %0) {
store i8 1, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 1, i8* %2
ret i64 0
}
int system(const char *command) {
  (void)(command);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @system(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ libev_unregister_udp_unix_sock(int, void *);
void libev_unix_udp_deinit(void *ctx, int sock) {
  close(sock);
  libev_unregister_udp_unix_sock(sock, ctx);
}


x86 assembly (clang, -O0):
<libev_unix_udp_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <libev_unregister_udp_unix_sock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libev_unix_udp_deinit>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <close@plt>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <libev_unregister_udp_unix_sock@plt>

LLVM IR (-O0):
define void @libev_unix_udp_deinit(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 = call i32 @close(i32 %5)
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @libev_unregister_udp_unix_sock(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @libev_unix_udp_deinit(i8* %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
%4 = tail call i32 @libev_unregister_udp_unix_sock(i32 %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printCPUIdleInfo(const char *cmd) {
  (void)cmd;
  output("CPU Idle Load\t0\t100\t%%\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"CPU Idle Load\090\09100\09%%\0A\00"
define void @printCPUIdleInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"CPU Idle Load\090\09100\09%%\0A\00"
define void @printCPUIdleInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *str_duplicate(char *str) {
  char *duplicate = malloc(sizeof(str) + 1);
  if (duplicate == NULL) {
    return NULL;
  }
  strcpy(duplicate, str);
  return duplicate;
}


x86 assembly (clang, -O0):
<str_duplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1152 <str_duplicate+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1167 <str_duplicate+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_duplicate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1144 <str_duplicate+0x24>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_duplicate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = call i8* @malloc(i32 9)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %14
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
store i8* %13, i8** %2
br label %14
14: ; preds = %9, %8
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @str_duplicate(i8* %0) {
%2 = tail call dereferenceable_or_null(9) i8* @malloc(i32 9)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strcpy(i8* %2, i8* %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
const char *db_check_total_entity_report_sql(void) {
  static const char *query = "SELECT * FROM check_total"
                             "  WHERE Entity = %s";
  return query;
}


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

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

LLVM IR (-O0):
@db_check_total_entity_report_sql.query = internal global i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i32 0, i32 0)
@.str = [45 x i8] c"SELECT * FROM check_total WHERE Entity = %s\00"
define i8* @db_check_total_entity_report_sql() {
%1 = load i8*, i8** @db_check_total_entity_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [45 x i8] c"SELECT * FROM check_total WHERE Entity = %s\00"
define i8* @db_check_total_entity_report_sql() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void report_error(char msg[], char line[], int lineno, int columnno) {
  printf("%d:%d: %s\n", lineno, columnno, msg);
  printf(" %s", line);
  printf("%*c\n", columnno + 1, '^');
}


x86 assembly (clang, -O0):
<report_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
mov    $0x5e,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_error>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rsi,%r14
mov    %rdi,%rcx
lea    0xedd(%rip),%rdi
mov    %edx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
mov    $0x5e,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d:%d: %s\0A\00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [5 x i8] c"%*c\0A\00"
define void @report_error(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %8
%16 = add nsw i32 %15, 1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 94)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d:%d: %s\0A\00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [5 x i8] c"%*c\0A\00"
define void @report_error(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i8* %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = add nsw i32 %3, 1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 94)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void mysig_handler(int s) { write(1, "!", 1); }


x86 assembly (clang, -O0):
<mysig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edx
lea    0xed9(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysig_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"!\00"
define void @mysig_handler(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ be32_to_cpu(int /*<<< orphan*/);
int32_t cpu_to_be32(int32_t x) { return (be32_to_cpu(x)); }


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

x86 assembly (clang, -O2):
<cpu_to_be32>:
jmp    1030 <be32_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be32(i32 %0) {
%2 = tail call i32 @be32_to_cpu(i32 %0)
ret i32 %2
}
void gtk_cell_layout_pack_end() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_layout_pack_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_WRLCK;
int get_file_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int get_writew_lock(int fd) { return (get_file_lock(fd, F_SETLKW, F_WRLCK)); }


x86 assembly (clang, -O0):
<get_writew_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
call   1030 <get_file_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_writew_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <get_file_lock@plt>

LLVM IR (-O0):
@F_SETLKW = global i32 0
@F_WRLCK = global i32 0
define i32 @get_writew_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETLKW
%5 = load i32, i32* @F_WRLCK
%6 = call i32 @get_file_lock(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@F_SETLKW = global i32 0
@F_WRLCK = global i32 0
define i32 @get_writew_lock(i32 %0) {
%2 = load i32, i32* @F_SETLKW
%3 = load i32, i32* @F_WRLCK
%4 = tail call i32 @get_file_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p_ind(int ilvl) {
  int i;
  for (i = 0; i < ilvl; i++)
    printf("  ");
}


x86 assembly (clang, -O0):
<p_ind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <p_ind+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <p_ind+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_ind>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <p_ind+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <p_ind+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
define void @p_ind(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @p_ind(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int eingabe(int x) {
  int zahl;
  if (x == 0) {
    printf("Zahl eingeben:\n");
    scanf("%i", &zahl);
  } else {
    printf("Zahl %i eingeben:\n", x);
    scanf("%i", &zahl);
  }
  return zahl;
}


x86 assembly (clang, -O0):
<eingabe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <eingabe+0x38>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1179 <eingabe+0x59>
mov    -0x4(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eingabe>:
push   %rax
test   %edi,%edi
je     1147 <eingabe+0x17>
mov    %edi,%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1153 <eingabe+0x23>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [19 x i8] c"Zahl %i eingeben:\0A\00"
@str = [15 x i8] c"Zahl eingeben:\00"
define i32 @eingabe(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %7, %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
ret i32 %11
}
void ExttBlackListAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttBlackListAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_logs();
int /*<<< orphan*/ pi_timer_stop();
int /*<<< orphan*/ set_service_running(int);
void service_stop() {
  pi_timer_stop();
  set_service_running(false);
  close_logs();
}


x86 assembly (clang, -O0):
<service_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <pi_timer_stop@plt>
xor    %edi,%edi
call   1030 <set_service_running@plt>
mov    $0x0,%al
call   1040 <close_logs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<service_stop>:
push   %rax
xor    %eax,%eax
call   1050 <pi_timer_stop@plt>
xor    %edi,%edi
call   1030 <set_service_running@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <close_logs@plt>

LLVM IR (-O0):
define void @service_stop() {
%1 = call i32 (...) @pi_timer_stop()
%2 = call i32 @set_service_running(i32 0)
%3 = call i32 (...) @close_logs()
ret void
}

LLVM IR (-O2):
define void @service_stop() {
%1 = tail call i32 (...) @pi_timer_stop()
%2 = tail call i32 @set_service_running(i32 0)
%3 = tail call i32 (...) @close_logs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__1__AtmegaCompare__stop();
void AtmegaCompareP__1__Alarm__stop(void) {
  AtmegaCompareP__1__AtmegaCompare__stop();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__1__Alarm__stop() {
%1 = tail call i32 (...) @AtmegaCompareP__1__AtmegaCompare__stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *progname) {
  printf("Usage:\n");
  printf(
      "%s <dest_path>\tdest_path is optional, when omitted the `pwd` is used\n",
      progname);
  printf("%s --help\t\tto display this info\n", progname);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [70 x i8] c"%s <dest_path>\09dest_path is optional, when omitted the `pwd` is used\0A\00"
@.str.2 = [33 x i8] c"%s --help\09\09to display this info\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [70 x i8] c"%s <dest_path>\09dest_path is optional, when omitted the `pwd` is used\0A\00"
@.str.2 = [33 x i8] c"%s --help\09\09to display this info\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("Argument %d = %s\n", i, argv[i]);
  }
  exit(0xff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
mov    $0xff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Argument %d = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @exit(i32 255)
unreachable
}
/* Variables and functions */
scalar_t__ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char buf[1024];
  while (gets(buf)) {
    printf("PIPE EXAMPLE: ");
    puts(buf);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     1175 <main+0x45>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <puts@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     117d <main+0x4d>
lea    0xeb2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"PIPE EXAMPLE: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i64 @gets(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"PIPE EXAMPLE: \00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* %2)
%8 = call i64 @gets(i8* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
unsigned long getElapsedTime(void) {}


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

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

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

LLVM IR (-O2):
define i64 @getElapsedTime() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  printf("Enter a and b");
  scanf("%d%d", &a, &b);
  if (a < b) {
    printf("a is smaller than b");
  } else {
    printf("b is smaller than a");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <main+0x4c>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <main+0x58>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    (%rsp),%eax
lea    0xec4(%rip),%rax
lea    0xed1(%rip),%rdi
cmovl  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter a and b\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [20 x i8] c"a is smaller than b\00"
@.str.3 = [20 x i8] c"b is smaller than a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter a and b\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [20 x i8] c"a is smaller than b\00"
@.str.3 = [20 x i8] c"b is smaller than a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
%10 = select i1 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0)
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int file_exists(char *fileName) {
  struct stat buf;
  int i = stat(fileName, &buf);
  if (i == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <file_exists+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <file_exists+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ hello;

/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
int main() {
  static const char hello[] = "hello world\n";
  write(1, hello, sizeof(hello));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.hello = internal constant [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @main.hello, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@main.hello = internal constant [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @main.hello, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ aa_tf_qrk1(double const *, double const *, double, double *);
int /*<<< orphan*/ aa_tf_qvel2diff(double *, double const *, double *);
void qvelrk4_term(const double q0[4], const double v[3], const double dq0[4],
                  double dt, double dq1[4]) {
  double qtmp[4];
  aa_tf_qrk1(q0, dq0, dt, qtmp);
  aa_tf_qvel2diff(qtmp, v, dq1);
}


x86 assembly (clang, -O0):
<qvelrk4_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    -0x50(%rbp),%rdx
call   1030 <aa_tf_qrk1@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <aa_tf_qvel2diff@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qvelrk4_term>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rsp,%r15
mov    %rdx,%rsi
mov    %r15,%rdx
call   1030 <aa_tf_qrk1@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <aa_tf_qvel2diff@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @qvelrk4_term(double* %0, double* %1, double* %2, double %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double*
%11 = alloca [4 x double]
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
store double* %4, double** %10
%12 = load double*, double** %6
%13 = load double*, double** %8
%14 = load double, double* %9
%15 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%16 = call i32 @aa_tf_qrk1(double* %12, double* %13, double %14, double* %15)
%17 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%18 = load double*, double** %7
%19 = load double*, double** %10
%20 = call i32 @aa_tf_qvel2diff(double* %17, double* %18, double* %19)
ret void
}

LLVM IR (-O2):
define void @qvelrk4_term(double* %0, double* %1, double* %2, double %3, double* %4) {
%6 = alloca [4 x double]
%7 = bitcast [4 x double]* %6 to i8*
%8 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%9 = call i32 @aa_tf_qrk1(double* %0, double* %2, double %3, double* %8)
%10 = call i32 @aa_tf_qvel2diff(double* %8, double* %1, double* %4)
ret void
}
/* Type definitions */
struct section_hash_iter {
  int dummy;
};
struct section_hash {
  int dummy;
};
struct iterator {
  int dummy;
};
struct genhash_iter {
  int dummy;
};
struct genhash {
  int dummy;
};

/* Variables and functions */
struct iterator *genhash_key_iter_init(struct genhash_iter *,
                                       struct genhash const *);
struct iterator *section_hash_key_iter_init(struct section_hash_iter *iter,
                                            const struct section_hash *tthis) {
  return genhash_key_iter_init((struct genhash_iter *)iter,
                               (const struct genhash *)tthis);
}


x86 assembly (clang, -O0):
<section_hash_key_iter_init>:
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 <genhash_key_iter_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<section_hash_key_iter_init>:
jmp    1030 <genhash_key_iter_init@plt>

LLVM IR (-O0):
%struct.iterator = type { i32 }
%struct.section_hash_iter = type { i32 }
%struct.section_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @section_hash_key_iter_init(%struct.section_hash_iter* %0, %struct.section_hash* %1) {
%3 = alloca %struct.section_hash_iter*
%4 = alloca %struct.section_hash*
store %struct.section_hash_iter* %0, %struct.section_hash_iter** %3
store %struct.section_hash* %1, %struct.section_hash** %4
%5 = load %struct.section_hash_iter*, %struct.section_hash_iter** %3
%6 = bitcast %struct.section_hash_iter* %5 to %struct.genhash_iter*
%7 = load %struct.section_hash*, %struct.section_hash** %4
%8 = bitcast %struct.section_hash* %7 to %struct.genhash*
%9 = call %struct.iterator* @genhash_key_iter_init(%struct.genhash_iter* %6, %struct.genhash* %8)
ret %struct.iterator* %9
}

LLVM IR (-O2):
%struct.iterator = type { i32 }
%struct.section_hash_iter = type { i32 }
%struct.section_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @section_hash_key_iter_init(%struct.section_hash_iter* %0, %struct.section_hash* %1) {
%3 = bitcast %struct.section_hash_iter* %0 to %struct.genhash_iter*
%4 = bitcast %struct.section_hash* %1 to %struct.genhash*
%5 = tail call %struct.iterator* @genhash_key_iter_init(%struct.genhash_iter* %3, %struct.genhash* %4)
ret %struct.iterator* %5
}
long xchg(long *ptr, long val) {
  __asm__ volatile("lock; xchgq %0, %1\n\t"
                   : "+m"(*ptr), "+r"(val)
                   :
                   : "memory", "cc");
  return val;
}


x86 assembly (clang, -O0):
<xchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
lock xchg %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @xchg(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 asm sideeffect "lock; xchgq $0, $1\0A\09", "=*m,=r,*m,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %5, i64* elementtype(i64) %5, i64 %6)
store i64 %7, i64* %4
%8 = load i64, i64* %4
ret i64 %8
}

LLVM IR (-O2):
define i64 @xchg(i64* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "lock; xchgq $0, $1\0A\09", "=*m,=r,*m,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64* elementtype(i64) %0, i64 %1)
ret i64 %3
}