xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_gid;
};
struct group {
  char *gr_name;
};

/* Variables and functions */
struct group *getgrgid(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int _print_grp_info(struct stat file_stat) {
  struct group *grp;
  if ((grp = getgrgid(file_stat.st_gid)) == NULL)
    return -1;
  printf("%s", grp->gr_name);
  return 0;
}


x86 assembly (clang, -O0):
<_print_grp_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114d <_print_grp_info+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <_print_grp_info+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_grp_info>:
push   %rax
call   1040 <getgrgid@plt>
test   %rax,%rax
je     113e <_print_grp_info+0x1e>
mov    (%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.group = type { i8* }
@.str = [3 x i8] c"%s\00"
define i32 @_print_grp_info(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_i2c_read_register_rs(char *, char *, int);
int /*<<< orphan*/ bcm2835_i2c_setSlaveAddress(unsigned char);
unsigned char I2C_ReadByteRegister(unsigned char address, char reg) {
  char val = 0;
  bcm2835_i2c_setSlaveAddress(address);
  bcm2835_i2c_read_register_rs(&reg, &val, 1);
  return val;
}


x86 assembly (clang, -O0):
<I2C_ReadByteRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
lea    -0x2(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x1,%edx
call   1040 <bcm2835_i2c_read_register_rs@plt>
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_ReadByteRegister>:
push   %rax
mov    %sil,0x7(%rsp)
movb   $0x0,0x6(%rsp)
call   1030 <bcm2835_i2c_setSlaveAddress@plt>
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
mov    $0x1,%edx
call   1040 <bcm2835_i2c_read_register_rs@plt>
mov    0x6(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @I2C_ReadByteRegister(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
store i8 0, i8* %5
%6 = load i8, i8* %3
%7 = call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %6)
%8 = call i32 @bcm2835_i2c_read_register_rs(i8* %4, i8* %5, i32 1)
%9 = load i8, i8* %5
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @I2C_ReadByteRegister(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %1, i8* %3
store i8 0, i8* %4
%5 = tail call i32 @bcm2835_i2c_setSlaveAddress(i8 zeroext %0)
%6 = call i32 @bcm2835_i2c_read_register_rs(i8* %3, i8* %4, i32 1)
%7 = load i8, i8* %4
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_trip_current();
int /*<<< orphan*/ roadmap_trip_save(int /*<<< orphan*/);
void roadmap_start_save_trip(void) {
  roadmap_trip_save(roadmap_trip_current());
}


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

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

LLVM IR (-O0):
define void @roadmap_start_save_trip() {
%1 = call i32 (...) @roadmap_trip_current()
%2 = call i32 @roadmap_trip_save(i32 %1)
ret void
}

LLVM IR (-O2):
define void @roadmap_start_save_trip() {
%1 = tail call i32 (...) @roadmap_trip_current()
%2 = tail call i32 @roadmap_trip_save(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t rtcp_xr_dlrr_get_lrr(const uint8_t *p_rtcp_xr_dlrr) {
  return (p_rtcp_xr_dlrr[8] << 24) | (p_rtcp_xr_dlrr[9] << 16) |
         (p_rtcp_xr_dlrr[10] << 8) | p_rtcp_xr_dlrr[11];
}


x86 assembly (clang, -O0):
<rtcp_xr_dlrr_get_lrr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x24(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x2c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcp_xr_dlrr_get_lrr>:
mov    0x20(%rdi),%eax
mov    0x24(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtcp_xr_dlrr_get_lrr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 9
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 11
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @rtcp_xr_dlrr_get_lrr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 10
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 11
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("What the heck is going on?");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"What the heck is going on?\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"What the heck is going on?\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ DBL_MANT_DIG;
double digitsdbl_(double *x) { return (double)DBL_MANT_DIG; }


x86 assembly (clang, -O0):
<digitsdbl_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
cvtsi2sdq (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitsdbl_>:
mov    0x2ee1(%rip),%rax
cvtsi2sdq (%rax),%xmm0
ret

LLVM IR (-O0):
@DBL_MANT_DIG = global i64 0
define double @digitsdbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load i64, i64* @DBL_MANT_DIG
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
@DBL_MANT_DIG = global i64 0
define double @digitsdbl_(double* nocapture readnone %0) {
%2 = load i64, i64* @DBL_MANT_DIG
%3 = sitofp i64 %2 to double
ret double %3
}
void printMaxValue(int *value) {
  printf("\n");
  printf("Max Value = %i \n", value);
}


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

x86 assembly (clang, -O2):
<printMaxValue>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [17 x i8] c"Max Value = %i \0A\00"
define void @printMaxValue(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Max Value = %i \0A\00"
define void @printMaxValue(i32* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswblank(int /*<<< orphan*/);
int iswblank_l(wint_t c, locale_t l) { return iswblank(c); }


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

x86 assembly (clang, -O2):
<iswblank_l>:
jmp    1030 <iswblank@plt>

LLVM IR (-O0):
define i32 @iswblank_l(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 = call i32 @iswblank(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @iswblank_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswblank(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void help(char *s) {
  fprintf(stderr,
          "\t usage: %s out.ply disp.tif msk.png "
          "rpc_ref.xml rpc_sec.xml [colors.png] [extra.tif]"
          "[-href \"h1 ... h9\"] [-hsec \"h1 ... h9\"] "
          "[--utm-zone ZONE] [--ascii] [--mask-orig msk.png] "
          "[--lon-m l0] [--lon-M lf] [--lat-m l0] [--lat-M lf] "
          "[--col-m x0] [--col-M xf] [--row-m y0] [--row-M yf]\n",
          s);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [280 x i8] c"\09 usage: %s out.ply disp.tif msk.png rpc_ref.xml rpc_sec.xml [colors.png] [extra.tif][-href \22h1 ... h9\22] [-hsec \22h1 ... h9\22] [--utm-zone ZONE] [--ascii] [--mask-orig msk.png] [--lon-m l0] [--lon-M lf] [--lat-m l0] [--lat-M lf] [--col-m x0] [--col-M xf] [--row-m y0] [--row-M yf]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [280 x i8] c"\09 usage: %s out.ply disp.tif msk.png rpc_ref.xml rpc_sec.xml [colors.png] [extra.tif][-href \22h1 ... h9\22] [-hsec \22h1 ... h9\22] [--utm-zone ZONE] [--ascii] [--mask-orig msk.png] [--lon-m l0] [--lon-M lf] [--lat-m l0] [--lat-M lf] [--col-m x0] [--col-M xf] [--row-m y0] [--row-M yf]\0A\00"
define void @help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([280 x i8], [280 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct intf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RTM_NEWADDR;
int /*<<< orphan*/ netlink_addr_do(int, int /*<<< orphan*/, struct intf *);
void netlink_addr_add(int nl, struct intf *intf) {
  netlink_addr_do(nl, RTM_NEWADDR, intf);
}


x86 assembly (clang, -O0):
<netlink_addr_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <netlink_addr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netlink_addr_add>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <netlink_addr_do@plt>

LLVM IR (-O0):
%struct.intf = type { i32 }
@RTM_NEWADDR = global i32 0
define void @netlink_addr_add(i32 %0, %struct.intf* %1) {
%3 = alloca i32
%4 = alloca %struct.intf*
store i32 %0, i32* %3
store %struct.intf* %1, %struct.intf** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @RTM_NEWADDR
%7 = load %struct.intf*, %struct.intf** %4
%8 = call i32 @netlink_addr_do(i32 %5, i32 %6, %struct.intf* %7)
ret void
}

LLVM IR (-O2):
%struct.intf = type { i32 }
@RTM_NEWADDR = global i32 0
define void @netlink_addr_add(i32 %0, %struct.intf* %1) {
%3 = load i32, i32* @RTM_NEWADDR
%4 = tail call i32 @netlink_addr_do(i32 %0, i32 %3, %struct.intf* %1)
ret void
}
/* Variables and functions */
unsigned char inb(unsigned int);
unsigned char smbus_get_result(unsigned smbus_io_base) {
  return inb(smbus_io_base + 0x00);
}


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

x86 assembly (clang, -O2):
<smbus_get_result>:
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @smbus_get_result(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 0
%5 = call zeroext i8 @inb(i32 %4)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @smbus_get_result(i32 %0) {
%2 = tail call zeroext i8 @inb(i32 %0)
ret i8 %2
}
void video_key_handler(char keycodde) { return; }


x86 assembly (clang, -O0):
<video_key_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @video_key_handler(i8 signext %0) {
ret void
}
/* Variables and functions */
unsigned int list_concatenate(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool test_list_concatenate_null_params(void) {
  bool pass = false;
  unsigned int res = list_concatenate(NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_concatenate_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <list_concatenate@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113f <test_list_concatenate_null_params+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_concatenate_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <list_concatenate@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_concatenate_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_concatenate(i32* null, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_concatenate_null_params() {
%1 = tail call i32 @list_concatenate(i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float exp2f(float);
float test2f(float x) { return exp2f(x); }


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

x86 assembly (clang, -O2):
<test2f>:
jmp    1030 <exp2f@plt>

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

LLVM IR (-O2):
define float @test2f(float %0) {
%2 = tail call float @exp2f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ gdtSet(int, int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ gdtflush();
void initGdt() {
  gdtSet(0, 0, 0, 0, 0);
  gdtSet(1, 0, 0xFFFFFFFF, 0x9A, 0xCF);
  gdtSet(2, 0, 0xFFFFFFFF, 0x92, 0xCF);
  gdtSet(3, 0, 0xFFFFFFFF, 0xFA, 0xCF);
  gdtSet(4, 0, 0xFFFFFFFF, 0xF2, 0xCF);
  gdtflush();
}


x86 assembly (clang, -O0):
<initGdt>:
push   %rbp
mov    %rsp,%rbp
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1040 <gdtSet@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x92,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfa,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x4,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf2,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x0,%al
call   1030 <gdtflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGdt>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <gdtSet@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x9a,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x92,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xfa,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
mov    $0x4,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xf2,%ecx
mov    $0xcf,%r8d
call   1040 <gdtSet@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gdtflush@plt>

LLVM IR (-O0):
define void @initGdt() {
%1 = call i32 @gdtSet(i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = call i32 @gdtSet(i32 1, i32 0, i32 -1, i32 154, i32 207)
%3 = call i32 @gdtSet(i32 2, i32 0, i32 -1, i32 146, i32 207)
%4 = call i32 @gdtSet(i32 3, i32 0, i32 -1, i32 250, i32 207)
%5 = call i32 @gdtSet(i32 4, i32 0, i32 -1, i32 242, i32 207)
%6 = call i32 (...) @gdtflush()
ret void
}

LLVM IR (-O2):
define void @initGdt() {
%1 = tail call i32 @gdtSet(i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @gdtSet(i32 1, i32 0, i32 -1, i32 154, i32 207)
%3 = tail call i32 @gdtSet(i32 2, i32 0, i32 -1, i32 146, i32 207)
%4 = tail call i32 @gdtSet(i32 3, i32 0, i32 -1, i32 250, i32 207)
%5 = tail call i32 @gdtSet(i32 4, i32 0, i32 -1, i32 242, i32 207)
%6 = tail call i32 (...) @gdtflush()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getmillisecs() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1e3 + tv.tv_usec * 1e-3;
}


x86 assembly (clang, -O0):
<getmillisecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed1(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmillisecs>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl (%rsp),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
mulsd  0xed2(%rip),%xmm1
mulsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @getmillisecs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.000000e-03
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @getmillisecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 1.000000e-03
%11 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int close(int fd) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
__attribute__((weak)) void fd_nrf8001_write_dynamic_data_complete(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_write_dynamic_data_complete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void output(void **ar, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d. %s\n", i, (char *)ar[i]);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <output+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <output+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%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    1130 <output+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d. %s\0A\00"
define void @output(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 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
ret void
}
void ARGBRect() {}


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

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

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

LLVM IR (-O2):
define void @ARGBRect() {
ret void
}
int chars_compare(const void *aa, const void *bb) {
  int a = *(const int *)aa;
  int b = *(const int *)bb;
  return a - b;
}


x86 assembly (clang, -O0):
<chars_compare>:
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
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @chars_compare(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 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @chars_compare(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 = sub nsw i32 %4, %6
ret i32 %7
}
void begin(void) {}


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

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

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

LLVM IR (-O2):
define void @begin() {
ret void
}
int isStatic(char *regex, int var) { return !(regex[0] == var); }


x86 assembly (clang, -O0):
<isStatic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isStatic>:
movsbl (%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @isStatic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isStatic(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ append_number(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void hour_to_24h_word(int hours, char *words) {
  hours = hours % 24;
  strcpy(words, "");
  append_number(words, hours);
}


x86 assembly (clang, -O0):
<hour_to_24h_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <append_number@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hour_to_24h_word>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movslq %edi,%rbx
imul   $0x2aaaaaab,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
lea    0xeb3(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <append_number@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @hour_to_24h_word(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = srem i32 %5, 24
store i32 %6, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = load i32, i32* %3
%11 = call i32 @append_number(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @hour_to_24h_word(i32 %0, i8* %1) {
%3 = srem i32 %0, 24
%4 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @append_number(i8* %1, i32 %3)
ret void
}
/* Variables and functions */
void ft_strclr(char *s) {
  while (s != NULL && *s) {
    *s = '\0';
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <ft_strclr+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1138 <ft_strclr+0x38>
jmp    1150 <ft_strclr+0x50>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ft_strclr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
unsigned int gf32_mult(unsigned int, unsigned int);
unsigned gf32_pow(unsigned a, int k) {
  if (!k) {
    return 1;
  }
  unsigned x = gf32_pow(gf32_mult(a, a), k >> 1);
  if (k & 1) {
    x = gf32_mult(x, a);
  }
  return x;
}


x86 assembly (clang, -O0):
<gf32_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1144 <gf32_pow+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1182 <gf32_pow+0x62>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <gf32_mult@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
sar    $0x1,%esi
call   1030 <gf32_pow@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117c <gf32_pow+0x5c>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <gf32_mult@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf32_pow>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1152 <gf32_pow+0x32>
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edi,%esi
call   1040 <gf32_mult@plt>
mov    %ebp,%esi
sar    %esi
mov    %eax,%edi
call   1030 <gf32_pow@plt>
test   $0x1,%bpl
je     1157 <gf32_pow+0x37>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gf32_mult@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gf32_pow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %3
br label %26
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @gf32_mult(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = ashr i32 %14, 1
%16 = call i32 @gf32_pow(i32 %13, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = and i32 %17, 1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %10
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = call i32 @gf32_mult(i32 %21, i32 %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %20, %10
%25 = load i32, i32* %6
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @gf32_pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i32 @gf32_mult(i32 %0, i32 %0)
%6 = ashr i32 %1, 1
%7 = tail call i32 @gf32_pow(i32 %5, i32 %6)
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @gf32_mult(i32 %7, i32 %0)
br label %12
12: ; preds = %4, %10, %2
%13 = phi i32 [ 1, %2 ], [ %11, %10 ], [ %7, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void mkdir_exit(char *message, int i) {
  printf("%s", message);
  exit(1);
}


x86 assembly (clang, -O0):
<mkdir_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<mkdir_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @mkdir_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @mkdir_exit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void swap_ptr(char **fst, char **snd) {
  char *tmp;
  tmp = *fst;
  *fst = *snd;
  *snd = tmp;
}


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

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

LLVM IR (-O0):
define void @swap_ptr(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap_ptr(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void writeo(int i) {
  static char buf[3];
  buf[0] = ((i >> 6) & 7) + '0';
  buf[1] = ((i >> 3) & 7) + '0';
  buf[2] = (i & 7) + '0';
  write(1, buf, 3);
}


x86 assembly (clang, -O0):
<writeo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,0x2efc(%rip)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,0x2eeb(%rip)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
add    $0x30,%eax
mov    %al,0x2edd(%rip)
mov    $0x1,%edi
lea    0x2ecf(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeo>:
mov    %edi,%eax
shr    $0x6,%eax
and    $0x7,%al
or     $0x30,%al
mov    %al,0x2f0a(%rip)
lea    0x2f03(%rip),%rsi
mov    %edi,%eax
shr    $0x3,%al
and    $0x7,%al
or     $0x30,%al
mov    %al,0x2ef5(%rip)
and    $0x7,%dil
or     $0x30,%dil
mov    %dil,0x2ee7(%rip)
mov    $0x1,%edi
mov    $0x3,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@writeo.buf = internal global [3 x i8] zeroinitializer
define void @writeo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = and i32 %4, 7
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
store i8 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 0)
%8 = load i32, i32* %2
%9 = ashr i32 %8, 3
%10 = and i32 %9, 7
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 1)
%13 = load i32, i32* %2
%14 = and i32 %13, 7
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
store i8 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 2)
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@writeo.buf = internal global [3 x i8] zeroinitializer
define void @writeo(i32 %0) {
%2 = lshr i32 %0, 6
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 7
%5 = or i8 %4, 48
store i8 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 0)
%6 = trunc i32 %0 to i8
%7 = lshr i8 %6, 3
%8 = and i8 %7, 7
%9 = or i8 %8, 48
store i8 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 1)
%10 = and i8 %6, 7
%11 = or i8 %10, 48
store i8 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 2)
%12 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @writeo.buf, i64 0, i64 0), i32 3)
ret void
}
void gtk_tree_path_append_index() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_append_index() {
ret void
}
/* Variables and functions */
unsigned char gfx_inb(int);
int /*<<< orphan*/ gfx_outb(int, unsigned char);
int /*<<< orphan*/ toggle_Centaurus_9211_clock();
void write_Centaurus_CX9211_GPIO(unsigned char databit) {
  unsigned char data_port_val;
  databit <<= 7;
  data_port_val = gfx_inb(0xE0);
  data_port_val &= ~0x80;
  data_port_val |= databit;
  gfx_outb(0xE0, data_port_val);
  toggle_Centaurus_9211_clock();
  return;
}


x86 assembly (clang, -O0):
<write_Centaurus_CX9211_GPIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x7,%eax
mov    %al,-0x1(%rbp)
mov    $0xe0,%edi
call   1030 <gfx_inb@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0xe0,%edi
movzbl -0x2(%rbp),%esi
call   1040 <gfx_outb@plt>
mov    $0x0,%al
call   1050 <toggle_Centaurus_9211_clock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_Centaurus_CX9211_GPIO>:
push   %rbx
mov    %edi,%ebx
shl    $0x7,%bl
mov    $0xe0,%edi
call   1030 <gfx_inb@plt>
and    $0x7f,%al
or     %bl,%al
movzbl %al,%esi
mov    $0xe0,%edi
call   1040 <gfx_outb@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <toggle_Centaurus_9211_clock@plt>

LLVM IR (-O0):
define void @write_Centaurus_CX9211_GPIO(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 7
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = call zeroext i8 @gfx_inb(i32 224)
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, -129
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
%19 = load i8, i8* %3
%20 = call i32 @gfx_outb(i32 224, i8 zeroext %19)
%21 = call i32 (...) @toggle_Centaurus_9211_clock()
ret void
}

LLVM IR (-O2):
define void @write_Centaurus_CX9211_GPIO(i8 zeroext %0) {
%2 = shl i8 %0, 7
%3 = tail call zeroext i8 @gfx_inb(i32 224)
%4 = and i8 %3, 127
%5 = or i8 %4, %2
%6 = tail call i32 @gfx_outb(i32 224, i8 zeroext %5)
%7 = tail call i32 (...) @toggle_Centaurus_9211_clock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Chip_SetupIrcClocking();
void Chip_SystemInit(void) { Chip_SetupIrcClocking(); }


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

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

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

LLVM IR (-O2):
define void @Chip_SystemInit() {
%1 = tail call i32 (...) @Chip_SetupIrcClocking()
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *objc_calloc(size_t nelem, size_t size) { return calloc(nelem, size); }


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

x86 assembly (clang, -O2):
<objc_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @objc_calloc(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 i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @objc_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help(void) { puts("retab [-h] [-i N] [-r] -s | -t file1 ..."); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"retab [-h] [-i N] [-r] -s | -t file1 ...\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"retab [-h] [-i N] [-r] -s | -t file1 ...\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void remove_filename(char *url) {
  int i = 0;
  int len_str = strlen(url);
  for (i = len_str;; i--) {
    if (url[i] == 47) {
      url[i] = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<remove_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    115b <remove_filename+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    116e <remove_filename+0x5e>
jmp    1160 <remove_filename+0x50>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <remove_filename+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_filename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x2f,-0x1(%rax)
lea    -0x1(%rax),%rax
jne    1130 <remove_filename+0x20>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %9, %4 ], [ %3, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
%9 = add i64 %5, -1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %11
ret void
}
/* Variables and functions */
void *realloc(void *, long);
void *ei_realloc(void *orig, long size) { return realloc(orig, size); }


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

x86 assembly (clang, -O2):
<ei_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @ei_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @ei_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}